This repository contains a high-accuracy computer vision model for real-time detection and classification of 43 types of military aircraft using YOLOv10 (from Ultralytics). The model achieves approximately 88% mean Average Precision (mAP) on a custom dataset of over 20,000 labeled images, covering fighters, bombers, helicopters, UAVs, and more.
This project implements an aircraft detection system using a custom-trained YOLOv10m model. Upload videos through an intuitive Gradio interface and receive annotated videos with detected aircraft highlighted in real-time.
Live Demo: https://tamarillo-oregano-aexisuv87wlchtmj.salad.cloud/gradio
- YOLOv10m Model: 15.3M parameters, 136 layers, optimized for accuracy and speed
- **Real-World Focus: Optimized for challenging aerial environments with weather variations, occlusions, and diverse angles.
- Web Interface: User-friendly Gradio UI for video upload and processing
- REST API: FastAPI backend with health monitoring endpoints
- Cloud Deployment: Containerized and deployed on SaladCloud
- Production Ready: Comprehensive health probes and logging
βββββββββββββββββββ
β Gradio UI β β User uploads video
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β FastAPI Server β β Handles requests
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β YOLOv10m Model β β Inference engine
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β Annotated Video β β Output with detections
βββββββββββββββββββ
- Python 3.10+
- CUDA 11.8+ (for GPU acceleration)
- Docker (for containerization)
- 4GB+ RAM
- GPU with 8GB+ VRAM (optional but recommended)
Dataset: Custom-curated collection of 20k+ images sourced from public military aviation datasets. Metrics: mAP@0.5: ~88% Inference Speed: ~30 FPS on RTX 3060 (cloud); targeted <10ms on Jetson Orin.
Classes (partial list):
Fighters: F-16, F-22, Su-27, MiG-29 Bombers: B-52, B-1B, Tu-95 Helicopters: AH-64 Apache, CH-47 Chinook UAVs: MQ-9 Reaper, RQ-4 Global Hawk (Full list in classes.yaml)
- Clone the repository
git clone https://github.com/lanarkite99/Aircraft-Detection.git
cd Aircraft-Detection- Install dependencies
pip install -r requirements.txt- Download the model (if not included)
best_90-100_colab.pt- Run the application
# Option 1: Run with Gradio interface only
python app.py
# Option 2: Run with FastAPI + Gradio
uvicorn main:app --host 0.0.0.0 --port 7860- Access the interface
- Gradio UI: http://localhost:7860/gradio
- API Docs: http://localhost:7860/docs
- Health Check: http://localhost:7860/health
- Build the Docker image
docker build -t aircraft-detection .- Run the container
docker run -p 7860:7860 aircraft-detection- With GPU support
docker run --gpus all -p 7860:7860 aircraft-detection- Push image to registry
docker tag aircraft-detection ghcr.io/lanarkite99/yolo-gradio:latest
docker push ghcr.io/lanarkite99/yolo-gradio:latest- Configure SaladCloud deployment
- Image:
ghcr.io/lanarkite99/yolo-gradio:latest - Port: 7860
- GPU: RTX 3090 or RTX A5000
- Resources: 8 vCPU, 16GB RAM
- Set up health probes
Startup Probe:
Path: /started
Initial Delay: 120s
Period: 15s
Timeout: 30s
Readiness Probe:
Path: /ready
Initial Delay: 180s
Period: 15s
Liveness Probe:
Path: /live
Initial Delay: 180s
Period: 30sAircraft-Detection/
βββ app.py # Gradio interface and YOLO inference
βββ main.py # FastAPI server with health probes
βββ Dockerfile # Container configuration
βββ requirements.txt # Python dependencies
βββ best_90-100_colab.pt # Trained YOLOv10m model weights
βββ README.md # This file
# Inference settings (app.py)
conf=0.35 # Confidence threshold
imgsz=640 # Input image size (480 for CPU)
vid_stride=1 # Frame sampling rate (2 for CPU)
max_det=300 # Maximum detections per image
half=True # FP16 inference (GPU only)# FastAPI configuration (main.py)
host="0.0.0.0" # Listen on all interfaces
port=7860 # Default port
workers=1 # Uvicorn workers- Architecture: YOLOv10m
- Parameters: 15,340,381
- Layers: 136
- GFLOPs: 59.0
- Training: Custom dataset (airplane detection)
- Framework: Ultralytics YOLO
-Training: GPU (e.g., RTX 30-series, 16GB VRAM). -Inference: CPU/GPU; Edge: NVIDIA Jetson Orin Nano (8GB).
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | API information |
/gradio |
GET | Gradio web interface |
/started |
GET | Startup probe |
/ready |
GET | Readiness probe |
/live |
GET | Liveness probe |
/health |
GET | Health check |
- NumPy Compatibility Error
# Solution: Pin NumPy version
pip install "numpy<2.0.0,>=1.23.0"- Model Not Found
# Ensure model file exists
ls -lh best_90-100_colab.pt- CUDA Out of Memory
# Reduce batch size or image size
imgsz=480 # Instead of 640- Probe Failures on SaladCloud
- Increase startup probe initial delay to 120s+
- Verify image URL includes full path:
ghcr.io/username/repo:tag - Check container logs for startup errors
torch==2.2.0- Deep learning frameworkultralytics>=8.0.0- YOLO implementationnumpy<2.0.0- Array operations
fastapi- REST API serveruvicorn[standard]- ASGI servergradio- Web UI framework
opencv-python-headless- Video processingpillow- Image operationsimageio-ffmpeg- Video encoding
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Ultralytics for YOLOv10 implementation
- Gradio for the web interface framework
- SaladCloud for cloud GPU infrastructure
- PyTorch team for the deep learning framework
Project Link: https://github.com/lanarkite99/Aircraft-Detection
Note: This project uses a custom-trained model. The model weights (best_90-100_colab.pt) are specific to aircraft detection and were trained on a specialized dataset.
