Thank you for another super video. The way you debug code is eye-opening! I have watched your other video, but this one seems much better. It would be very interesting if you could make a video to guide through steps like setting up break points, running only part of the code, etc.
It can be extracted via loss_dict=criterion(outputs,targets) with outputs= model(images, targets). Any idea if there are different weights for different loss components?
Np, I love questions. The source code for that is here: github.com/lyuwenyu/RT-DETR/blob/main/rtdetrv2_pytorch/src/solver/det_engine.py#L49 Added it to my example notebook as well github.com/adensur/blog/blob/main/computer_vision_zero_to_hero/32_rtdetr_v2/sandbox.ipynb
I'll try to go through the process and write a short instruction. But in theory: - Create a config, specifying the pretrained model similar to how they did it for discrete sampling: github.com/lyuwenyu/RT-DETR/blob/main/rtdetrv2_pytorch/configs/rtdetrv2/rtdetrv2_r18vd_dsp_3x_coco.yml#L10 - Convert your dataset to format similar to CoCo (i described how to get it here: github.com/adensur/blog/blob/main/computer_vision_zero_to_hero/32_rtdetr_v2/Install.md), i.e., with the same label and directory format After this, you should be able to run training (described here: github.com/lyuwenyu/RT-DETR/tree/main/rtdetrv2_pytorch#usage)
No, just my sloppy code. The CLASSES code is copy-pasted from some of my earlier videos (DETR, probably), and didn't correspond exactly to the format used in RT DETR. There should be a correct definition for all classes with proper names, but I was too lazy to find it
@@makgaiduk I found this comment in coco_detection.yml file and saw that your code matches exactly the same # num_classes: 91 # remap_mscoco_category: False
Thank you for another super video. The way you debug code is eye-opening!
I have watched your other video, but this one seems much better. It would be very interesting if you could make a video to guide through steps like setting up break points, running only part of the code, etc.
Is there any idea on how to extract loss from the forward pass model(images, targets)?
Sorry for having many questions! This model is so interesting!
It can be extracted via loss_dict=criterion(outputs,targets) with outputs= model(images, targets). Any idea if there are different weights for different loss components?
Np, I love questions. The source code for that is here: github.com/lyuwenyu/RT-DETR/blob/main/rtdetrv2_pytorch/src/solver/det_engine.py#L49
Added it to my example notebook as well github.com/adensur/blog/blob/main/computer_vision_zero_to_hero/32_rtdetr_v2/sandbox.ipynb
How to training this model on the custom dataset ? Thankyou.
I'll try to go through the process and write a short instruction. But in theory:
- Create a config, specifying the pretrained model similar to how they did it for discrete sampling: github.com/lyuwenyu/RT-DETR/blob/main/rtdetrv2_pytorch/configs/rtdetrv2/rtdetrv2_r18vd_dsp_3x_coco.yml#L10
- Convert your dataset to format similar to CoCo (i described how to get it here: github.com/adensur/blog/blob/main/computer_vision_zero_to_hero/32_rtdetr_v2/Install.md), i.e., with the same label and directory format
After this, you should be able to run training (described here: github.com/lyuwenyu/RT-DETR/tree/main/rtdetrv2_pytorch#usage)
In your demo code, CLASSES is defined with 91 classes which include 11 NA labels. Is there a reason for this?
No, just my sloppy code. The CLASSES code is copy-pasted from some of my earlier videos (DETR, probably), and didn't correspond exactly to the format used in RT DETR. There should be a correct definition for all classes with proper names, but I was too lazy to find it
@@makgaiduk I found this comment in coco_detection.yml file and saw that your code matches exactly the same
# num_classes: 91
# remap_mscoco_category: False