1+ from pathlib import Path
12import superannotate as sa
23
3- print ('one' )
4- sa .import_annotation_format (
5- 'SageMaker/input/toSuperAnnotate/object_detection' , 'output' , 'SageMaker' ,
6- 'test-obj-detect' , 'Vector' , 'object_detection' , 'Web'
7- )
8-
9- print ('two' )
10- sa .import_annotation_format (
11- 'SageMaker/input/toSuperAnnotate/instance_segmentation' , 'output2' ,
12- 'SageMaker' , 'test-obj-detect' , 'Pixel' , 'instance_segmentation' , 'Web'
13- )
4+
5+ def sagemaker_object_detection (tmpdir ):
6+ out_dir = tmpdir / "object_detection"
7+ sa .import_annotation_format (
8+ 'tests/converter_test/SageMaker/input/toSuperAnnotate/object_detection' ,
9+ str (out_dir ), 'SageMaker' , 'test-obj-detect' , 'Vector' ,
10+ 'object_detection' , 'Web'
11+ )
12+
13+ project_name = "sagemaker_object_detection"
14+
15+ projects = sa .search_projects (project_name , True )
16+ if projects :
17+ sa .delete_project (projects [0 ])
18+ project = sa .create_project (project_name , "converter vector" , "Vector" )
19+
20+ sa .create_annotation_classes_from_classes_json (
21+ project , out_dir + "/classes/classes.json"
22+ )
23+ sa .upload_images_from_folder_to_project (project , out_dir )
24+ sa .upload_annotations_from_folder_to_project (project , out_dir )
25+
26+ return 0
27+
28+
29+ def test_sagemaker (tmpdir ):
30+ assert sagemaker_object_detection (tmpdir ) == 0
0 commit comments