CoolFace
Apppublic

uv-scripts/sam3-detection-browser

sourceHugging Faceupdated 6mo agoView on Hugging Face
5likes
App README

๐Ÿ” 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

  1. 1.Enter a Dataset ID: Input any HuggingFace dataset that contains object detection results from SAM3
  2. 2.Default: davanstrien/newspapers-image-predictions
  3. 3.Format: username/dataset-name
  1. 1.Select Split: Choose which dataset split to view (train/validation/test)
  1. 1.Adjust Filters:
  2. 2.Move the confidence slider to filter detections by minimum confidence score
  3. 3.Check "Show only images with detections" to hide images without any detected objects
  1. 1.Browse: Navigate through pages using Previous/Next buttons

Dataset Requirements

This browser works with any HuggingFace dataset that has:

  • โ€”An image column containing images
  • โ€”An objects column with the structure:
python
  {
      "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

Creating Your Own Detection Dataset

Use the SAM3 detection script to create your own datasets:

bash
# 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

License

MIT License - Feel free to use and modify for your own projects!