Sitemap
TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Follow publication

A simple way of creating a custom object detection model

8 min readJan 31, 2020

--

Introduction

Detection of players moving around the basketball court, based on YouTube-8M dataset

YOLO

Dataset

Sample of images from Basketball dataset
project
└──dataset
├── class_names.txt
├── images
│ ├── image_1.png
│ ├── image_2.png
│ └── image_3.png
│ ...
└── labels
├── image_1.txt
├── image_2.txt
└── image_3.txt
...

Labeling

AI-supported labeling process using makesense.ai
4 0.360558 0.439186 0.068327 0.250741
7 0.697519 0.701205 0.078643 0.228243
3 0.198589 0.683692 0.076613 0.263441

Environment setup

project
├── dataset
└── yolov3
# Clone framework
git clone https://github.com/ultralytics/yolov3.git
# Enter framework catalogue [Linux/MacOS]
cd ./yolov3
# Setup Python environment
pip install -U -r requirements.txt

Configuration

Reference photo for labeling Chess dataset
./dataset/images/image_1.png
./dataset/images/image_2.png
./dataset/images/image_3.png
...
classes=12
train=./data/chess_train.txt
valid=./data/chess_test.txt
names=./data/chess.names

Training

python3 train.py
--data ./data/project.data
--cfg ./cfg/project.cfg
--weights ./weights/yolov3.pt
Visualization of the data augmentation carried out on the training set

Detection

python3 detect.py
--data ./data/project.data
--cfg ./cfg/project.cfg
--weights ./weights/best.py
--source ./data/sample
Chess detection using TinyYOLO

Conclusions

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Piotr Skalski
Piotr Skalski

Written by Piotr Skalski

ML Growth Engineer @ Roboflow / Founder @ makesense.ai

Responses (6)