Need help understanding how v8DetectionLoss works #14464
Replies: 1 comment 5 replies
|
@rootdrew27 hi there! You're on the right track with your understanding. The 'batch' dictionary indeed contains the necessary information for processing targets. The 'targets' tensor is structured to include the image index, class labels, and bounding box coordinates. The image index helps in associating each target with the corresponding image in the batch. To plot the ground truth bounding boxes, ensure that you correctly resize the coordinates to match the original image dimensions. If you're having trouble, double-check the preprocessing steps and scaling factors applied to the bounding boxes. If the issue persists, try updating to the latest version of the Ultralytics package to ensure compatibility and bug fixes. Feel free to ask if you need further clarification! Best of luck with your modifications! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi.
I'm trying to modify the source code and I am having issues understanding how the 'batch' dictionary works. Specifically in relation to the 'targets' variable.
ultralytics/ultralytics/utils/loss.py
Line 223 in edca88d
I expected 'targets' to be a tensor containing indexes (i.e. information regarding what image in the batch it corresponds to), the ground truth class label, as well as the ground truth bboxes. Unfortunately, I was unable to relate these bbox coordinates to the batch['im_file'] images and I was unable to plot the ground truth bboxes (btw I am aware that I must resize the coordinates).
Sorry if this is a loaded question, I really appreciate any help though. Thanks!
All reactions