Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
imagewidth (px)
481
5.71k
End of preview. Expand in Data Studio

NorgesGruppen Grocery Detection Dataset

Object detection dataset for Norwegian grocery store shelf images, from the NorgesGruppen Data competition.

Quick Start

from datasets import load_dataset

# COCO format (default) - raw competition annotations
ds = load_dataset("valiantlynxz/norwegian-grocery", trust_remote_code=True)

# YOLO format - auto-converted on load, no scripts needed
ds = load_dataset("valiantlynxz/norwegian-grocery", name="yolo", trust_remote_code=True)

# Product reference images - multi-angle shots per product
ds = load_dataset("valiantlynxz/norwegian-grocery", name="products", trust_remote_code=True)

Configurations

Config Default Description Splits
coco Yes Raw COCO annotations with full metadata train, validation
yolo YOLO normalized [cx, cy, w, h] (converted on-the-fly) train, validation
products Product reference images with metadata train

COCO Config

Each example contains a shelf image and all its COCO-format annotations:

ds = load_dataset("valiantlynxz/norwegian-grocery", trust_remote_code=True)
example = ds["train"][0]

example["image"]          # PIL Image
example["image_id"]       # int
example["width"]          # image width in pixels
example["height"]         # image height in pixels
example["annotations"]    # JSON string of COCO annotation list
# Each annotation: {"id", "category_id", "bbox": [x, y, w, h], "area", "product_code", ...}

YOLO Config

Same images, but bounding boxes are auto-converted to YOLO normalized center format:

ds = load_dataset("valiantlynxz/norwegian-grocery", name="yolo", trust_remote_code=True)
example = ds["train"][0]

example["image"]      # PIL Image
example["image_id"]   # int
example["labels"]     # [int, ...] - category IDs
example["bboxes"]     # [[cx, cy, w, h], ...] - normalized to [0, 1]

Products Config

Reference images for 327 products, organized by product code:

ds = load_dataset("valiantlynxz/norwegian-grocery", name="products", trust_remote_code=True)
example = ds["train"][0]

example["image"]            # PIL Image (one angle)
example["product_code"]     # barcode string
example["product_name"]     # e.g. "EVERGOOD CLASSIC KOKMALT 250G"
example["image_type"]       # "main", "front", "back", "left", "right", "top", "bottom"
example["annotation_count"] # how often this product appears in shelf images

Dataset Summary

  • 248 shelf images from Norwegian grocery stores (Egg, Frokost, Knekkebrod, Varmedrikker)
  • 22,731 bounding box annotations in COCO format
  • 356 product categories (IDs 0-355, where 355 = unknown_product)
  • 327 products with multi-angle reference photos (1,582 images total)
  • Train/val split: 211 / 37 images (85/15, seed=42)

Structure

norwegian_grocery.py         # Custom loading script (auto-discovered by HF)
train/
  annotations.json           # COCO-format annotations
  images/                    # 248 shelf images (.jpg/.jpeg)
NM_NGD_product_images/
  metadata.json              # Product names, barcodes, annotation counts
  {barcode}/                 # Product reference images per barcode
scripts/
  coco_to_yolo.py            # Convert COCO to YOLO format with train/val split

Annotation Format

COCO format (annotations.json):

{
  "images": [{"id": 1, "file_name": "img_00001.jpg", "width": 2000, "height": 1500}],
  "categories": [{"id": 0, "name": "VESTLANDSLEFSA TØRRE 10STK 360G", "supercategory": "product"}],
  "annotations": [{
    "id": 1, "image_id": 1, "category_id": 42,
    "bbox": [141, 49, 169, 152],
    "area": 25688, "iscrowd": 0,
    "product_code": "8445291513365",
    "product_name": "NESCAFE VANILLA LATTE 136G NESTLE",
    "corrected": true
  }]
}

bbox is [x, y, width, height] in pixels (COCO format).

For Local YOLO Training

If you need on-disk YOLO files for ultralytics, the repo includes scripts/coco_to_yolo.py:

python scripts/coco_to_yolo.py \
    --annotations train/annotations.json \
    --images train/images \
    --output yolo \
    --val-ratio 0.15

This creates yolo/images/{train,val}/, yolo/labels/{train,val}/, and configs/dataset.yaml.

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

cd detection/
make data    # clones from HuggingFace
make yolo    # generates YOLO format + dataset.yaml

Statistics

  • Images: 481-5712px wide, 399-4624px tall
  • Average: ~92 annotations per image
  • Most frequent category: unknown_product (355) with 422 annotations
  • Product reference images: 1,582 total across 327 products
Downloads last month
33

Collection including valiantlynxz/norwegian-grocery