zoo.models.image.objectdetection package¶
Submodules¶
zoo.models.image.objectdetection.object_detector module¶
-
class
zoo.models.image.objectdetection.object_detector.DecodeOutput(bigdl_type='float')[source]¶ Bases:
zoo.feature.image.imagePreprocessing.ImagePreprocessingDecode the detection output The output of the model prediction is a 1-dim tensor The first element of tensor is the number(K) of objects detected, followed by [label score x1 y1 x2 y2] X K For example, if there are 2 detected objects, then K = 2, the tensor may looks like
`2, 1, 0.5, 10, 20, 50, 80, 3, 0.3, 20, 10, 40, 70`After decoding, it returns a 2-dim tensor, each row represents a detected object` 1, 0.5, 10, 20, 50, 80 3, 0.3, 20, 10, 40, 70 `
-
class
zoo.models.image.objectdetection.object_detector.ImInfo(bigdl_type='float')[source]¶ Bases:
zoo.feature.image.imagePreprocessing.ImagePreprocessingGenerate imInfo imInfo is a tensor that contains height, width, scaleInHeight, scaleInWidth
-
class
zoo.models.image.objectdetection.object_detector.ObjectDetector(bigdl_type='float')[source]¶ Bases:
zoo.models.image.common.image_model.ImageModelA pre-trained object detector model.
:param model_path The path containing the pre-trained model
-
static
load_model(path, weight_path=None, bigdl_type='float')[source]¶ Load an existing object detection model (with weights).
# Arguments path: The path to save the model. Local file system, HDFS and Amazon S3 are supported.
HDFS path should be like ‘hdfs://[host]:[port]/xxx’. Amazon S3 path should be like ‘s3a://bucket/xxx’.
-
static
-
class
zoo.models.image.objectdetection.object_detector.ScaleDetection(bigdl_type='float')[source]¶ Bases:
zoo.feature.image.imagePreprocessing.ImagePreprocessingIf the detection is normalized, for example, ssd detected bounding box is in [0, 1], need to scale the bbox according to the original image size. Note that in this transformer, the tensor from model output will be decoded, just like DecodeOutput
-
class
zoo.models.image.objectdetection.object_detector.Visualizer(label_map, thresh=0.3, encoding='png', bigdl_type='float')[source]¶ Bases:
zoo.feature.image.imagePreprocessing.ImagePreprocessingVisualizer is a transformer to visualize the detection results (tensors that encodes label, score, boundingbox) You can call image_frame.get_image() to get the visualized results