Сначала я получаю набор данных с одним изображением, аннотированный в roboflow, вот так:
Код: Выделить всё
dataset = version.download(model_format="yolov8", location="./datasets")
Код: Выделить всё
results = model.train(data="/roboflow_ml_image_detection/datasets/oups-1/data.yaml", epochs=5)
Код: Выделить всё
success = model.export(format="onnx")
Код: Выделить всё
model = YOLO('/roboflow_ml_image_detection/runs/detect/train29/weights/last.pt')
results = model(source='./weirdobject.jpg', conf=0.25)[0]
Код: Выделить всё
import supervision as sv
detections = sv.Detections.from_ultralytics(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
sv.plot_image(annotated_image)
Что здесь не так?
Подробнее здесь: https://stackoverflow.com/questions/787 ... onal-image