Created on Thu Feb 1 18:14:31 2024
@author: Henry Gunawan, Dimitris Mantas, Sam Parijs
In this project, there are 10 classes of garbage being trained with YOLOv8 model based on the 10 most found OSPAR categories. There are:
0 : caps_and_lids
1 : cigarette_butts
2 : drinking_cans
3 : food_packaging
4 : food_wrapping
5 : pet_bottles
6 : plastic_cups
7 : plastic_films
8 : styrofoam
9 : undef_hard_plastic
To reduce the quality of data annotating since OSPAR categories since there is no clear lines between each classes, we created a "Data Labelling Guidelines". This Guidelines can be accessed in ("Documentation/Data Labelling Guidelines.docx")
General Images and Videos taken during the project can be accessed in General Images Folder.
For all of the data, images, video, code, and documentation related to this project can be accessed in:
TU DELFT ACCESS
In this project, there are 3 yolov8 models trained:
-
yolov8l ("Fix Model/yolov8l/") mAP50-95: 0.724 mAP50: 0.918
-
yolov8m ("Fix Model/yolov8m/") mAP50-95: 0.728 mAP50: 0.922
-
yolov8s ("Fix Model/yolov8s/") mAP50-95: 0.732 mAP50: 0.926
Inside the folder of these models consist of the best weights, detail of training such as confusion matric, data batch, arguments, and results.
Code produced includes:
- main_code in Python ("Python Code/main_code.py") This code is the main code used during object detection and counting. Consist of 'path to directory', choice of using camera or video as input, define counting line, and stop the computer vision when pressing ESC. This code will produces 2 output:
- Processed video
- CSV consist of "Class", "Class Name", "Count", and "Confidence". Count is the object counted, while the confidence is the average confidence per class.
-
oject_counter in Python ("Python Code/object_counter.py") This code include all of the class and funtion needed on the main code. This include setting counting lines, drawing bounding box, counting objects, print result on frames, and export to csv.
-
YOLOv8 Training in Jupyter Notebook ("Python Code/yolov8_train.ipynb") This code mainly used to train yolov8 model.
-
Deploy Model Roboflow in Jupyter Notebook ("Python Code/deploy_model_roboflow.ipynb") This is the code we usually used to deploy the model to Roboflow.
At the time this file made, there are 787 dataset annotated in roboflow.
Roboflow for this project can be accessed in:
Roboflow
By using Roboflow, it is possible to automated the annotation. We have deployed a yolov8m model to Roboflow which trained with 1869 images and 164 images for annotation, the amount of images comes from augmentations. The automated annotation has a model with: mAP: 92.2% Precision: 88.4% Recall: 86.8%
This model can be accessed in:
Roboflow Automated Annotation
In Dataset Folder ("Dataset"), consists of:
-
Prelim_Dataset This is a dataset taken from open source. The result in training is not good, so this dataset is not used.
-
Drijfvuil detectie.v1i.yolov8 by Jip This dataset is made by Jip during his bachelor Thesis. It consists of 6 classes and already merged with the dataset used now in the Roboflow.
-
Raw Dataset This is the raw data taken by us which is not labelled yet.
-
Video These videos were taken by us during the project and can be used to test the model.
Below is the consideration for camera recommendation:
- High Resolution : Ensure quality and ability to capture small object i.e. Cigarette Butts
- Polarized Lens Filter : Reduce glare from artificial lights and reflective surface
- Wide Dynamic Rage : Able to handle various lighting scenarios
- Direct Connectivity to Laptop : either USB, HDMI, or WIFI which is crucial for real-time monitoring
- Power Source : AC adapter or USB to operate without battery concerns
- Mounting Capability : Camera fixed, need to be able to mounted
Based on this Criteria, we found some camera:
-
Canon SX740: This is a great choice for 4K videos at 30p. It's really light and has Optical Image Stabilization to keep your shots steady. Also, it's got Wi-Fi and Bluetooth, so connecting it to other devices is a breeze. Price around €409.99 in canon.nl
-
Sony HX99: This compact camera is awesome for 4K videos. It comes with an 18.2 MP sensor and can zoom up to 30x, or even 60x with a special feature. Around €479.00 in sony.nl
-
GoPro HERO8: Perfect for action shots, this camera can handle 4K videos at 60 fps. It's super compact, has several video modes (including time warp and timelapse), advanced stabilization, and voice control. Price at €361.99 in bol.com
-
Logitech Brio 4K Webcam: Though primarily a webcam, it records in 4K at 30 fps and has excellent HDR support. It features autofocus, noise-canceling dual mics, and is great for streaming or video calls. Price at €155 in coolblue.nl