-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Description
When an image has no predictions, it would be nice if utilities.format_geometry natively processed this into the output. Right now we have to do something like
DeepForest/src/deepforest/main.py
Line 908 in d0d6c0a
| result = utilities.format_geometry(pred, geom_type=geom_type) |
predictions = m.predict_step(images, batch_index)
for pred in predictions:
geometry = determine_geometry(pred)
if len(pred[geometry]) == 0:
y_pred = {}
y_pred["y"] = torch.zeros(4)
y_pred["labels"] = torch.zeros(1)
y_pred["scores"] = torch.zeros(1)
else:
format_geometry(pred, geom_type=geometry)
Desired functionality
- a new single function 'format_prediction' that looks at a prediction dictionary, uses determine_geometry, format_geometry, and fills in the edge case of empty images.
- Minimal tests that shows this behavior for points and boxes, @jveitchmichaelis we don't have polygon prediction yet, right?
Copilot
Metadata
Metadata
Assignees
Labels
No labels