turicreate.one_shot_object_detector.OneShotObjectDetector.predict¶
-
OneShotObjectDetector.
predict
(dataset, confidence_threshold=0.25, iou_threshold=0.45, verbose=True)¶ Predict object instances in an SFrame of images.
Parameters: - dataset : SFrame | SArray | turicreate.Image
The images on which to perform object detection. If dataset is an SFrame, it must have a column with the same name as the feature column during training. Additional columns are ignored.
- confidence_threshold : float
Only return predictions above this level of confidence. The threshold can range from 0 to 1.
- iou_threshold : float
Threshold value for non-maximum suppression. Non-maximum suppression prevents multiple bounding boxes appearing over a single object. This threshold, set between 0 and 1, controls how aggressive this suppression is. A value of 1 means no maximum suppression will occur, while a value of 0 will maximally suppress neighboring boxes around a prediction.
- verbose : bool
If True, prints prediction progress.
Returns: - out : SArray
An SArray with model predictions. Each element corresponds to an image and contains a list of dictionaries. Each dictionary describes an object instances that was found in the image. If dataset is a single image, the return value will be a single prediction.
See also
draw_bounding_boxes
Examples
# Make predictions >>> pred = model.predict(data) >>> predictions_with_bounding_boxes = tc.one_shot_object_detector.util.draw_bounding_boxes(data['images'], pred) >>> predictions_with_bounding_boxes.explore()