yaghi27 commited on
Commit
26d95c3
·
verified ·
1 Parent(s): 66738a4

Upload utils.py

Browse files
Files changed (1) hide show
  1. model/utils.py +21 -22
model/utils.py CHANGED
@@ -155,28 +155,27 @@ def plot_bev_detections(
155
  # 5) Draw each box
156
  seen_labels = set()
157
  for box, score, label in zip(boxes, scores, labels):
158
- if label != 1:
159
- x, y, z, dx, dy, dz, yaw, *_ = box.cpu().numpy()
160
- cls_idx = int(label)
161
- cls_name = class_names[cls_idx]
162
- color = colors[cls_idx]
163
-
164
- # example of stretching length for 'car' if you still want it
165
- if cls_name.lower() == 'car':
166
- dx *= 1.2
167
-
168
- rect = patches.Rectangle(
169
- (x - dx/2, y - dy/2),
170
- dx, dy,
171
- angle=np.degrees(yaw),
172
- linewidth=1.5,
173
- edgecolor=color,
174
- facecolor='none'
175
- )
176
- ax.add_patch(rect)
177
-
178
- # remember we saw this label so we can add it to legend once
179
- seen_labels.add(cls_idx)
180
 
181
  # 6) Legend only for seen classes
182
  legend_handles = []
 
155
  # 5) Draw each box
156
  seen_labels = set()
157
  for box, score, label in zip(boxes, scores, labels):
158
+ x, y, z, dx, dy, dz, yaw, *_ = box.cpu().numpy()
159
+ cls_idx = int(label)
160
+ cls_name = class_names[cls_idx]
161
+ color = colors[cls_idx]
162
+
163
+ # example of stretching length for 'car' if you still want it
164
+ if cls_name.lower() == 'car':
165
+ dx *= 1.2
166
+
167
+ rect = patches.Rectangle(
168
+ (x - dx/2, y - dy/2),
169
+ dx, dy,
170
+ angle=np.degrees(yaw),
171
+ linewidth=1.5,
172
+ edgecolor=color,
173
+ facecolor='none'
174
+ )
175
+ ax.add_patch(rect)
176
+
177
+ # remember we saw this label so we can add it to legend once
178
+ seen_labels.add(cls_idx)
 
179
 
180
  # 6) Legend only for seen classes
181
  legend_handles = []