-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounding boxes are drawn in random order instead of ordered by confidence #1061
Comments
laszlovandenhoek
added a commit
to laszlovandenhoek/super-gradients
that referenced
this issue
May 23, 2023
Good catch @laszlovandenhoek ! |
BloodAxe
added a commit
that referenced
this issue
May 24, 2023
geoffrey-g-delhomme
pushed a commit
to geoffrey-g-delhomme/super-gradients
that referenced
this issue
May 26, 2023
Co-authored-by: Shay Aharon <80472096+shaydeci@users.noreply.github.com> Co-authored-by: Eugene Khvedchenya <ekhvedchenya@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Describe the bug
Problem
This is the method that draws bounding boxes around predictions:
super-gradients/src/super_gradients/training/models/prediction_results.py
Lines 57 to 85 in a594497
However, the code does not take into account that bounding boxes are drawn on top of each other. Since the arrays are not in any particular order, if an object has multiple overlapping predictions, it can happen that a less likely prediction is drawn later, obscuring the more likely prediction in the resulting image.
Solution
This could be fixed by changing this line:
super-gradients/src/super_gradients/training/models/prediction_results.py
Line 69 in a594497
into:
This way, the most likely prediction is drawn last, i.e. on top of any overlapping other ones, and is therefore the most visible in the resulting image.
Example
The examples below were created using this code:
As you can see in these examples, there is less "flashing" in the resulting movie. Also, the fact that the most likely class for this animal is "bird" more often than "cat" immediately becomes apparent, highlighting the necessity for finetuning.
Before (=current code): https://krijskraan.nl/catbird-output-original.mp4
After ordering by confidence (=with proposed change): https://krijskraan.nl/catbird-output-ordered.mp4
Versions
PyTorch version: 1.12.1+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
Clang version: Could not collect
CMake version: version 3.26.0
Libc version: glibc-2.35
Python version: 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (64-bit runtime)
Python platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: GenuineIntel
Model name: 11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz
CPU family: 6
Model: 141
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
Stepping: 1
BogoMIPS: 5222.39
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512vbmi umip avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm avx512_vp2intersect flush_l1d arch_capabilities
Hypervisor vendor: Microsoft
Virtualization type: full
L1d cache: 384 KiB (8 instances)
L1i cache: 256 KiB (8 instances)
L2 cache: 10 MiB (8 instances)
L3 cache: 24 MiB (1 instance)
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Mitigation; Enhanced IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Versions of relevant libraries:
[pip3] numpy==1.23.0
[pip3] torch==1.12.1
[pip3] torchmetrics==0.8.0
[pip3] torchreid==0.2.5
[pip3] torchvision==0.13.1
[conda] Could not collect
The text was updated successfully, but these errors were encountered: