-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
A: log_imageArea: `live.log_image`Area: `live.log_image`A: studioArea: Studio integrationArea: Studio integrationA: vscodeArea: DVC VSCode Extension integrationArea: DVC VSCode Extension integrationp2-medium
Description
Related: iterative/dvc#10198, iterative/vscode-dvc#4917
We need a way to log bounding boxes (and maybe later other annotations like segmentation masks) for images saved with dvclive.
p1
The API can look like this:
boxes = [
{"label": "cat", "box": {"x_min": 100, "x_max": 110, "y_min": 5, "y_max": 20}},
{"label": "cat", "box": {"x_min": 30, "x_max": 55, "y_min": 75, "y_max": 90}},
{"label": "dog", "box": {"x_min": 80, "x_max": 100, "y_min": 25, "y_max": 50}}
]
live.log_image("myimg.png", myimg, boxes=boxes)
In addition to saving the image to dvclive/plots/images/myimg.png
, this will also save annotations to dvclive/plots/images/myimg.json
in the following format:
{"boxes":
[
{"label": "cat", "box": {"x_min": 100, "x_max": 110, "y_min": 5, "y_max": 20}},
{"label": "cat", "box": {"x_min": 30, "x_max": 55, "y_min": 75, "y_max": 90}},
{"label": "dog", "box": {"x_min": 80, "x_max": 100, "y_min": 25, "y_max": 50}}
]
}
p2:
- Other box formats (using width, height, and x/y for the center/corner) ({"x_center": 100, "y_center": 50, "width": 10, "height": 20})
- Normalized coordinates (between 0 and 1) instead of pixel coordinates (we could probably auto-detect this)
- Scores (
"scores": {"acc": 0.9, "loss": 0.05}
) so that users can filter boxes based on thresholds (only show boxes whereacc > 0.8
) - Segmentations masks (tbd, requires a class per pixel)
Metadata
Metadata
Assignees
Labels
A: log_imageArea: `live.log_image`Area: `live.log_image`A: studioArea: Studio integrationArea: Studio integrationA: vscodeArea: DVC VSCode Extension integrationArea: DVC VSCode Extension integrationp2-medium
Type
Projects
Status
In Progress