Using Python-API is the most flexible approach: you are not limited by our project & config structures and you can use only the needed part of OML's functionality. You will find code snippets below to train, validate and inference the model on a tiny dataset of figures. Here are more details regarding dataset format.
Schemas, explanations and tips illustrating the code below.
../../../docs/readme/examples_source/extractor/train.md
../../../docs/readme/examples_source/extractor/val.md
../../../docs/readme/examples_source/extractor/retrieval_usage.md
../../../docs/readme/examples_source/extractor/train_val_pl.md
../../../docs/readme/examples_source/extractor/train_val_pl_ddp.md
../../../docs/readme/examples_source/extractor/train_2loaders_val.md
You can easily access a lot of content from PyTorch Metric Learning. The examples below are different from the basic ones only in a few lines of code:
../../../docs/readme/examples_source/extractor/train_with_pml.md
../../../docs/readme/examples_source/extractor/train_with_pml_advanced.md
To use content from PyTorch Metric Learning with our Pipelines just follow the standard tutorial of adding custom loss.
Note, during the validation process OpenMetricLearning computes L2 distances. Thus, when choosing a distance from PML, we recommend you to pick distances.LpDistance(p=2).
../../../docs/readme/examples_source/extractor/val_with_sequence.md
ㅤ ㅤ