-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update kaleido and plotly versions (#163)
* Update versions * Remove logger and simplify output names * Add test
- Loading branch information
Showing
3 changed files
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
from pyodi.apps.ground_truth import ground_truth | ||
|
||
|
||
def test_ground_truth_saves_output_to_files(tmpdir): | ||
output = tmpdir.mkdir("results") | ||
|
||
categories = [{"id": 1, "name": "drone"}] | ||
images = [{"id": 0, "file_name": "image.jpg", "height": 10, "width": 10}] | ||
annotations = [ | ||
{"image_id": 0, "category_id": 1, "id": 0, "bbox": [0, 0, 5, 5], "area": 25} | ||
] | ||
coco_data = dict( | ||
images=images, | ||
annotations=annotations, | ||
categories=categories, | ||
info={}, | ||
licenses={}, | ||
) | ||
with open(tmpdir / "data.json", "w") as f: | ||
json.dump(coco_data, f) | ||
|
||
ground_truth(tmpdir / "data.json", show=False, output=output) | ||
|
||
assert len(list(Path(output / "data").iterdir())) == 3 |