Skip to content

Commit e3469fd

Browse files
committed
Merge remote-tracking branch 'origin/folder_structure2'
2 parents 8af52d6 + c65bfd2 commit e3469fd

File tree

6 files changed

+48
-7
lines changed

6 files changed

+48
-7
lines changed
2.24 MB
Loading
2.41 MB
Loading
2.2 MB
Loading
2.27 MB
Loading

tests/consensus_benchmark/test_benchmark.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import superannotate as sa
44

55
test_root = Path().resolve() / 'tests'
6-
project_name = "consensus_enhanced"
6+
project_name = "benchmark_enhanced"
77

88

99
def test_benchmark():
@@ -15,13 +15,32 @@ def test_benchmark():
1515
'attributes', 'folderName', 'score'
1616
]
1717
export_path = test_root / 'consensus_benchmark' / 'consensus_test_data'
18+
if len(sa.search_projects(project_name)) != 0:
19+
sa.delete_project(project_name)
20+
21+
sa.create_project(project_name, "test bench", "Vector")
22+
for i in range(1, 4):
23+
sa.create_folder(project_name, "consensus_" + str(i))
24+
sa.create_annotation_classes_from_classes_json(
25+
project_name, export_path / 'classes' / 'classes.json'
26+
)
27+
sa.upload_images_from_folder_to_project(
28+
project_name, export_path / "images"
29+
)
30+
for i in range(1, 4):
31+
sa.upload_images_from_folder_to_project(
32+
project_name + '/consensus_' + str(i), export_path / "images"
33+
)
34+
sa.upload_annotations_from_folder_to_project(project_name, export_path)
35+
for i in range(1, 4):
36+
sa.upload_annotations_from_folder_to_project(
37+
project_name + '/consensus_' + str(i),
38+
export_path / ('consensus_' + str(i))
39+
)
40+
1841
for annot_type in annot_types:
1942
res_df = sa.benchmark(
20-
project_name,
21-
gt_folder_name,
22-
folder_names,
23-
export_root=export_path,
24-
annot_type=annot_type
43+
project_name, gt_folder_name, folder_names, annot_type=annot_type
2544
)
2645
#test content of projectName column
2746
assert sorted(res_df['folderName'].unique()) == folder_names

tests/consensus_benchmark/test_consensus.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,33 @@ def test_consensus():
1414
'attributes', 'folderName', 'score'
1515
]
1616
export_path = test_root / 'consensus_benchmark' / 'consensus_test_data'
17+
if len(sa.search_projects(project_name)) != 0:
18+
sa.delete_project(project_name)
19+
20+
sa.create_project(project_name, "test bench", "Vector")
21+
for i in range(1, 4):
22+
sa.create_folder(project_name, "consensus_" + str(i))
23+
sa.create_annotation_classes_from_classes_json(
24+
project_name, export_path / 'classes' / 'classes.json'
25+
)
26+
sa.upload_images_from_folder_to_project(
27+
project_name, export_path / "images"
28+
)
29+
for i in range(1, 4):
30+
sa.upload_images_from_folder_to_project(
31+
project_name + '/consensus_' + str(i), export_path / "images"
32+
)
33+
sa.upload_annotations_from_folder_to_project(project_name, export_path)
34+
for i in range(1, 4):
35+
sa.upload_annotations_from_folder_to_project(
36+
project_name + '/consensus_' + str(i),
37+
export_path / ('consensus_' + str(i))
38+
)
39+
1740
for annot_type in annot_types:
1841
res_df = sa.consensus(
1942
project_name,
2043
folder_names,
21-
export_root=export_path,
2244
annot_type=annot_type
2345
)
2446
#test content of projectName column

0 commit comments

Comments
 (0)