func draw_bounding_boxes()
str() and is hashable (e.g., strings, ints, etc.).
Colors can be specified as common HTML color names (e.g., ‘red’) supported by PIL’s ImageColor module or as RGB hex codes (e.g., ‘#FF0000’).
If no colors are specified, this function randomly assigns each label a specific color based on a hash of the label.
Parameters:
img(Image): The image on which to draw the bounding boxes.boxes(Json): List of bounding boxes, each represented as [xmin, ymin, xmax, ymax].labels(Json | None): List of labels for each bounding box.color(String | None): Single color to be used for all bounding boxes and labels.box_colors(Json | None): List of colors, one per bounding box.fill(Bool): Whether to fill the bounding boxes with color.width(Int): Width of the bounding box borders.font(String | None): Name of a system font or path to a TrueType font file, as required byPIL.ImageFont.truetype(). IfNone, uses the default provided byPIL.ImageFont.load_default().font_size(Int | None): Size of the font used for labels in points. Only used in conjunction with non-Nonefontargument.
Image: The image with bounding boxes drawn on it.
func eval_detections()
pred_bboxes(Json): List of predicted bounding boxes, each represented as [xmin, ymin, xmax, ymax].pred_labels(Json): List of predicted labels.pred_scores(Json): List of predicted scores.gt_bboxes(Json): List of ground truth bounding boxes, each represented as [xmin, ymin, xmax, ymax].gt_labels(Json): List of ground truth labels.min_iou(Float): Minimum intersection-over-union (IoU) threshold for a predicted bounding box to be considered a true positive.
Json: A list of dictionaries, one per label class, with the following structure: