@@ -66,24 +66,21 @@ def test_annotation_folder_upload_download_cli_vector_COCO(tmpdir):
6666 sa .upload_images_from_folder_to_project (
6767 project , from_folder , annotation_status = "InProgress"
6868 )
69- # sa.create_annotation_classes_from_classes_json(
70- # project, from_folder / "classes" / "classes.json"
71- # )
7269 subprocess .run (
7370 f'superannotatecli upload-annotations --project "{ name } " --folder "{ from_folder } " --format COCO --task { task } --dataset-name { dataset_name } ' ,
7471 check = True ,
7572 shell = True
7673 )
77- # time.sleep(5)
78- # count_in = len(list(from_folder.glob("*.json")))
74+ time .sleep (5 )
75+ count_in = 2
7976
80- # images = sa.search_images(project)
81- # for image_name in images:
82- # sa.download_image_preannotations (project, image_name, tmpdir)
77+ images = sa .search_images (project )
78+ for image_name in images :
79+ sa .download_image_annotations (project , image_name , tmpdir )
8380
84- # count_out = len(list(Path(tmpdir).glob("*.json")))
81+ count_out = len (list (Path (tmpdir ).glob ("*.json" )))
8582
86- # assert count_in == count_out
83+ assert count_in == count_out
8784
8885
8986def test_preannotation_folder_upload_download_cli_vector_COCO (tmpdir ):
@@ -102,24 +99,21 @@ def test_preannotation_folder_upload_download_cli_vector_COCO(tmpdir):
10299 sa .upload_images_from_folder_to_project (
103100 project , from_folder , annotation_status = "InProgress"
104101 )
105- # sa.create_annotation_classes_from_classes_json(
106- # project, from_folder / "classes" / "classes.json"
107- # )
108102 subprocess .run (
109103 f'superannotatecli upload-preannotations --project "{ name } " --folder "{ from_folder } " --format COCO --task { task } --dataset-name { dataset_name } ' ,
110104 check = True ,
111105 shell = True
112106 )
113- # time.sleep(5)
114- # count_in = len(list(from_folder.glob("*.json")))
107+ time .sleep (5 )
108+ count_in = 2
115109
116- # images = sa.search_images(project)
117- # for image_name in images:
118- # sa.download_image_preannotations(project, image_name, tmpdir)
110+ images = sa .search_images (project )
111+ for image_name in images :
112+ sa .download_image_preannotations (project , image_name , tmpdir )
119113
120- # count_out = len(list(Path(tmpdir).glob("*.json")))
114+ count_out = len (list (Path (tmpdir ).glob ("*.json" )))
121115
122- # assert count_in == count_out
116+ assert count_in == count_out
123117
124118
125119def test_preannotation_folder_upload_download_cli_vector_object_COCO (tmpdir ):
@@ -138,14 +132,21 @@ def test_preannotation_folder_upload_download_cli_vector_object_COCO(tmpdir):
138132 sa .upload_images_from_folder_to_project (
139133 project , from_folder , annotation_status = "InProgress"
140134 )
141- # sa.create_annotation_classes_from_classes_json(
142- # project, from_folder / "classes" / "classes.json"
143- # )
144135 subprocess .run (
145136 f'superannotatecli upload-preannotations --project "{ name } " --folder "{ from_folder } " --format COCO --task { task } --dataset-name { dataset_name } ' ,
146137 check = True ,
147138 shell = True
148139 )
140+ time .sleep (5 )
141+ count_in = 4
142+
143+ images = sa .search_images (project )
144+ for image_name in images :
145+ sa .download_image_preannotations (project , image_name , tmpdir )
146+
147+ count_out = len (list (Path (tmpdir ).glob ("*.json" )))
148+
149+ assert count_in == count_out
149150
150151
151152def test_preannotation_folder_upload_download_cli_pixel_object_COCO (tmpdir ):
@@ -164,11 +165,18 @@ def test_preannotation_folder_upload_download_cli_pixel_object_COCO(tmpdir):
164165 sa .upload_images_from_folder_to_project (
165166 project , from_folder , annotation_status = "InProgress"
166167 )
167- # sa.create_annotation_classes_from_classes_json(
168- # project, from_folder / "classes" / "classes.json"
169- # )
170168 subprocess .run (
171169 f'superannotatecli upload-preannotations --project "{ name } " --folder "{ from_folder } " --format COCO --task { task } --dataset-name { dataset_name } ' ,
172170 check = True ,
173171 shell = True
174172 )
173+ time .sleep (5 )
174+ count_in = 6
175+
176+ images = sa .search_images (project )
177+ for image_name in images :
178+ sa .download_image_preannotations (project , image_name , tmpdir )
179+
180+ count_out = len (list (Path (tmpdir ).glob ("*.json" )))
181+
182+ assert count_in == count_out
0 commit comments