JATICDetector
- class xaitk_jatic.interop.object_detection.model.JATICDetector(detector: Model, ids: Sequence[int], img_batch_size: int = 1)
Adapter for JATIC object detection protocol that transforms its outputs into the SMQTK DetectImageObjects interface format.
- Attributes:
_detector (od.Model): The JATIC protocol-based detector instance. _ids (Dict[int, Hashable]): Mapping from label IDs to human-readable names. _img_batch_size (int): The number of images to process in a single batch.
- Methods:
detect_objects: Detect objects in a batch of images and return results in SMQTK format. get_config: Raises NotImplementedError (configuration serialization is not implemented).
Methods
Generate paired bounding boxes and classification maps for detected objects in the given set of images.
from_configInstantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
Return a JSON-compliant dictionary that could be passed to this class's
from_configmethod to produce an instance with identical configuration.get_default_configGenerate and return a default configuration dictionary for this class.
get_implsDiscover and return a set of classes that implement the calling class.
is_usableCheck whether this class is available for use.
- __init__(detector: Model, ids: Sequence[int], img_batch_size: int = 1) None
Initialize the JATICDetector with a JATIC protocol-based object detector.
- Args:
detector (od.Model): The JATIC object detection model. ids (Dict[int, Hashable]): A dictionary mapping label IDs to human-readable names. img_batch_size (int, optional): The number of images to process in a single batch. Defaults to 1.
- detect_objects(img_iter: Iterable[ndarray]) Iterable[Iterable[tuple[AxisAlignedBoundingBox, dict[Hashable, float]]]]
Generate paired bounding boxes and classification maps for detected objects in the given set of images.
- Parameters:
img_iter – Iterable of input images as numpy arrays.
- Returns:
Iterable of sets of paired bounding boxes and classification maps. Each set is the collection of detections for the corresponding input image.
- get_config() dict
Return a JSON-compliant dictionary that could be passed to this class’s
from_configmethod to produce an instance with identical configuration.In the most cases, this involves naming the keys of the dictionary based on the initialization argument names as if it were to be passed to the constructor via dictionary expansion. In some cases, where it doesn’t make sense to store some object constructor parameters are expected to be supplied at as configuration values (i.e. must be supplied at runtime), this method’s returned dictionary may leave those parameters out. In such cases, the object’s
from_configclass-method would also take additional positional arguments to fill in for the parameters that this returned configuration lacks.- Returns:
JSON type compliant configuration dictionary.
- Return type:
dict