Exemplo n.º 1
0
 def test_process_all(self):
     for jb in prep_job.jobs:
         job = Job(jb['name'], jb)
         job.type = 'preprocess'
         job.init_temp(str(uuid.uuid4()))
         try:
             job.init_labels()
             job.init_storage()
             job.testcoco = {"info": {
                 "description": "COCO 2017 Dataset",
                 "url": "http://cocodataset.org",
                 "version": "1.0",
                 "year": 2018,
                 "contributor": "COCO Consortium",
                 "date_created": "2017/09/01"
             },
                 "licenses": [],
                 "images": [],
                 "categories": [],
                 "annotations": [],
             }
             job.traincoco = {"info": {
                 "description": "COCO 2017 Dataset",
                 "url": "http://cocodataset.org",
                 "version": "1.0",
                 "year": 2018,
                 "contributor": "COCO Consortium",
                 "date_created": "2017/09/01"
             },
                 "licenses": [],
                 "images": [],
                 "categories": [],
                 "annotations": [],
             }
             process_json(job)
             create_label_pbtxt(job)
             create_tf_example(job)
             create_tf_example(job, False)
             delete_staged(job)
             upload_metadata(job)
         finally:
             job.cleanup()
Exemplo n.º 2
0
 def test_init_storage(self):
     for jb in prep_job.jobs:
         job = Job(jb['name'], jb)
         job.type = 'preprocess'
         job.init_temp(str(uuid.uuid4()))
         try:
             job.init_labels()
             job.init_storage()
             job.testcoco = {"info": {
                 "description": "COCO 2017 Dataset",
                 "url": "http://cocodataset.org",
                 "version": "1.0",
                 "year": 2018,
                 "contributor": "COCO Consortium",
                 "date_created": "2017/09/01"
             },
                 "licenses": [],
                 "images": [],
                 "categories": [],
                 "annotations": [],
             }
             job.traincoco = {"info": {
                 "description": "COCO 2017 Dataset",
                 "url": "http://cocodataset.org",
                 "version": "1.0",
                 "year": 2018,
                 "contributor": "COCO Consortium",
                 "date_created": "2017/09/01"
             },
                 "licenses": [],
                 "images": [],
                 "categories": [],
                 "annotations": [],
             }
         finally:
             job.cleanup()