Update YOLO workers for OBB tasks
Ref: https://redmine.teklia.com/issues/8946
In object detection, ultralytics with for example YOLOv11 supports tasks with Oriented Bounding Boxes.
This task is in-between bounding boxes and segmentation. To train, they take into account polygons defined like for segmentation (x1 y1 x2 y2 x3 y3 x4 y4) but that are limited to 4 points. The difference being that the polygon is then considered like a bounding box. Thus, I do not know if uploading an obb model as a segmentation one is better of if another type of deposit should be made to handle this task.
For example, when i try a process with a worker deposited as detection, it does :
2024-10-28 10:35:56,028 INFO/arkindex_worker: Worker will use /data/current as working directory
2024-10-28 10:35:58,371 INFO/arkindex_worker: Loaded Worker YOLO Inference @ 1.0.4 (1d0b23) with model YOLO | Socface | Adress detection @ c69bf1 from API
2024-10-28 10:35:58,371 INFO/arkindex_worker: Loaded model version configuration from WorkerRun
2024-10-28 10:35:58,371 INFO/arkindex_worker: Model version configuration retrieved
2024-10-28 10:35:58,371 INFO/arkindex_worker: User configuration retrieved
2024-10-28 10:35:58,575 INFO/worker_yolo.segmenter: Checking required element types...
2024-10-28 10:35:58,879 INFO/arkindex_worker: Loaded 11 element types in corpus (c4a7f8ce-69a1-4c11-8343-11f4829582cf).
2024-10-28 10:35:59,037 INFO/arkindex_worker: Processing single_page 33-1 (028b729d-c568-467f-9195-4ae6b3ca8c12) (1/94)
2024-10-28 10:35:59,461 INFO/worker_yolo.segmenter: Loading element image...
2024-10-28 10:36:00,481 INFO/arkindex_worker: Downloaded image https://europe.iiif.teklia.com/iiif/2/frad003%2FNEUILLY-LE-REAL%2FNEUILLY-LE-REAL-1901%2FFRAD003-NEUILLY-LE-REAL-1901-6M203-2-0033.jpg/0,0,2527,3715/full/0/default.jpg - size=2527x3715 in 0:00:00.773520
2024-10-28 10:36:00,612 INFO/worker_yolo.segmenter: Predicting boxes and segments on the image...
2024-10-28 10:36:00,655 INFO/worker_yolo.segmenter: Using device 0
0: 1024x704 76.4ms
Speed: 3.9ms preprocess, 76.4ms inference, 75.6ms postprocess per image at shape (1, 3, 1024, 704)
2024-10-28 10:36:02,367 WARNING/arkindex_worker: Failed running worker on element 028b729d-c568-467f-9195-4ae6b3ca8c12: AttributeError("'NoneType' object has no attribute 'xyxy'")
2024-10-28 10:36:02,801 INFO/arkindex_worker: Processing single_page 10-1 (04dd31cc-1d02-4c06-b363-03361aaf8360) (2/94)
2024-10-28 10:36:03,217 INFO/worker_yolo.segmenter: Loading element image...
2024-10-28 10:36:04,170 INFO/arkindex_worker: Downloaded image https://europe.iiif.teklia.com/iiif/2/frad003%2FLE-DONJON%2FLE-DONJON-1906%2FFRAD003-LE-DONJON-1906-6M142-2-0010.jpg/0,0,2375,3632/full/0/default.jpg - size=2375x3632 in 0:00:00.676010
2024-10-28 10:36:04,298 INFO/worker_yolo.segmenter: Predicting boxes and segments on the image...
2024-10-28 10:36:04,298 INFO/worker_yolo.segmenter: Using device 0
0: 1024x672 73.1ms
Speed: 1.9ms preprocess, 73.1ms inference, 2.1ms postprocess per image at shape (1, 3, 1024, 672)
2024-10-28 10:36:04,451 WARNING/arkindex_worker: Failed running worker on element 04dd31cc-1d02-4c06-b363-03361aaf8360: AttributeError("'NoneType' object has no attribute 'xyxy'")
Edited by Mélodie Boillet