Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -158,13 +158,14 @@ def analyze():
|
|
| 158 |
p["wiki_url"] = url
|
| 159 |
|
| 160 |
# Annotate image
|
| 161 |
-
annotated_bytes = annotate(raw_bytes, plants)
|
| 162 |
annotated_b64 = base64.b64encode(annotated_bytes).decode("utf-8")
|
| 163 |
|
| 164 |
return jsonify({
|
| 165 |
"plants": plants,
|
| 166 |
"count": len(plants),
|
| 167 |
-
"annotated_image": f"data:image/
|
|
|
|
| 168 |
})
|
| 169 |
|
| 170 |
except Exception as e:
|
|
|
|
| 158 |
p["wiki_url"] = url
|
| 159 |
|
| 160 |
# Annotate image
|
| 161 |
+
annotated_bytes, dot_positions = annotate(raw_bytes, plants)
|
| 162 |
annotated_b64 = base64.b64encode(annotated_bytes).decode("utf-8")
|
| 163 |
|
| 164 |
return jsonify({
|
| 165 |
"plants": plants,
|
| 166 |
"count": len(plants),
|
| 167 |
+
"annotated_image": f"data:image/png;base64,{annotated_b64}",
|
| 168 |
+
"dot_positions": dot_positions
|
| 169 |
})
|
| 170 |
|
| 171 |
except Exception as e:
|