Open Laughing-q opened 3 weeks ago
@Idan-BenAmi Hey, could you also take a look at this issue? is there a way to fix the order of box coordinates to make sure it's consistent to ultralytics
package's xyxy
? which would help us to simplify the code a lot. Thanks!
Hey @Laughing-q, Just to confirm, in our adjusted model, the "Detect" class outputs the bounding box (y_bb) in the yxyx order, and you’re asking it to be in the xyxy order instead?
@Idan-BenAmi yes! :) then it'd be consistent with our package.
Hi @Laughing-q, For xyxy modification please follow: PR you will also need to update the export code: https://github.com/ambitious-octopus/model_optimization/blob/main/ultralytics-exports/vanilla-yolo.py#L132
output_resize = {'shape': (INPUT_RESOLUTION, INPUT_RESOLUTION), 'aspect_ratio_preservation': True, 'normalized_coords': False, 'xyxy_bbox_format': True}
@Idan-BenAmi It works! Thank you!
@ambitious-octopus I'll push a update to ultralytics@quan
to simplify the code a bit. :)
return y_bb.transpose(1, 2), y_cls
The order of the box coordinates should be
xyxy
instead ofyxyx
, the coordinates are split in theyxyx
order but then stack they_bb
inxyxy
order. https://github.com/sony/model_optimization/blob/173ed446146f62a119d5bf09b09ef6e49d27a138/tutorials/mct_model_garden/models_pytorch/yolov8/yolov8.py#L269-L272 https://github.com/sony/model_optimization/blob/173ed446146f62a119d5bf09b09ef6e49d27a138/tutorials/mct_model_garden/models_pytorch/yolov8/yolov8.py#L273 However with this incorrect order the quantization works well hence I suspect the mct package is also doing job with the incorrectyxyx
order. We might need some updates on this point, then we could directly return the bounding boxes byy_bb.transpose(1, 2)
instead of splitting first then stack if we could fix the order.