MMDetection API¶
model_hub.mmdetection
¶
- class model_hub.mmdetection.MMDetTrial(context: determined.pytorch._pytorch_context.PyTorchTrialContext)¶
This trial serves as the trainer for MMDetection models. It replaces the mmcv runner used by MMDetection.
For nearly all use cases, you can just use this trial definition and control behavior by changing the MMDetection config. If you want to customize the trial further, you can use this trial as the starting point.
Simlar to using the MMDetection library directly, the main way users customize an experiment is by modifying the MMDetection config. We detail how to configure MMDetection through the Determined experiment configuration in the readme.
Helper Functions¶
- class model_hub.mmdetection.GCSBackend(*args: Any, **kwargs: Any)¶
To use a Google Storage bucket as the storage backend, set
data.file_client_args
field of the experiment config as follows:data: file_client_args: backend: gcs bucket_name: <FILL IN>
- get_local_path(filepath: str) Iterator[str] ¶
Download a file from
filepath
.get_local_path
is decorated bycontxtlib.contextmanager()
. It can be called withwith
statement, and when exists from thewith
statement, the temporary path will be released. :param filepath: Download a file fromfilepath
. :type filepath: str
- class model_hub.mmdetection.S3Backend(*args: Any, **kwargs: Any)¶
To use a S3 bucket as the storage backend, set
data.file_client_args
field of the experiment config as follows:data: file_client_args: backend: s3 bucket_name: <FILL IN>
- get_local_path(filepath: str) Iterator[str] ¶
Download a file from
filepath
.get_local_path
is decorated bycontxtlib.contextmanager()
. It can be called withwith
statement, and when exists from thewith
statement, the temporary path will be released. :param filepath: Download a file fromfilepath
. :type filepath: str
- model_hub.mmdetection.get_pretrained_ckpt_path(download_directory: str, config_file: str) Tuple[Any, Any] ¶
If the config_file has an associated pretrained checkpoint, return path to downloaded checkpoint and preloaded checkpoint
- Parameters
download_directory – path to download checkpoints to
config_file – mmdet config file path for which to find and load pretrained weights
- Returns
checkpoint path, loaded checkpoint