Commit 83c57b8
Fix
Previously, the yoloPostProcessing function assumed that the number of classes (nc) was fixed at 80. This caused incorrect behavior when a different number of classes was specified, leading to mismatched output shapes.
This update modifies the code to use the provided `nc` value dynamically, ensuring that the output shapes are correctly calculated based on the specified number of classes. This prevents issues when `nc` is not equal to 80 and allows for greater flexibility in model configurations.yoloPostProcessing` to handle variable number of classes (nc)1 parent 563fc59 commit 83c57b8
File tree
2 files changed
+10
-10
lines changed- modules/dnn/test
- samples/dnn
2 files changed
+10
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2691 | 2691 | | |
2692 | 2692 | | |
2693 | 2693 | | |
2694 | | - | |
| 2694 | + | |
2695 | 2695 | | |
2696 | 2696 | | |
2697 | 2697 | | |
| |||
2701 | 2701 | | |
2702 | 2702 | | |
2703 | 2703 | | |
2704 | | - | |
| 2704 | + | |
2705 | 2705 | | |
2706 | 2706 | | |
2707 | | - | |
2708 | | - | |
2709 | | - | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
2710 | 2710 | | |
2711 | 2711 | | |
2712 | 2712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments