cv (yolov5)

program that can find patterns or make decisions from a previously unseen dataset.

Note: Drone Computer Vision Repo w/ Datasetsarrow-up-right

1 - Video/Roboflow: Gather images for dataset

Logo
Description

We can film a video of the item we want to detect and then upload to Roboflow. On the Roboflow website, we can extract frames every X seconds to create a .jpg file each interval. Then we can begin labeling each image on Roboflow.

Roboflow is a website where you upload images, label them, and export a zip file (images & .xml files).

Useful to share dataset and have 3 people label at the same time

1.1 - Unlabeled Images to Labeled Images

Unlabled
Labeled (Desired Outcome)


2 - Colab: Train Custom Model

Logo
Description

-The following website uses Python

-here we set up libraries

- collections of pre-written code that you

can use to perform specific tasks

-Prepare the dataset

-Train the model

-Evaluate the model performance with validation data

-Export the model as .tflite file

Open up Google Colab for Yolov5 Trainingarrow-up-right

Follow this video arrow-up-rightfor more details

3 - Export Model

Download the best.pt file to upload to Raspberry Pi.

Have a naming convention like '3-27-2024--300epochs-' Demo herearrow-up-right

4 - Set up Pi - Installation

Python Library Versions located herearrow-up-right

Ctrl + Alt + T

NOTE: (2:54)

-click top left

-preferences

-raspberry pi configuration

-tabs: interfaces

-enable camera

-reboot

uaYq12tCsfz3-hWdK8ivKExIY

5 - Run on Pi

Ctrl + Alt + T

(Note: if on virtual machine for testing): Devices > Webcams > Check Integrated cam box

Download your best.pt file after training, you can use Github or Google Drive

cd yolov5

cp ~/Downloads/best.pt .

gedit detect.py

  • (Note: make sure you use correct naming convention)

  • got to line 53 and type:

    • weights = 'best.pt',

  • go and comment line 54:

    • weights = 'yolov5s.pt',

sudo python3 detect.py

sudo python3 detect.py --weights 3-27-13-best.pt --source 0 or sudo python3 detect.py --weights best.pt --source 0

Last updated