py123d_detection.torch.build

Turning a Hydra config into the objects a training run needs.

Kept apart from the entry points so that training, evaluation and a notebook all build their data the same way, and so the mapping from config to object is one readable file rather than something spread through two scripts.

Functions

build_augmentation(cfg)

build_datasets(cfg, stage[, filters])

One dataset per entry under data.<stage>.

build_filters(cfg)

build_images(cfg)

The network input, shared by training and validation.

build_model(cfg, **overrides)

The detector named by cfg.model.

py123d_detection.torch.build.build_images(cfg)[source]

The network input, shared by training and validation.

Only the size and the resizing mode live here. Everything random is in augment, so the validation data is simply the same pipeline without an augmentation.

Return type:

ImagePipeline

py123d_detection.torch.build.build_filters(cfg)[source]
Return type:

BoxFilters

py123d_detection.torch.build.build_augmentation(cfg)[source]
Return type:

Optional[Augmentation]

py123d_detection.torch.build.build_datasets(cfg, stage, filters=None)[source]

One dataset per entry under data.<stage>.

Training entries get augmentation, validation entries never do. Everything else is shared: the taxonomy, the filters and the image size. That is what makes a mixed-dataset run a fair comparison rather than several differently prepared ones.

Parameters:

filters (Optional[BoxFilters]) – Use these instead of the config’s, which evaluation needs in order to score frames whose ground truth is empty without otherwise changing the box population.

Return type:

List[Py123DDetectionDataset]

py123d_detection.torch.build.build_model(cfg, **overrides)[source]

The detector named by cfg.model.

name is metadata that labels the run directory, so it is dropped before the rest of the node is handed to the constructor.