Kirana Detective
Collection
6 items β’ Updated
How to use build-small-hackathon/yolo26n-indian-fmcg-detection with ultralytics:
# Couldn't find a valid YOLO version tag.
# Replace XX with the correct version.
from ultralytics import YOLOvXX
model = YOLOvXX.from_pretrained("build-small-hackathon/yolo26n-indian-fmcg-detection")
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
model.predict(source=source, save=True)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.
| Metric | Value |
|---|---|
| mAP50 (all classes) | 0.428 |
| mAP50-95 (all classes) | 0.302 |
| Total classes | 1,831 |
| Validation images | 1,236 |
| Validation instances | 13,443 |
Training ran for 100 epochs (60 initial + 40 resumed after restart) on an NVIDIA A10G via Modal.
| Dataset | Workspace | Version | Images | Classes |
|---|---|---|---|---|
| Indian Grocery Object Detection | agentsk47 | v1 | ~400 | 10 |
| Grocery Items | IIT Patna | v45 | 6,695 | 20 |
| Indian Market | project-c5ho0 | v2 | 4,694 | 2 |
All three datasets were downloaded in YOLOv8 format, class IDs remapped to a unified list, and merged
before training. The full unified class list (1,831 entries) is in class_names.json.
| File | Description |
|---|---|
best.pt |
PyTorch checkpoint (best mAP50 epoch) |
best.onnx |
ONNX export, opset 12 (recommended for inference) |
class_names.json |
Full list of 1,831 class names (index = class_id) |
import json, numpy as np, onnxruntime as ort
from PIL import Image
session = ort.InferenceSession("best.onnx", providers=["CPUExecutionProvider"])
class_names = json.load(open("class_names.json"))
def preprocess(path, size=640):
img = Image.open(path).convert("RGB").resize((size, size))
return (np.array(img, dtype=np.float32) / 255.0).transpose(2, 0, 1)[None]
input_name = session.get_inputs()[0].name
outputs = session.run(None, {input_name: preprocess("shelf.jpg")})
# outputs[0]: (1, 300, 6) β [x1, y1, x2, y2, confidence, class_id]
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.predict("shelf.jpg", imgsz=640, conf=0.25)
results[0].show()
| Parameter | Value |
|---|---|
| Base model | YOLO26n |
| Input size | 640 Γ 640 |
| Epochs | 100 (60 initial + 40 resumed) |
| Batch size | 16 |
| Early stopping patience | 20 |
| Export format | ONNX opset 12 |
| Hardware | NVIDIA A10G (Modal) |
@misc{kirana-detective-yolo-2026,
title = {Kirana Detective: YOLO26n Indian FMCG Product Detector},
author = {Syed Naazim Hussain},
year = {2026},
url = {https://huggingface.co/naazimsnh02/yolo26n-indian-fmcg-detection}
}