Skip to content

Commit d04a676

Browse files
committed
Annotation CLI upload test update
1 parent 53cca06 commit d04a676

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/test_preannotation_upload_cli.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,44 @@ def test_preannotation_folder_upload_download_cli(
5252
assert count_in == count_out
5353

5454

55+
def test_annotation_folder_upload_download_cli_vector_COCO(tmpdir):
56+
project_type = "Vector"
57+
name = "Example Project test vector2 annotation cli upload coco vector"
58+
description = "test"
59+
from_folder = "./tests/converter_test/COCO/input/toSuperAnnotate/keypoint_detection"
60+
task = "keypoint_detection"
61+
dataset_name = "person_keypoints_test"
62+
63+
projects_found = sa.search_projects(name, return_metadata=True)
64+
for pr in projects_found:
65+
sa.delete_project(pr)
66+
67+
project = sa.create_project(name, description, project_type)
68+
sa.upload_images_from_folder_to_project(
69+
project, from_folder, annotation_status="InProgress"
70+
)
71+
# sa.create_annotation_classes_from_classes_json(
72+
# project, from_folder / "classes" / "classes.json"
73+
# )
74+
subprocess.run(
75+
[
76+
f"superannotate upload-annotations --project '{name}' --folder '{from_folder}' --format COCO --task {task} --dataset-name {dataset_name}"
77+
],
78+
check=True,
79+
shell=True
80+
)
81+
# time.sleep(5)
82+
# count_in = len(list(from_folder.glob("*.json")))
83+
84+
# images = sa.search_images(project)
85+
# for image_name in images:
86+
# sa.download_image_preannotations(project, image_name, tmpdir)
87+
88+
# count_out = len(list(Path(tmpdir).glob("*.json")))
89+
90+
# assert count_in == count_out
91+
92+
5593
def test_preannotation_folder_upload_download_cli_vector_COCO(tmpdir):
5694
project_type = "Vector"
5795
name = "Example Project test vector2 preannotation cli upload coco vector"

0 commit comments

Comments
 (0)