Spaces:
Runtime error
Runtime error
Fix bug with values
Browse files
app.py
CHANGED
@@ -31,13 +31,16 @@ def compute_depth(image, preds):
|
|
31 |
align_corners=False,
|
32 |
).squeeze().numpy()
|
33 |
|
|
|
|
|
34 |
output = []
|
35 |
|
36 |
for pred in preds:
|
37 |
x = (pred["box"]["xmax"] - pred["box"]["xmin"]) // 2
|
38 |
y = (pred["box"]["ymax"] - pred["box"]["ymin"]) // 2
|
39 |
output.append({
|
40 |
-
"
|
|
|
41 |
})
|
42 |
|
43 |
return output
|
|
|
31 |
align_corners=False,
|
32 |
).squeeze().numpy()
|
33 |
|
34 |
+
print(prediction.shape)
|
35 |
+
|
36 |
output = []
|
37 |
|
38 |
for pred in preds:
|
39 |
x = (pred["box"]["xmax"] - pred["box"]["xmin"]) // 2
|
40 |
y = (pred["box"]["ymax"] - pred["box"]["ymin"]) // 2
|
41 |
output.append({
|
42 |
+
"class": pred["label"],
|
43 |
+
"distance": float(prediction[y][x])
|
44 |
})
|
45 |
|
46 |
return output
|