tphung commited on
Commit
b652aa3
1 Parent(s): 1476ed8

Fix bug with values

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- "distance": float(prediction[x][y])
 
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