Machine vision project

Machine vision classified outout, Tauno Erik

My first goal was to test whether can I make machine vision projects that identify different sizes of these wooden bricks from Woodi. I had four different sizes of bricks.

First I made a bunch of images separately of each brick on a different angle. Then many of them together. I used my two webcams and cell phones. After some testing, I started to add some similar sizes wooden objects to images so the model will separate the bricks from other stuff.

It would be good to use real situation pictures were it would be used. Same kind of camera, lighting and background.

I used trainyolo.com to label all the images. I Collected 770 images and labelled 5188 objects together. And trained 8 models until I was finally satisfied with the results.

My trainYOLO project is here.

My Colab to train the model. Almost the same as the example from trainYOLO.

And my Python code on GitHub

I used Yolo version 8.

Data examples

Sample images from the dataset. Segmented.

Counting different objects on a simulated conveyor line

In this example, it detects all four sizes of brick, tracks them and counts them when they cross the green line.

Recognize only in a predefined region

Detects objects only in the predefined zone (drawn box).

Set Up a Python Virtual Environment

pip install virtualenv
python3 --version
python3.10 -m venv env
source env/bin/activate
pip list

~ deactivate

Save and instal requirements

pip freeze > requirements.txt
~ pip install -r requirements.txt

CUDA error out of memory

nvidia-smi
kill -KILL PID_number

Links

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.