# Adaptation of a Centroid-Based Object Detector on Multiclass Tasks

**Author**: Jan Kelbl <br />
**University**: Brno University of Technology <br />
**Programme**: Applied Computer Science and Control <br />

## Introduction

This repository is an appendix to the master thesis "Adaptation of a Centroid-Based Object Detector for Multiclass Tasks." The goal of the thesis is to adapt a centroid-based detector for use in multiclass tasks. The full text can be found at [https://www.vut.cz/studenti/zav-prace/detail/148890](https://www.vut.cz/studenti/zav-prace/detail/148890). This repository demonstrates the functionality of the proposed method.

This repository contains the source code for the centroid detector implementation, including the localization map generator, the centroid counterpoint module, and the localization module. There is also an example of complete training of the localization map generator based on a U-Net model. An example of model evaluation is also included. For centroid counterpoint module hyperparameters optimization, a grid search algorithm is implemented. For model evaluation, several evaluation metrics are implemented. The repository also includes a labeling script that allows for image labeling suitable for training.

- See the "src/detector" directory for the centroid detector implementation.
- See the "src/tools" directory for the centroid counterpoint tuning algorithm, model evaluation algorithms, and the labeling script.
- See the "src/modeling" directory for the model training, and the model evaluation workflows.

Datasets and models should be stored in the respective folders. Example datasets and models used and trained during the implementation of the centroid detector for multiclass tasks are not included in this repository. Refer to the full text of the master thesis for more information.

## Technical Notes

Users can easily set up the development environment for this repository. The project environment is defined in the "pyproject.toml" file. Running `make venv` in a terminal will create a virtual environment for this project. The virtual environment includes all necessary dependencies to run the code.
