Metadata-Version: 2.1
Name: single-object-detection
Version: 0.1.1
Summary: Detecting single objects in images based on bounding boxes.
License: MIT
Author: Thomas Jonas
Requires-Python: ==3.10.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Dist: mlflow (>=2.13.1,<3.0.0)
Requires-Dist: torch (>=2.3.0,<3.0.0)
Requires-Dist: torchinfo (>=1.8.0,<2.0.0)
Requires-Dist: torchvision (>=0.18.0,<0.19.0)
Description-Content-Type: text/markdown

# Experimentation Example

## Workflow

1. Import required data via versioned repository.
`dvc import https://git.inf.h-brs.de/mi-project/demo-pipeline/data-annotation-example data/field_A/2023/ -o data/field_A/2023`
2. Other added data should be manually versioned using `dvc add datapath`
3. Reproduce current model training and evaluation using `dvc repro`.
4. Alter `dvc.yaml` for new data input paths, or `params.yaml` for different training configuration.

## Tools

### DVC

Data Versioning and Reproducible pipelines.

### MLFlow

Experiment tracking and model registry.

### Pre Commit Hooks

Clear formated and linted code.

### Containerization - Docker

Platform independence.

TODO: Create an executable container, which is callable like a script. (Similar to max postprocessing pipeline.)
A continuously running service is currently not required.

## Insights

- VirtualEnv
Always install virtualenv with `python -m venv`.
Else weird behavior can happen. e.g. `virtualenv venv`

- MLFLow pyfunc
Loaded model expects input in numpy format, instead of torch tensors.

- DVC and MLFlow integration
MLflow generates random run_ids, which need to be tracked if reproducible pipelines should be set up with dvc.
Direct integration was not possible, therefore a workaround with a temporary file had to be implemented.

The output of the training stage is currently not tracked.

- Poetry python version management
Poetry natively tries to use the same python versioned used for its installation.
Python version management with pyenv requires the experimental parameter `virtualenvs.prefer-active-python` to be set to true.
