Object Detection
ObjectDetectionLabel
Arize class to define the prediction and actual arguments associated with the Object Detection model type
class ObjectDetectionLabel(
bounding_boxes_coordinates: List[List[float]]
categories: List[str]
scores: Optional[List[float]] = None
)
bounding_box_coordinates
List[List[float]]
(Required) Field defining the coordinates of the rectangular outline that locates an object within an image or video. Pascal VOC format required.
categories
List[str]
(Required) Field containing the predefined classes or labels used by the model to classify the detected objects.
scores
List[float]
(Optional*) Field containing the confidence scores that the model assigns to its predictions, indicating how certain the model is that the predicted class is contained within the bounding box.
* This parameter is not applicable to actual (ground truth) labels and is only applicable when defining prediction_label
Code Example
from arize.utils.types import Environments, ModelTypes, Schema, ObjectDetectionLabel
object_detection_prediction = ObjectDetectionLabel(
bounding_boxes_coordinates: [[147.5, 98.0, 169.67, 276.69], [114.19, 108.4...]]
categories: ['chair', 'chair', 'bed', 'dining table', 'chair']
scores: [0.90, 0.97, 0.98, 0.96, 0.96, 0.92, ...]
)
object_detection_actual = ObjectDetectionLabel(
bounding_boxes_coordinates: [[437.51, 366.37, 529.0, 480.97], [0.0, 302.24...]]
categories: ['dining table', 'bed', 'chair', 'chair']
)
response = arize.log(
model_id="demo-object-detection-single-log",
model_version="v1",
environment=Environments.PRODUCTION,
model_type=ModelTypes.OBJECT_DETECTION,
prediction_id="123",
prediction_label=object_detection_prediction,
actual_label=object_detection_actual
)
Last updated
Was this helpful?