Thiago Hersan commited on
Commit
7253cb6
1 Parent(s): 39a4454

return well-formatted empty dataframe in case of no vegetation

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -59,6 +59,13 @@ def visualize_instance_seg_mask(img_in, mask, id2label):
59
  f"{np.sqrt(id2count[id] / image_total_pixels):.2f} m"
60
  ] for id in label_ids if id2label[id] in vegetation_labels]
61
 
 
 
 
 
 
 
 
62
  return image_res, dataframe
63
 
64
 
 
59
  f"{np.sqrt(id2count[id] / image_total_pixels):.2f} m"
60
  ] for id in label_ids if id2label[id] in vegetation_labels]
61
 
62
+ if len(dataframe) < 1:
63
+ dataframe = [[
64
+ f"",
65
+ f"{(0):.2f} %",
66
+ f"{(0):.2f} m"
67
+ ]]
68
+
69
  return image_res, dataframe
70
 
71