Fine-tuned
YOLO26n on a
merged dataset of three Indian grocery sources
from Roboflow Universe. Part of the
Kirana Detective project — an AI system for small Indian grocery
stores to visually count and reconcile shelf/counter inventory from photos.
1import json, numpy as np, onnxruntime as ort
2from PIL import Image
3
4session = ort.InferenceSession("best.onnx", providers=["CPUExecutionProvider"])
5class_names = json.load(open("class_names.json"))
6
7def preprocess(path, size=640):
8 img = Image.open(path).convert("RGB").resize((size, size))
9 return (np.array(img, dtype=np.float32) / 255.0).transpose(2, 0, 1)[None]
10
11input_name = session.get_inputs()[0].name
12outputs = session.run(None, {input_name: preprocess("shelf.jpg")})
13# outputs[0]: (1, 300, 6) — [x1, y1, x2, y2, confidence, class_id]
1from ultralytics import YOLO
2
3model = YOLO("best.pt")
4results = model.predict("shelf.jpg", imgsz=640, conf=0.25)
5results[0].show()
1@misc{kirana-detective-yolo-2026,
2 title = {Kirana Detective: YOLO26n Indian FMCG Product Detector},
3 author = {Syed Naazim Hussain},
4 year = {2026},
5 url = {https://huggingface.co/naazimsnh02/yolo26n-indian-fmcg-detection}
6}