tangobot / README.md
github-actions[bot]
Deploy from 5ef6b82d024d5ea605ca6a96dfc8d089756c65b4
2e6f8a4
|
raw
history blame
2.14 kB
---
title: TangoBot
emoji: 📸
colorFrom: red
colorTo: yellow
sdk: gradio
python_version: "3.12"
app_file: app.py
pinned: false
---
# TangoBot
Gradio web UI for face detection and age estimation, designed for HuggingFace Spaces deployment. This demo showcases TangoBot's photo analysis capabilities for [Tango Charities](https://www.tangocharities.org/).
## About Tango Charities
Tango Charities is a volunteer-led nonprofit fighting hunger through Feed The City events. Since 2015, they've mobilized 110,000+ volunteers to provide 8+ million meals across 73 cities. TangoBot helps the team count attendees in event photos and identify youth participation.
## Features
- Interactive web interface for image upload
- Real-time face detection and age estimation
- Webcam and clipboard support
- Embeds inference directly (no external HTTP calls)
## Running Locally
```bash
cd apps/huggingface-space
uv run gradio app.py
```
Opens at http://localhost:7860
## Usage
1. Upload an image (or use webcam/clipboard)
2. View the annotated image with face bounding boxes
3. See detection results:
- Number of faces detected
- Count of people estimated under 18
## Color Coding
Bounding boxes are color-coded:
- **Green**: Under 18 (minors)
- **Blue**: 18 and older (adults)
## Deploying to HuggingFace Spaces
1. Create a new Space on HuggingFace (Gradio SDK)
2. Copy the package source and app files:
```
packages/face-age-inference/src/face_age_inference/ -> face_age_inference/
apps/huggingface-space/app.py -> app.py
apps/huggingface-space/requirements.txt -> requirements.txt
```
3. Push to the Space repository
Models are automatically downloaded from HuggingFace Hub on first run (~450MB).
## Requirements
See `requirements.txt` for dependencies. Key packages:
- `gradio>=5.0.0` - Web UI framework
- `torch>=2.9.1` - PyTorch
- `transformers>=4.51.0` - HuggingFace Transformers
- `ultralytics>=8.3.230` - YOLO implementation
## Configuration
The app uses default settings from `face-age-inference`. To customize, modify environment variables:
```bash
FACE_AGE_DEVICE=cuda:0 uv run gradio app.py
```