latest/how_to/detect_and_annotate/ #873
Replies: 6 comments 13 replies
-
this is so good but the annotating spend lot of space |
Beta Was this translation helpful? Give feedback.
-
how do I annotate gray image as it has less dimension? |
Beta Was this translation helpful? Give feedback.
-
How to annotate multiple labels like class_name, tracker_id, confidence, ....? |
Beta Was this translation helpful? Give feedback.
-
For some reason only bounding box annotation is working for me from ultralytics import YOLO
import cv2 as cv
import supervision as sv
coco_model = YOLO("yolov8n.pt")
image = cv.imread("./cars.png")
result = coco_model(image)[0]
# parse detections
detections = sv.Detections.from_ultralytics(result)
print('detections: ',detections)
detections = detections[detections.class_id == 2]
bounding_box_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator()
labels = [
coco_model.model.names[class_id]
for class_id
in detections.class_id
]
annotated_image = bounding_box_annotator.annotate(scene=image, detections=detections)
annotated_image = label_annotator.annotate(scene=annotated_image, detections=detections, labels=labels)
sv.plot_image(annotated_image) what is wrong in this code? |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I didn't find anything about that. Thanks in advance! Luis. |
Beta Was this translation helpful? Give feedback.
-
This code work fine in my laptop , but in my raspberry pi 4 gives below error labels = [ ^ TypeError: 'NoneType' object is not iterable
|
Beta Was this translation helpful? Give feedback.
-
latest/how_to/detect_and_annotate/
A set of easy-to-use utilities that will come in handy in any computer vision project.
https://supervision.roboflow.com/latest/how_to/detect_and_annotate/
Beta Was this translation helpful? Give feedback.
All reactions