This repository contains code for a real-time object detection application that counts people using the YOLOv8 algorithm and the FastAPI framework. The output can be accessed through a web browser, making it easy to use and accessible from anywhere.
The app can be easily extended to other use cases beyond people counting by training the model on the desired object. The app is designed to be scalable, so it can handle large volumes of input data and run efficiently on different devices.
To run this app, you will need to have Python installed on your system, along with the following packages:
- FastAPI
- uvicorn
- opencv-python
- numpy
- ultralytics
Once you have installed these packages, you can run the app by executing the following command in the terminal:
python main.py
This will start the app and you can access the output by visiting http://localhost:8000 in your web browser.
To use the app, simply upload a video or live stream and the app will count the number of people in real-time. The app also provides an option to download the video with the bounding boxes drawn around the detected objects.
You can ulso use this app with rtsp url just pass rtsp url to videoCapture ()
This app can be easily extended to detect and count other objects by training the YOLOv8 model on the desired object. You can find more information on how to do this in the YOLOv8 repository.
- Adding mongoDB backend connection for storing counts or any values generated by code
- Hosting on GCP Function / AWS lambda
- Include screenshots and video demonstrations of the app in action
- Add more information on how to train the YOLOv8 model on other objects
- Provide links to additional resources on YOLOv8 and FastAPI
- make dashboard in reactJS which can be extend to any analytics
- updates comments in code
Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.