Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.4.0
π Hugging Face Deployment Checklist
β All Files Ready for Deployment
π Core Application Files:
- β
app.py- Main Gradio application (YOLO-based detection) - β
requirements.txt- All dependencies for Gradio - β
README.md- Documentation - β
DEPLOYMENT_GUIDE.md- Deployment instructions
π€ AI Models (All Present):
- β
models/yolo11s.pt- Vehicle detection (11MB) - β
models/detect1.pt- License plate detection (6MB) - β
models/read_char.pt- Character reading (6MB) - β
models/best_province.pt- Province detection (6MB) - β
models/best_segment.pt- Segmentation (backup) (6MB)
βοΈ Configuration Files:
- β
config/data.yaml- Character mappings (47 Thai chars + digits) - β
config/data_province.yaml- Province mappings (77 Thai provinces)
π Model Verification:
- β Character Recognition: Maps "ΰΈΰΈ 1687" correctly
- β Province Recognition: Maps class "58" β "ΰΈͺΰΈΰΈΰΈ₯ΰΈ²"
- β Detection Pipeline: Matches original API exactly
- β Confidence Thresholds: All set to 0.3
ποΈ Deployment Instructions:
Step 1: Create Hugging Face Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Choose:
- SDK: Gradio
- Python Version: 3.11
- Hardware: CPU Basic (free tier)
Step 2: Upload Files
Upload ALL files from this deploy_huggingface/ folder:
deploy_huggingface/
βββ app.py # Main app
βββ requirements.txt # Dependencies
βββ README.md # Documentation
βββ models/ # All 5 model files
βββ config/ # 2 YAML config files
βββ *.md files # Documentation
Step 3: Automatic Deployment
- Hugging Face will automatically:
- Install dependencies from
requirements.txt - Run
app.pywith Gradio - Provide public URL for testing
- Install dependencies from
Step 4: Verify Deployment
Test with the license plate image:
- β Should detect vehicles in protection zone
- β Should find license plates in vehicles
- β Should read "ΰΈΰΈ1687" (not "2ΰΈΰΉΰΈ«ΰΈ₯ΰΈ")
- β Should show province "ΰΈͺΰΈΰΈΰΈ₯ΰΈ²" (not "Unknown")
π File Sizes (Total: ~45MB)
app.py - 15KB
requirements.txt - 1KB
config/ - 5KB
models/yolo11s.pt - 11MB
models/detect1.pt - 6MB
models/read_char.pt - 6MB
models/best_province.pt - 6MB
models/best_segment.pt - 6MB
Documentation - 50KB
π― Expected Performance:
- Vehicle Detection: β Working
- License Plate Detection: β Working
- Character Reading: β Fixed (correct Thai characters)
- Province Recognition: β Fixed (77 provinces mapped)
- UI: β Interactive Gradio interface
- Speed: ~2-5 seconds per image (CPU)
π¨ Pre-Deployment Test:
Run locally first:
cd deploy_huggingface
python app.py
- Should start on http://localhost:7860
- Test with vehicle images
- Verify license plate reading accuracy
β Ready for Production!
All files are present and tested. The app now matches the working API's detection accuracy exactly.
License plate "ΰΈΰΈ 1687 ΰΈͺΰΈΰΈΰΈ₯ΰΈ²" will be correctly detected! πβ¨