metadata
title: SAM3 Detection Browser
emoji: π
colorFrom: blue
colorTo: green
sdk: static
pinned: false
models:
- facebook/sam3
π SAM3 Object Detection Browser
A simple, interactive web application for browsing and exploring object detection results from Meta's SAM3 (Segment Anything Model 3).
Features
- Visual Detection Display: View images with bounding boxes overlaid on detected objects
- Confidence Filtering: Adjust confidence threshold with a slider to filter detections
- Statistics Dashboard: See overall detection statistics including:
- Total filtered images
- Images with detections
- Total detections
- Average detections per image
- Flexible Navigation: Browse through datasets with pagination
- Real-time Updates: Filters update visualization instantly
- Color-coded Confidence: Bounding boxes and scores are color-coded:
- π’ Green: High confidence (β₯70%)
- π Orange: Medium confidence (40-70%)
- π΄ Red: Low confidence (<40%)
How to Use
Enter a Dataset ID: Input any HuggingFace dataset that contains object detection results from SAM3
- Default:
davanstrien/newspapers-image-predictions - Format:
username/dataset-name
- Default:
Select Split: Choose which dataset split to view (train/validation/test)
Adjust Filters:
- Move the confidence slider to filter detections by minimum confidence score
- Check "Show only images with detections" to hide images without any detected objects
Browse: Navigate through pages using Previous/Next buttons
Dataset Requirements
This browser works with any HuggingFace dataset that has:
- An
imagecolumn containing images - An
objectscolumn with the structure:{ "bbox": [[x, y, width, height], ...], # Bounding box coordinates "category": [0, 0, ...], # Category indices "score": [0.8, 0.6, ...] # Confidence scores }
This matches the output format from the detect-objects.py script.
Example Datasets
- davanstrien/newspapers-image-predictions - Photograph detections in historical newspapers
Creating Your Own Detection Dataset
Use the SAM3 detection script to create your own datasets:
# Detect objects in your images
uv run https://huggingface.co/datasets/uv-scripts/sam3/raw/main/detect-objects.py \
your-dataset \
your-output-dataset \
--class-name "photograph" \
--confidence-threshold 0.5
Then view the results by entering your-output-dataset in this browser!
Technical Details
- Technology: Pure HTML/CSS/JavaScript (no backend required)
- Data Source: HuggingFace Datasets API (parquet endpoint)
- Rendering: HTML5 Canvas for bounding box overlays
- Performance: Loads 12 images per page for optimal performance
Related Projects
- SAM3 Detection Script - Create detection datasets
- SAM3 Model - The base model
- UV Scripts Organization - More ready-to-run ML scripts
License
MIT License - Feel free to use and modify for your own projects!