AI-powered image annotation tool for Google Colab
Project description
DriverFlow โ Intelligent Image Annotation Tool
A polished, cloud-ready annotation tool powered by GroundingDINO for zero-shot object detection. Deploy to Google Colab in minutes.
Features
โจ Zero-shot Detection โ Detect any objects using natural language prompts
๐ฏ Interactive UI โ Upload images, adjust model parameters, preview results in real-time
๐ Structured Output โ Generate YOLO format annotations automatically
โ๏ธ Colab Native โ Runs entirely in Google Colab with ngrok or Colab proxy tunneling
๐จ Polished Design โ Dark theme UI with real-time feedback and smooth interactions
Prerequisites
- Google Colab access
- GitHub Personal Access Token (PAT) with
reposcope- Create one at https://github.com/settings/tokens
- Permissions needed:
repo(full control)
- (Optional) ngrok auth token for persistent public URL
- Free tier at https://dashboard.ngrok.com/get-started/your-authtoken
- Without ngrok, you can use Colab's built-in proxy (may auto-logout after inactivity)
Quick Start
- Open
colab_launcher.ipynbin Google Colab - Fill in your GitHub credentials in the first cell:
GITHUB_TOKEN = "your_github_pat_here" GITHUB_USERNAME = "your_github_username" NGROK_TOKEN = "your_ngrok_token_here" # optional
- Click Runtime โ Run all
- Wait for the setup to complete (2โ3 minutes)
- Click the printed URL to open the DriverFlow UI
Usage
- Upload Image โ Drag and drop or click to browse
- Enter Text Prompt โ Describe objects to detect (e.g.,
car . person . traffic light) - Adjust Thresholds (optional)
- Box Threshold (0.1โ0.9, default 0.35) โ higher = more confident detections only
- Text Threshold (0.1โ0.9, default 0.25) โ higher = stricter text-alignment matching
- Click Detect โ Model runs and returns:
- Annotated image with bounding boxes and class labels
- Summary table with detection counts and average confidence scores
- Download โ Export results as YOLO format (ZIP file with
annotations.txt+classes.txt)
YOLO Format
The tool exports bounding box annotations in YOLO format:
annotations.txt (one detection per line):
<class_id> <cx> <cy> <w> <h>
class_idโ integer index (0-based, sorted alphabetically by class name)cx, cy, w, hโ normalized coordinates (0โ1 range)cx,cyโ box center (relative to image width/height)w,hโ box width and height (relative to image width/height)
classes.txt (one class name per line, alphabetically sorted):
car
person
traffic light
Architecture
DriverFlow/
โโโ colab_launcher.ipynb # Colab entry point
โโโ backend/
โ โโโ app.py # FastAPI server + GroundingDINO integration
โ โโโ requirements.txt # Python dependencies
โ โโโ static/
โ โโโ index.html # UI markup
โ โโโ style.css # Dark theme styling
โ โโโ app.js # Browser logic & API calls
โโโ README.md
Backend Stack
- FastAPI โ web framework
- GroundingDINO โ zero-shot object detection model
- OpenCV โ image processing
- uvicorn โ ASGI server
- pyngrok โ ngrok integration for Colab tunneling
Frontend Stack
- Vanilla HTML5/CSS3/JS โ no build step, no dependencies
- Drag-and-drop file upload with live image preview
- Real-time slider feedback for model parameters
- Base64 image embedding for inline results
- ZIP download via Blob API
API Reference
POST /api/detect
Runs GroundingDINO inference on an uploaded image.
Request (multipart/form-data):
| Field | Type | Default | Description |
|---|---|---|---|
image |
File | โ | Image file (JPEG, PNG, etc.) |
text_prompt |
str | โ | Detection prompt (e.g., "car . person") |
box_threshold |
float | 0.35 | Objectness score cutoff |
text_threshold |
float | 0.25 | Text-alignment score cutoff |
Response (200 application/json):
{
"detections": [
{
"phrase": "car",
"confidence": 0.87,
"box_cxcywh": [0.51, 0.48, 0.12, 0.18]
}
],
"class_counts": [
{"class": "car", "count": 3, "avg_confidence": 0.75},
{"class": "person", "count": 1, "avg_confidence": 0.92}
],
"annotated_image_b64": "<base64 JPEG string>",
"image_width": 1280,
"image_height": 720
}
POST /api/download_yolo
Generates a ZIP file with YOLO format annotations.
Request (application/json):
{
"detections": [ ... ],
"image_width": 1280,
"image_height": 720
}
Response (200 application/zip):
classes.txtโ alphabetically sorted class namesannotations.txtโ normalized CXCYWH format
Security Notes
โ ๏ธ Do NOT commit colab_launcher.ipynb with credentials filled in to a public repository.
- The notebook stores your GitHub PAT as a plain Python string
- If you push the notebook with credentials, immediately revoke the token at https://github.com/settings/tokens
- Best practice: Use GitHub's PAT scoping to limit what the token can do
Troubleshooting
"Module not found" errors during Colab setup
- Some GPU/CPU compatibility issues can arise. Re-run the installer cell. CUDA patches are applied idempotently.
ngrok connection fails
- Free tier allows one simultaneous tunnel. If you have an old tunnel active, run
ngrok.kill()first. - Ngrok token scope: ensure it's from a free account with no connections limit.
Colab proxy times out
- Colab's built-in proxy may close after 30 minutes of inactivity. Use an ngrok token for persistent access.
Slow detection on CPU
- GroundingDINO's SwinT variant is the fastest available checkpoint. Colab's GPU is usually allocated automatically; ensure you're not on a CPU-only runtime.
Missing annotations or low confidence
- Adjust thresholds downward (e.g., 0.25 โ 0.15) to be more permissive
- Refine text prompts: instead of "object," try specific descriptions like "red car" or "traffic sign"
Model Details
Model: GroundingDINO SwinT-OGC (Swin Transformer Tiny, Object Grounding with Captions)
- Checkpoint:
groundingdino_swint_ogc.pth - Size: ~400 MB
- Architecture: Vision Transformer + BERT-based text encoder + cross-modal reasoning
- License: Apache 2.0 (IDEA-Research/GroundingDINO)
License
This project is provided as-is. GroundingDINO is licensed under Apache 2.0. See https://github.com/IDEA-Research/GroundingDINO for details.
Contributing
To modify or extend DriverFlow:
- Clone this repo locally
- Edit files in
backend/ - Commit and push changes
- Re-run
colab_launcher.ipynbto test in Colab (it pulls the latest main branch)
Support
For issues or feedback:
- Check the Troubleshooting section above
- Report bugs at https://github.com/chirumer/DriverFlow/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file driverflow-0.1.0.tar.gz.
File metadata
- Download URL: driverflow-0.1.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55aa11dd29ba1d66f18e0f62607ebddaf6cd22452ed39cac85f4c3e9802e565f
|
|
| MD5 |
2743a53b37364049c6c46949791dbcad
|
|
| BLAKE2b-256 |
54eb1f6510b521e70c9610e82af1148529664791639139cef720bf876061613a
|
File details
Details for the file driverflow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: driverflow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed8ff9619ff41ec8d104116e0db4bf68ef48f6f39d3336f628133145e4192e8f
|
|
| MD5 |
de46ae461e47384d41b244d3f4b1249e
|
|
| BLAKE2b-256 |
2967c52c973eab4bcfa028bb4fb66e4a306a5db6038f2ad87a79092eb3c93e9f
|