ShelfApi

Automatic shelf bay detection and isolation for retail shelf photos. Upload a photo, detect the central bay, correct perspective, and mask surrounding products.

How it works

1
Upload
Shelf photo from store
2
Detect
CNN finds bay boundaries
3
Straighten
Perspective correction
4
Mask
Blur, black, or crop

A trained EfficientNet-B0 model detects four boundary points (left-top, left-bottom, right-top, right-bottom) that define the central shelf bay as a trapezoid. This is then warped to a rectangle (perspective correction) and surrounding products are masked.

Examples

Green lines show detected bay boundaries. Right side shows the result after perspective correction and blur masking.

Low angle — nearly straight-on shelf
Original + detected boundaries
Corrected + masked
Medium angle — slight perspective skew
Original + detected boundaries
Corrected + masked
Strong angle — significant perspective distortion
Original + detected boundaries
Corrected + masked

Try it yourself

📷

Click or drag a shelf photo here

JPG or PNG, any size

Processing...

Original + detected boundaries
Result

API endpoints

POST /api/process-shelf
Upload an image, get back the processed result (detected, corrected, masked).
image file (required) · method blur|black|crop · correct_perspective true|false · detector cnn|gemini
POST /api/detect-meters
Upload an image, get back boundary detection as JSON.
image file (required) · detector cnn|gemini
GET /api/dataset/stats
Get dataset statistics (total images, verified, annotated).