The goal of this project is to replace the manual sorting of photos from the motorcycle race by individual pilots with an automatic one in order to speed up and facilitate this stage of the photographers' work.
-
Create new venv and install required packages:
pip install -r requirements.txt -
Basic run with default hparams:
python3 main.py --input_folder {Path to input folder with photos}As a result,
resultsdirectory will be created with subdirectories with photos sorted by individual pilots. -
You can also find examples of running individual stages of the algorithm in saved notebooks (
notebooksfolder)
The proposed solution consists of the following steps:
-
get masks from the segmentation model (
yolov8n-seg) with post-processing in order to correctly combine the masks of pilots and motorcycles (matching algorithm) -
build vector representations of motorcycle pilots based on the pixel values of masks (2 different approaches have been implemented through the construction of color histograms)
-
separation by individual pilots using clustering on constructed vector representations (the K-Means method is used)
