Spaces:
Runtime error
Runtime error
oskarastrom
commited on
Commit
•
36bc9cc
1
Parent(s):
5382b80
Update inference.py
Browse files- inference.py +6 -2
inference.py
CHANGED
@@ -410,17 +410,21 @@ def filter_detection_size(inference, image_meter_width, width, max_length):
|
|
410 |
|
411 |
outputs = []
|
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]
|
423 |
-
print(
|
424 |
output[xi] = x
|
425 |
|
426 |
print(len(output))
|
|
|
410 |
|
411 |
outputs = []
|
412 |
for batch in inference:
|
413 |
+
print(type(batch))
|
414 |
+
print(len(batch))
|
415 |
|
416 |
pix2width = image_meter_width/width
|
417 |
width = batch[..., 2]*pix2width
|
418 |
wc = width < max_length
|
419 |
+
print(type(wc))
|
420 |
+
print(len(wc))
|
421 |
bs = batch.shape[0] # batches
|
422 |
|
423 |
output = [torch.zeros((0, 6), device=batch.device)] * bs
|
424 |
print(type(batch))
|
425 |
for xi, x in enumerate(batch):
|
426 |
+
x = x[wc[xi]] # confidence
|
427 |
+
print(type(x))
|
428 |
output[xi] = x
|
429 |
|
430 |
print(len(output))
|