Related: treeverse/dvc#10198, treeverse/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:
Related: treeverse/dvc#10198, treeverse/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:
In addition to saving the image to
dvclive/plots/images/myimg.png, this will also save annotations todvclive/plots/images/myimg.jsonin 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:
"scores": {"acc": 0.9, "loss": 0.05}) so that users can filter boxes based on thresholds (only show boxes whereacc > 0.8)