Utils#
NRTK perturber CLI Entrypoint#
nrtk-perturber#
Generate NRTK perturbed images and detections from a given set of source images and COCO-format annotations.
The perturbed images are stored in subfolders named after the chosen perturbation parameter keys and values.
To run the container, use the following command:
docker run -v /path/to/input:/input/:ro -v /path/to/output:/output/ nrtk-perturber [OPTIONS]
The /input/ directory mount will contain all files consumed by the entrypoint script and the /output/ directory will contain all files produced by the entrypoint script.
Command Line Options:
–dataset_dir: Root directory of dataset.
—output_dir: Directory to write the perturbed images to.
–config_file: Configuration file specifying the PerturbImageFactory configuration.
—verbose: Display progress messages. Default is false.
If no command line options are given, the entrypoint script will use the following environment variables as inputs:
INPUT_DATASET_PATH: Root directory of dataset. Default is /input/data/dataset/.
OUTPUT_DATASET_PATH: Directory to write out the perturbed images. Default is /output/data/result/.
CONFIG_FILE: Path to JSON configuration file. Default is /input/nrtk_config.json.
- Exits:
- 101:
COCO annotations file is not found
nrtk-perturber [OPTIONS]
Options
- -d, --dataset_dir <dataset_dir>#
- -o, --output_dir <output_dir>#
- -c, --config_file <config_file>#
- -v, --verbose#
print progress messages
Environment variables
- INPUT_DATASET_PATH
Provide a default for
--dataset_dir
- OUTPUT_DATASET_PATH
Provide a default for
--output_dir
- CONFIG_FILE
Provide a default for
--config_file
Augmented MAITE dataset(s) generator#
Generate augmented dataset(s) of type maite.protocols.object_detection.Dataset.
Generate augmented dataset(s) of type maite.protocols.object_detection.Dataset given an input dataset of the same type and a perturber factory implementation. Each perturber dcombination will result in a newly generated dataset.
- Args:
- maite_dataset:
A dataset object of type maite.protocols.object_detection.Dataset
- perturber_factory:
PerturbImageFactory implementation.
- Returns:
A list of tuples containing perturber configurations and augmented datasets
- nrtk.entrypoints.nrtk_perturber.__dir__()#
Default dir() implementation.
- nrtk.entrypoints.nrtk_perturber.__format__(format_spec, /)#
Default object formatter.
- nrtk.entrypoints.nrtk_perturber.__init_subclass__()#
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- nrtk.entrypoints.nrtk_perturber.__new__(*args, **kwargs)#
Create and return a new object. See help(type) for accurate signature.
- nrtk.entrypoints.nrtk_perturber.__reduce__()#
Helper for pickle.
- nrtk.entrypoints.nrtk_perturber.__reduce_ex__(protocol, /)#
Helper for pickle.
- nrtk.entrypoints.nrtk_perturber.__sizeof__()#
Size of object in memory, in bytes.
- nrtk.entrypoints.nrtk_perturber.__subclasshook__()#
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).