Spaces:
Runtime error
Runtime error
Commit
•
51534fc
1
Parent(s):
36bc9cc
Update inference.py
Browse files- inference.py +8 -5
inference.py
CHANGED
@@ -410,24 +410,27 @@ def filter_detection_size(inference, image_meter_width, width, max_length):
|
|
410 |
|
411 |
outputs = []
|
412 |
for batch in inference:
|
|
|
413 |
print(type(batch))
|
414 |
-
print(
|
415 |
|
416 |
pix2width = image_meter_width/width
|
417 |
width = batch[..., 2]*pix2width
|
418 |
wc = width < max_length
|
|
|
419 |
print(type(wc))
|
420 |
-
print(
|
421 |
bs = batch.shape[0] # batches
|
422 |
|
423 |
output = [torch.zeros((0, 6), device=batch.device)] * bs
|
424 |
-
print(
|
|
|
425 |
for xi, x in enumerate(batch):
|
426 |
x = x[wc[xi]] # confidence
|
427 |
-
print(
|
428 |
output[xi] = x
|
429 |
|
430 |
-
print(len(output))
|
431 |
outputs.append(output)
|
432 |
|
433 |
print(len(outputs))
|
|
|
410 |
|
411 |
outputs = []
|
412 |
for batch in inference:
|
413 |
+
print("batch")
|
414 |
print(type(batch))
|
415 |
+
print(batch.shape)
|
416 |
|
417 |
pix2width = image_meter_width/width
|
418 |
width = batch[..., 2]*pix2width
|
419 |
wc = width < max_length
|
420 |
+
print("wc")
|
421 |
print(type(wc))
|
422 |
+
print(wc.shape)
|
423 |
bs = batch.shape[0] # batches
|
424 |
|
425 |
output = [torch.zeros((0, 6), device=batch.device)] * bs
|
426 |
+
print("wc")
|
427 |
+
print(batch.shape)
|
428 |
for xi, x in enumerate(batch):
|
429 |
x = x[wc[xi]] # confidence
|
430 |
+
print(x.shape)
|
431 |
output[xi] = x
|
432 |
|
433 |
+
print("output len", len(output))
|
434 |
outputs.append(output)
|
435 |
|
436 |
print(len(outputs))
|