Hi, I am doing evaluation of a trained YOLO4 model outside of TAO. What I need are the predicted labels in the KITTI .txt format.
When running the inference I get the images_annotated and labels. However, the labels do not contain the correct coordinates. This seems to be a bug I believe.
What is going on? It looks like the coordinates in the .txt files are based in the model resolution (which is 480x480 in my case). Also there seems to be some letter-boxing going on where the image is center-padded and this transformation is not being undone in the output to the .txt file.
As you can see using tao the labels are a better match for the coordinates measured on the image. However, there is still a difference that cannot be explained by rounding:
In this image you see in yellow the bounding box plotted by tao inference. I also plotted the detection based on the kitty .txt label. You can see the difference.
Strangely this difference is worse on some images like this one:
Findings / conclusion
I was able to transform the wrong kitty labels output from tao-deploy so that they perfectly align with the labels plotted on the image using this transformation (will post code).
However, I am not sure what to do with the output from tao, it is much better, but why the difference?
UPDATE 22/JUN/2023
There was a bug in my evaluation code. The output of tao inference is correct. The images_annotated align with the output kitty .txt labels.
Conclusion - use tao inference and don’t use tao-deploy inference.
Below shows the result with perfect alignment of the annotation (yellow) and the plotted label from the kitty .txt.
Old answer (wrong)
Below is the training spec file. I use 480x480 model resolution. The images are from the COCO dataset which have different resolutions (max_width=640, max_height=480, keep_aspect=True).
What I don’t understand is why annotated image seems to show the correct bounding box that the model predicted while the exported kitty .txt label is different. Both are the same thing, the predictions. Regardless of any config, the output annotated_image and its kitty-.txt should be consistent.