A full-stack web application for detecting and analyzing sparrows in images using a trained YOLO11x deep learning model.
- Image Upload with drag-and-drop interface
- Real-time Detection with bounding box visualization
- Statistics Dashboard with KPI cards and timeline charts
- Detection History with filtering and deletion
- Responsive Design using Tailwind CSS
- REST API with FastAPI
- Docker Compose deployment
sparrow-detector/
├── backend/ # FastAPI + YOLO
│ ├── app/
│ │ ├── main.py # FastAPI app
│ │ ├── routers/ # API endpoints
│ │ ├── models/ # Database
│ │ ├── services/ # YOLO inference
│ │ └── config.py # Configuration
│ ├── weights/ # Model weights (best.pt)
│ ├── Dockerfile
│ └── requirements.txt
├── frontend/ # React + Vite
│ ├── src/
│ │ ├── pages/ # Dashboard, Detect, History
│ │ ├── components/ # Reusable components
│ │ └── lib/ # API client
│ ├── Dockerfile
│ └── package.json
└── docker-compose.yml
docker compose build
docker compose up
Visit http://localhost in your browser.
Backend:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn app.main:app --reload
Frontend:
cd frontend
npm install
npm run dev
Visit http://localhost:5173 for the frontend and http://localhost:8000/docs for the API docs.
POST /api/detect— Upload image and run detectionGET /api/detections— List all detections (paginated)GET /api/detections/{id}— Get detection detailsDELETE /api/detections/{id}— Delete detection
GET /api/stats— Get aggregate statisticsGET /api/stats/timeseries— Get timeline data
GET /uploads/{filename}— Original imagesGET /results/{filename}— Annotated images
Create a .env file based on .env.example:
cp .env.example .env
- Architecture: YOLOv11x (extra-large)
- Input Size: 640×640
- Classes: Sparrow
- Framework: Ultralytics
- Average inference time: ~245ms per image
- GPU recommended for faster detection
# Run detection on a test image
curl -F "file=@test.jpg" http://localhost:8000/api/detect
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview build
The app is Docker-ready. For production:
- Build images:
docker compose build - Run:
docker compose up -d - Access frontend at
http://localhost - API available at
http://localhost/api
MIT