NorgesGruppen Grocery Detection Models

ONNX models for the NorgesGruppen grocery shelf detection competition. Detect and classify 356 product categories on store shelf images.

Quick Start

from huggingface_hub import snapshot_download

# Download the ensemble (best accuracy)
path = snapshot_download(
    "valiantlynxz/norwegian-grocery-detector",
    allow_patterns="submission_ensemble/*",
)

# Download just the lightweight model
path = snapshot_download(
    "valiantlynxz/norwegian-grocery-detector",
    allow_patterns="submission_yolo12n/*",
)

# Download a specific single model
path = snapshot_download(
    "valiantlynxz/norwegian-grocery-detector",
    allow_patterns="submission_yolo12x/*",
)

# Download everything
path = snapshot_download("valiantlynxz/norwegian-grocery-detector")

Variants

Variant Folder Architecture Size Notes
YOLOv8m submission/ YOLOv8m 100 MB General purpose
YOLOv8l submission_large/ YOLOv8l 168 MB Higher accuracy
YOLO12n submission_yolo12n/ YOLO12n 11 MB Lightweight/fast
YOLO12x submission_yolo12x/ YOLO12x 228 MB Best single model
Ensemble submission_ensemble/ WBF (3 models) 407 MB Best overall accuracy

Ensemble Details

submission_ensemble/ fuses predictions from 3 models using Weighted Boxes Fusion:

Model file Architecture Weight Size
model_yolo12x.onnx YOLO12x 3 228 MB
model_yolov8l.onnx YOLOv8l 2 168 MB
model_yolo12n.onnx YOLO12n 1 11 MB

Inference

Each submission folder contains a self-contained run.py:

python submission_ensemble/run.py --input /path/to/images --output predictions.json

Output format (COCO):

[{"image_id": 1, "category_id": 42, "bbox": [141, 49, 169, 152], "score": 0.95}]

Programmatic Variant Selection

import json
from pathlib import Path
from huggingface_hub import hf_hub_download, snapshot_download

# Load config to discover variants
config_path = hf_hub_download("valiantlynxz/norwegian-grocery-detector", "config.json")
config = json.loads(Path(config_path).read_text())

# List available variants
for name, info in config["variants"].items():
    print(f"{name}: {info['architecture']} ({info['size_mb']} MB) -> {info['folder']}/")

# Download a specific variant by name
variant = config["variants"]["yolo12x"]
path = snapshot_download(
    "valiantlynxz/norwegian-grocery-detector",
    allow_patterns=f"{variant['folder']}/*",
)

Requirements

  • Python 3.11
  • onnxruntime-gpu (CUDA 12.4) or onnxruntime (CPU)
  • opencv-python, numpy
  • ensemble_boxes (ensemble variant only)

Training

Trained on valiantlynxz/norwegian-grocery:

  • 248 shelf images, 22,731 annotations, 356 categories
  • Input size: 1280x1280
  • Augmentations via ultralytics + albumentations

Usage with the Detection Project in https://github.com/kuben-labs/nmai

cd detection/
make models    # downloads all variants
make setup     # downloads data + models + generates YOLO format
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including valiantlynxz/norwegian-grocery-detector