Exemple #1
0
 def test_HAL12_tinyyolov1(self):
     """Do inference synchronously"""
     test_case = "HAL_12"
     case_name = "SyncTestV2"
     case_path = os.path.join(HAL_TEST_CODE, test_case)
     image_path = os.path.join(IMAGE_DIR, "448x448")
     graph_path = os.path.join(GRAPH_DIR, "yolo_graph.blob")
     runtime = str(RUN_TIME)
     log_path, server = self.__run_server(test_case)
     if server.is_ready():
         Client(log_path=log_path).inference(case_path=case_path,
                                             case_name=case_name,
                                             image_path=image_path,
                                             graph_path=graph_path,
                                             runtime=runtime)
     time.sleep(RUN_TIME + 5)
     check = CheckResult(log_path)
     result = check.server_is_running() and check.error_tasks() and check.client_num() and check.graph_num() \
              and check.device_num(DEVICE_NUM) and check.load_graph_time()
     check.write_result()
     self.assertTrue(result, msg="Please see '{}{}hal_result.csv' for detail.".format(log_path, os.sep))
     server.stop_run()
Exemple #2
0
 def test_HAL07(self):
     """Check task ID information"""
     test_case = "HAL_07"
     config = ModifyDict({"task_snapshot_mode": "base"}).add()
     case_path = os.path.join(HAL_TEST_CODE, test_case)
     image_path = os.path.join(IMAGE_DIR, "pic{}google0".format(os.sep))
     graph_path = os.path.join(GRAPH_DIR, "google{}google1.blob".format(os.sep))
     runtime = str(RUN_TIME)
     log_path, server = self.__run_server(test_case, config)
     if server.is_ready():
         Client(log_path=log_path).inference(case_path=case_path,
                                             image_path=image_path,
                                             graph_path=graph_path,
                                             runtime=runtime)
     time.sleep(RUN_TIME + 5)
     check = CheckResult(log_path)
     result = check.server_is_running() and check.keywords("TaskId=") and check.error_tasks() \
              and check.client_num() and check.graph_num() and check.device_num(DEVICE_NUM) \
              and check.load_graph_time() and check.all_device_running(DEVICE_NUM)
     check.write_result()
     self.assertTrue(result, msg="Please see '{}{}hal_result.csv' for detail.".format(log_path, os.sep))
     server.stop_run()