mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:16:30 +00:00
fix inference bug in loading model
This commit is contained in:
@@ -4,7 +4,7 @@ from PyInstaller.utils.hooks import collect_all
|
|||||||
|
|
||||||
datas = [('venv\\Lib\\site-packages\\cv2', 'cv2')]
|
datas = [('venv\\Lib\\site-packages\\cv2', 'cv2')]
|
||||||
binaries = []
|
binaries = []
|
||||||
hiddenimports = ['constants', 'file_data', 'loader_client', 'remote_command', 'remote_command_handler', 'annotation', 'loader_client', 'ai_config', 'tensorrt_engine', 'onnx_engine', 'inference_engine', 'inference', 'main-inf']
|
hiddenimports = ['constants', 'file_data', 'remote_command', 'remote_command_handler', 'annotation', 'loader_client', 'ai_config', 'tensorrt_engine', 'onnx_engine', 'inference_engine', 'inference', 'main-inf']
|
||||||
hiddenimports += collect_submodules('cv2')
|
hiddenimports += collect_submodules('cv2')
|
||||||
tmp_ret = collect_all('psutil')
|
tmp_ret = collect_all('psutil')
|
||||||
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
|
||||||
|
|||||||
@@ -102,11 +102,15 @@ cdef class Inference:
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
engine_filename = TensorRTEngine.get_engine_filename(0)
|
engine_filename = TensorRTEngine.get_engine_filename(0)
|
||||||
|
|
||||||
model_bytes = self.loader_client.load_big_small_resource(engine_filename, models_dir)
|
res = self.loader_client.load_big_small_resource(engine_filename, models_dir)
|
||||||
self.engine = TensorRTEngine(model_bytes)
|
if res.err is not None:
|
||||||
|
raise Exception(res.err)
|
||||||
|
self.engine = TensorRTEngine(res.data)
|
||||||
else:
|
else:
|
||||||
model_bytes = self.loader_client.load_big_small_resource(constants.AI_ONNX_MODEL_FILE, models_dir)
|
res = self.loader_client.load_big_small_resource(constants.AI_ONNX_MODEL_FILE, models_dir)
|
||||||
self.engine = OnnxEngine(model_bytes)
|
if res.err is not None:
|
||||||
|
raise Exception(res.err)
|
||||||
|
self.engine = OnnxEngine(res.data)
|
||||||
|
|
||||||
self.model_height, self.model_width = self.engine.get_input_shape()
|
self.model_height, self.model_width = self.engine.get_input_shape()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user