waleko commited on
Commit
97cb6a7
1 Parent(s): 90b2862

fix json `np.float32` issue

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -144,7 +144,8 @@ def detect_objects(image, prompt, show_masks=True, show_boxes=True, crop_options
144
 
145
  # save object information in json
146
  res_json["objects"].append(
147
- {"label": label, "score": np.max(scores), "box": input_box.tolist(), "center": center_point.tolist(),
 
148
  "avg_size": avg_size})
149
 
150
  return [res_json, output_image_paths]
 
144
 
145
  # save object information in json
146
  res_json["objects"].append(
147
+ {"label": label, "score": np.max(scores).item(), "box": input_box.tolist(),
148
+ "center": center_point.tolist(),
149
  "avg_size": avg_size})
150
 
151
  return [res_json, output_image_paths]