dgs.models.dataset.keypoint_rcnn.KeypointRCNNImageBackbone¶
- class dgs.models.dataset.keypoint_rcnn.KeypointRCNNImageBackbone(*args: Any, **kwargs: Any)[source]¶
Predicts 17 key-points (like COCO).
Optional Params¶
- mask_path (str, optional):
The path to a PT21 json file containing the
ignore_regions
. Note that currently only PT21 ignore regions are supported.
References
Metaclass for the torchvision Key Point RCNN backbone model.
This class sets up the RCNN model and validates and sets the basic modules parameters.
Params¶
- data_path (FilePath):
A single path or a list of paths. The path is either a directory, a single image file, or a list of image filepaths.
Optional Params¶
- score_threshold (float, optional):
Detections with a score lower than the threshold will be ignored. Default
DEF_VAL.dataset.kprcnn.score_threshold
.- iou_threshold (float, optional):
Bounding-boxes with IoU above this threshold will be ignored. Default
DEF_VAL.dataset.kprcnn.iou_threshold
.- force_reshape (bool, optional):
Whether to force reshape all the input images. Change the size and mode via
image_mode
andimage_size
parameters, iffforce_reshape
is True. DefaultDEF_VAL.images.force_reshape
.- image_size (
ImgSize
, optional): The size, the loaded image should have, iff
force_reshape
is True. DefaultDEF_VAL.images.image_size
.- image_mode (str, optional):
The mode to use when loading the image, iff
force_reshape
is True. DefaultDEF_VAL.images.image_mode
.- crop_size (
ImgSize
, optional): The size, the image crop should have. Default
DEF_VAL.images.crop_size
.- crop_mode (str, optional):
The mode to use when cropping the image. Default
DEF_VAL.images.crop_mode
.- bbox_min_size (float, optional):
The minimum side length a bounding box should have in pixels. Smaller detections will be discarded. Works in addition to the
threshold
parameter. If you do not want to discard smaller bounding boxes, make sure to setbbox_min_size
to1.0
. The size of the bounding boxes is in relation to the original image. DefaultDEF_VAL.images.bbox_min_size
.- weights (KeypointRCNN_ResNet50_FPN_Weights, optional):
The weights to load for the model. Default
KeypointRCNN_ResNet50_FPN_Weights.COCO_V1
.
- __init__(config: dict[str, any], path: list[str]) None [source]¶
Methods
arbitrary_to_ds
(a, idx)Given a filepath, predict the bounding boxes and key-points of the respective image.
configure_torch_module
(module[, train])Set compute mode and send model to the device or multiple parallel devices if applicable.
get_image_crops
(ds)Add the image crops and local key-points to a given state.
get_path_in_dataset
(path)Given an arbitrary file- or directory-path, return its absolute path.
Terminate this module and all of its submodules.
Given one single image, with its corresponding bounding boxes and key-points, obtain a cropped image for every bounding box with localized key-points.
Given an image, bboxes, and key-points, resize them with custom modes.
validate_params
(validations[, attrib_name])Given per key validations, validate this module's parameters.
Attributes
Get the device of this module.
Get whether this module is set to training-mode.
Get the name of the module.
Get the name of the module.
Get the escaped name of the module usable in filepaths by replacing spaces and underscores.
Get the (floating point) precision used in multiple parts of this module.
Arbitrary data, which will be converted using
self.arbitrary_to_ds()
The base path to the dataset.