fix json `np.float32` issue
Browse files
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)
|
|
|
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]
|