This repository is the finished product of my final project in college that combines object detection using YOLOv8, an object detection algorithm, and Streamlit, a popular Python framework for creating interactive web applications. This project has four different detection modes, including realtime mode, detection mode from YouTube URLs, as well as detection mode from videos and static images.
Thanks to Streamlit team for providing cloud uploads so that I can make this webApp more accessible to the general public.
This app is up and running on Streamlit cloud server!!! You can check the demo of this web application on this link Object Detection With YOLOv8 Algorithm
Python 3+
YOLOv8
Streamlit
pip install ultralytics streamlit pytube
-
Clone the repository: git clone https://github.com/CodingMantras/yolov8-streamlit-detection-tracking.git
-
Change to the repository directory:
cd yolov8-streamlit-detection-tracking
-
Create
weights
,videos
, andimages
directories inside the project. -
Download the pre-trained YOLOv8 weights from (https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt) and save them to the
weights
directory in the same project. -
Or if you have a model created with yolov8, you can save to the
weights
directory in the same project.
-
Run the app with the following command:
streamlit run app.py
-
The app will be opened in a new browser window.
-
The default image with its objects-detected image is displayed on the main page.
-
Select a source. (radio option selection
Image
). -
Upload an image by clicking on the "Browse files" button.
-
Click the
Deteksi
button to run the object detection algorithm on the uploaded image with the selected confidence threshold. -
The output with objects detected will be displayed on the page.
-
I have two options for video detection, namely using the videos that I have prepared in this project, or uploading them myself
-
If you choose to upload the video yourself, then please select the
upload tab
-
After The preview video has been displayed, you can click the
Deteksi
button then the detection results will be displayed -
If you choose to use a video that I have prepared, you can select the
sumber asal tab
-
Then you have to choose 1 of the 4 videos that have been prepared
-
Click on
Deteksi
button and detection will start on the selected video.
-
Select the source as YouTube
-
Copy paste the url inside the text box.
-
The detection task will start on the YouTube video url
This app uses YOLOv8 for object detection algorithm and Streamlit library for the user interface.
Please contribute to the optimisation of this website and to gain in-depth knowledge. Hit star ⭐ if you like this repo!!!