Lavanya14hs/Video-analysis-platform
GitHub: Lavanya14hs/Video-analysis-platform
Stars: 1 | Forks: 1
# Video Analysis Platform
A video incident analysis system with object detection, fight detection, accident detection, and crowd detection.
## Project structure
- `api/` - FastAPI service exposing the video analysis endpoint
- `backend/` - analysis logic and model utilities
- `frontend/` - React UI for uploading and viewing results
- `models/` - trained model files used by the analyzer
- `logs/` - generated log files and snapshots
- `temp/` - temporary upload storage
## Getting started
### Python backend
1. Create a Python virtual environment.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
2. Install the required Python dependencies.
pip install fastapi uvicorn opencv-python ultralytics numpy
3. Run the API server.
uvicorn api.main:app --reload
### Frontend
1. Install frontend dependencies.
cd frontend
npm install
2. Start the React app.
npm start
## Deployment
### Recommended: Railway
1. Create account at [railway.app](https://railway.app)
2. Install Railway CLI: `npm install -g @railway/cli`
3. Login: `railway login`
4. Initialize: `railway init`
5. Deploy: `railway up`
The project includes `requirements.txt`, `Procfile`, `railway.json`, and a `Dockerfile` for deployment.
The `Dockerfile` installs necessary system libraries for OpenCV in headless mode and is the recommended deployment path.
### Other Options
See `DEPLOYMENT.md` for detailed instructions on Railway, Render, and Heroku deployment.
### Vercel Limitations
Vercel is not suitable for this project because:
- No Python runtime for ML models
- Limited storage and compute resources
- Cannot handle video processing workloads
## Notes
- Keep your model weights in the `models/` folder, especially `yolov8n.pt`, `fight_detection.pt`, and `accident_detection.pt`.
- Use `temp/` for uploads and clean it periodically.
- Avoid committing large model files or sensitive keys to Git.