Spaces:
Sleeping
Sleeping
Update api.py
Browse files
api.py
CHANGED
|
@@ -262,7 +262,10 @@ async def geo_sensor_classify(query: GeoSenQuery):
|
|
| 262 |
query.pesticide_usage_ml,query.total_days,query.yield_kg_per_hectare,query.latitude,query.longitude,
|
| 263 |
query.NDVI_index])
|
| 264 |
|
| 265 |
-
return {
|
|
|
|
|
|
|
|
|
|
| 266 |
|
| 267 |
except Exception as e:
|
| 268 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
|
| 262 |
query.pesticide_usage_ml,query.total_days,query.yield_kg_per_hectare,query.latitude,query.longitude,
|
| 263 |
query.NDVI_index])
|
| 264 |
|
| 265 |
+
return {
|
| 266 |
+
"answer": int(np.argmax(logits)),
|
| 267 |
+
"logits": logits.tolist() if isinstance(logits, np.ndarray) else float(logits)
|
| 268 |
+
}
|
| 269 |
|
| 270 |
except Exception as e:
|
| 271 |
raise HTTPException(status_code=500, detail=str(e))
|