Spaces:
Runtime error
Runtime error
Commit
·
5382b80
1
Parent(s):
7162476
Update inference.py
Browse files- inference.py +5 -2
inference.py
CHANGED
@@ -412,18 +412,21 @@ def filter_detection_size(inference, image_meter_width, width, max_length):
|
|
412 |
for batch in inference:
|
413 |
|
414 |
pix2width = image_meter_width/width
|
415 |
-
print("pix2w", pix2width)
|
416 |
width = batch[..., 2]*pix2width
|
417 |
wc = width < max_length
|
418 |
bs = batch.shape[0] # batches
|
419 |
|
420 |
output = [torch.zeros((0, 6), device=batch.device)] * bs
|
|
|
421 |
for xi, x in enumerate(batch):
|
422 |
-
x = x[wc[xi]] # confidence
|
|
|
423 |
output[xi] = x
|
424 |
|
|
|
425 |
outputs.append(output)
|
426 |
|
|
|
427 |
return outputs
|
428 |
|
429 |
def non_max_suppression(
|
|
|
412 |
for batch in inference:
|
413 |
|
414 |
pix2width = image_meter_width/width
|
|
|
415 |
width = batch[..., 2]*pix2width
|
416 |
wc = width < max_length
|
417 |
bs = batch.shape[0] # batches
|
418 |
|
419 |
output = [torch.zeros((0, 6), device=batch.device)] * bs
|
420 |
+
print(type(batch))
|
421 |
for xi, x in enumerate(batch):
|
422 |
+
x = x[wc[xi], :] # confidence
|
423 |
+
print(len(x).shape)
|
424 |
output[xi] = x
|
425 |
|
426 |
+
print(len(output))
|
427 |
outputs.append(output)
|
428 |
|
429 |
+
print(len(outputs))
|
430 |
return outputs
|
431 |
|
432 |
def non_max_suppression(
|