Delete DEPLOYMENT.md
Browse files- DEPLOYMENT.md +0 -269
DEPLOYMENT.md
DELETED
|
@@ -1,269 +0,0 @@
|
|
| 1 |
-
# Hugging Face Deployment Guide
|
| 2 |
-
|
| 3 |
-
## π Pre-Deployment Checklist
|
| 4 |
-
|
| 5 |
-
Before uploading to Hugging Face Spaces, ensure:
|
| 6 |
-
|
| 7 |
-
- [x] All code files are plagiarism-free with original implementations
|
| 8 |
-
- [x] Student attribution is present in all files
|
| 9 |
-
- [x] README.md has HF metadata header
|
| 10 |
-
- [x] requirements.txt includes all dependencies
|
| 11 |
-
- [x] .gitattributes is configured for Git LFS
|
| 12 |
-
- [x] LICENSE file is present
|
| 13 |
-
- [x] Error handling is comprehensive
|
| 14 |
-
- [ ] Sample video is available (optional)
|
| 15 |
-
|
| 16 |
-
## π Deployment Steps
|
| 17 |
-
|
| 18 |
-
### 1. Create a New Space on Hugging Face
|
| 19 |
-
|
| 20 |
-
1. Go to [Hugging Face Spaces](https://huggingface.co/new-space)
|
| 21 |
-
2. Click "Create new Space"
|
| 22 |
-
3. Fill in the details:
|
| 23 |
-
- **Space name**: `vehicle-speed-estimation` (or your choice)
|
| 24 |
-
- **License**: MIT
|
| 25 |
-
- **SDK**: Gradio
|
| 26 |
-
- **Visibility**: Public or Private
|
| 27 |
-
|
| 28 |
-
### 2. Upload Files
|
| 29 |
-
|
| 30 |
-
You can upload files via:
|
| 31 |
-
|
| 32 |
-
#### Option A: Web Interface
|
| 33 |
-
|
| 34 |
-
1. Navigate to your Space
|
| 35 |
-
2. Click "Files and versions"
|
| 36 |
-
3. Upload all files from the project directory:
|
| 37 |
-
```
|
| 38 |
-
app.py
|
| 39 |
-
main.py
|
| 40 |
-
config.py
|
| 41 |
-
requirements.txt
|
| 42 |
-
README.md
|
| 43 |
-
LICENSE
|
| 44 |
-
CITATION.cff
|
| 45 |
-
CONTRIBUTING.md
|
| 46 |
-
.gitattributes
|
| 47 |
-
src/
|
| 48 |
-
βββ __init__.py
|
| 49 |
-
βββ annotator.py
|
| 50 |
-
βββ speed_estimator.py
|
| 51 |
-
βββ view_transformer.py
|
| 52 |
-
βββ exceptions.py
|
| 53 |
-
```
|
| 54 |
-
|
| 55 |
-
#### Option B: Git Command Line
|
| 56 |
-
|
| 57 |
-
```bash
|
| 58 |
-
# Clone your Space repository
|
| 59 |
-
git clone https://huggingface.co/spaces/YOUR_USERNAME/vehicle-speed-estimation
|
| 60 |
-
cd vehicle-speed-estimation
|
| 61 |
-
|
| 62 |
-
# Copy all files from the project
|
| 63 |
-
cp -r /path/to/Vehicle-Speed-Estimation-and-Counting-YOLO-Supervision/* .
|
| 64 |
-
|
| 65 |
-
# Add and commit
|
| 66 |
-
git add .
|
| 67 |
-
git commit -m "Initial commit: Vehicle Speed Estimation System"
|
| 68 |
-
|
| 69 |
-
# Push to Hugging Face
|
| 70 |
-
git push
|
| 71 |
-
```
|
| 72 |
-
|
| 73 |
-
### 3. Configure Git LFS for Large Files
|
| 74 |
-
|
| 75 |
-
If you have model files or sample videos:
|
| 76 |
-
|
| 77 |
-
```bash
|
| 78 |
-
# Install Git LFS
|
| 79 |
-
git lfs install
|
| 80 |
-
|
| 81 |
-
# Track large files
|
| 82 |
-
git lfs track "*.pt"
|
| 83 |
-
git lfs track "*.mp4"
|
| 84 |
-
|
| 85 |
-
# Add .gitattributes
|
| 86 |
-
git add .gitattributes
|
| 87 |
-
git commit -m "Configure Git LFS"
|
| 88 |
-
git push
|
| 89 |
-
```
|
| 90 |
-
|
| 91 |
-
### 4. Wait for Build
|
| 92 |
-
|
| 93 |
-
- Hugging Face will automatically build your Space
|
| 94 |
-
- Check the "Logs" tab for build progress
|
| 95 |
-
- Build typically takes 2-5 minutes
|
| 96 |
-
|
| 97 |
-
### 5. Test Your Space
|
| 98 |
-
|
| 99 |
-
Once built:
|
| 100 |
-
1. Upload a test video
|
| 101 |
-
2. Verify processing works
|
| 102 |
-
3. Check output video quality
|
| 103 |
-
4. Test error handling with invalid inputs
|
| 104 |
-
|
| 105 |
-
## βοΈ Configuration Notes
|
| 106 |
-
|
| 107 |
-
### Model Files
|
| 108 |
-
|
| 109 |
-
The YOLO model will be downloaded automatically on first run. If you want to include a pre-downloaded model:
|
| 110 |
-
|
| 111 |
-
1. Download the model (e.g., `yolov8n.pt`)
|
| 112 |
-
2. Create a `models/` directory
|
| 113 |
-
3. Upload via Git LFS:
|
| 114 |
-
```bash
|
| 115 |
-
git lfs track "models/*.pt"
|
| 116 |
-
git add models/yolov8n.pt
|
| 117 |
-
git commit -m "Add YOLO model"
|
| 118 |
-
git push
|
| 119 |
-
```
|
| 120 |
-
|
| 121 |
-
### Sample Videos
|
| 122 |
-
|
| 123 |
-
To include example videos:
|
| 124 |
-
|
| 125 |
-
1. Create a `data/` directory
|
| 126 |
-
2. Add sample videos (keep under 100MB each)
|
| 127 |
-
3. Upload via Git LFS:
|
| 128 |
-
```bash
|
| 129 |
-
git lfs track "data/*.mp4"
|
| 130 |
-
git add data/vehicles.mp4
|
| 131 |
-
git commit -m "Add sample video"
|
| 132 |
-
git push
|
| 133 |
-
```
|
| 134 |
-
|
| 135 |
-
### Environment Variables
|
| 136 |
-
|
| 137 |
-
If you need to set environment variables:
|
| 138 |
-
|
| 139 |
-
1. Go to Space Settings
|
| 140 |
-
2. Click "Variables and secrets"
|
| 141 |
-
3. Add any required variables
|
| 142 |
-
|
| 143 |
-
## π Troubleshooting
|
| 144 |
-
|
| 145 |
-
### Build Fails
|
| 146 |
-
|
| 147 |
-
**Issue**: Dependencies fail to install
|
| 148 |
-
|
| 149 |
-
**Solution**:
|
| 150 |
-
- Check `requirements.txt` for version conflicts
|
| 151 |
-
- Ensure all packages are available on PyPI
|
| 152 |
-
- Try pinning specific versions
|
| 153 |
-
|
| 154 |
-
### Out of Memory
|
| 155 |
-
|
| 156 |
-
**Issue**: Space runs out of memory during processing
|
| 157 |
-
|
| 158 |
-
**Solution**:
|
| 159 |
-
- Upgrade to a better hardware tier (Settings β Hardware)
|
| 160 |
-
- Reduce video resolution in preprocessing
|
| 161 |
-
- Use smaller YOLO model (yolov8n instead of yolov8l)
|
| 162 |
-
|
| 163 |
-
### Slow Processing
|
| 164 |
-
|
| 165 |
-
**Issue**: Video processing is very slow
|
| 166 |
-
|
| 167 |
-
**Solution**:
|
| 168 |
-
- Upgrade to GPU hardware (Settings β Hardware)
|
| 169 |
-
- Use smaller model for faster inference
|
| 170 |
-
- Reduce input video resolution
|
| 171 |
-
|
| 172 |
-
### Model Download Fails
|
| 173 |
-
|
| 174 |
-
**Issue**: YOLO model fails to download
|
| 175 |
-
|
| 176 |
-
**Solution**:
|
| 177 |
-
- Pre-download model and include in repository
|
| 178 |
-
- Check internet connectivity in Space
|
| 179 |
-
- Use alternative model source
|
| 180 |
-
|
| 181 |
-
## π Hardware Recommendations
|
| 182 |
-
|
| 183 |
-
| Video Resolution | Model Size | Recommended Hardware |
|
| 184 |
-
|-----------------|------------|---------------------|
|
| 185 |
-
| 720p | YOLOv8n | CPU Basic (Free) |
|
| 186 |
-
| 1080p | YOLOv8n/s | CPU Upgrade |
|
| 187 |
-
| 1080p | YOLOv8m/l | T4 Small (GPU) |
|
| 188 |
-
| 4K | YOLOv8l | A10G Small (GPU) |
|
| 189 |
-
|
| 190 |
-
## π Security Notes
|
| 191 |
-
|
| 192 |
-
- Never commit API keys or secrets to the repository
|
| 193 |
-
- Use Hugging Face Secrets for sensitive data
|
| 194 |
-
- Validate all user inputs
|
| 195 |
-
- Limit file upload sizes
|
| 196 |
-
|
| 197 |
-
## π Monitoring
|
| 198 |
-
|
| 199 |
-
After deployment:
|
| 200 |
-
|
| 201 |
-
1. Monitor Space usage in Settings
|
| 202 |
-
2. Check error logs regularly
|
| 203 |
-
3. Review user feedback
|
| 204 |
-
4. Update dependencies periodically
|
| 205 |
-
|
| 206 |
-
## π Updating Your Space
|
| 207 |
-
|
| 208 |
-
To update after deployment:
|
| 209 |
-
|
| 210 |
-
```bash
|
| 211 |
-
# Make changes locally
|
| 212 |
-
# Test thoroughly
|
| 213 |
-
|
| 214 |
-
# Commit and push
|
| 215 |
-
git add .
|
| 216 |
-
git commit -m "Description of changes"
|
| 217 |
-
git push
|
| 218 |
-
|
| 219 |
-
# Space will automatically rebuild
|
| 220 |
-
```
|
| 221 |
-
|
| 222 |
-
## π Post-Deployment
|
| 223 |
-
|
| 224 |
-
1. Test all functionality
|
| 225 |
-
2. Share Space link with team
|
| 226 |
-
3. Add Space to your profile
|
| 227 |
-
4. Consider writing a blog post about the project
|
| 228 |
-
5. Share on social media
|
| 229 |
-
|
| 230 |
-
## π Academic Use
|
| 231 |
-
|
| 232 |
-
For academic submissions:
|
| 233 |
-
|
| 234 |
-
1. Ensure all student names are visible in README
|
| 235 |
-
2. Include enrollment numbers
|
| 236 |
-
3. Add CITATION.cff for proper attribution
|
| 237 |
-
4. Document all external libraries used
|
| 238 |
-
5. Include technical documentation
|
| 239 |
-
|
| 240 |
-
## β
Final Verification
|
| 241 |
-
|
| 242 |
-
Before marking as complete:
|
| 243 |
-
|
| 244 |
-
- [ ] Space builds successfully
|
| 245 |
-
- [ ] Video upload works
|
| 246 |
-
- [ ] Processing completes without errors
|
| 247 |
-
- [ ] Output video is downloadable
|
| 248 |
-
- [ ] Statistics are displayed correctly
|
| 249 |
-
- [ ] Error messages are user-friendly
|
| 250 |
-
- [ ] All student names are visible
|
| 251 |
-
- [ ] README renders correctly
|
| 252 |
-
- [ ] License is visible
|
| 253 |
-
|
| 254 |
-
## π Success!
|
| 255 |
-
|
| 256 |
-
Your Vehicle Speed Estimation System is now live on Hugging Face Spaces!
|
| 257 |
-
|
| 258 |
-
Share your Space URL:
|
| 259 |
-
```
|
| 260 |
-
https://huggingface.co/spaces/YOUR_USERNAME/vehicle-speed-estimation
|
| 261 |
-
```
|
| 262 |
-
|
| 263 |
-
---
|
| 264 |
-
|
| 265 |
-
**Developed by:**
|
| 266 |
-
- Abhay Gupta (0205CC221005)
|
| 267 |
-
- Aditi Lakhera (0205CC221011)
|
| 268 |
-
- Balraj Patel (0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