fix bug with annotation result gradient stops

add tensorrt engine
This commit is contained in:
Alex Bezdieniezhnykh
2025-04-02 00:29:21 +03:00
parent e0c88bd8fb
commit b21f8e320f
36 changed files with 544 additions and 206 deletions
+14 -4
View File
@@ -73,6 +73,7 @@ cdef class ApiClient:
cdef load_bytes(self, str filename, str folder=None):
folder = folder or self.credentials.folder
hardware_service = HardwareService()
cdef HardwareInfo hardware = hardware_service.get_hardware_info()
@@ -110,11 +111,20 @@ cdef class ApiClient:
constants.log(<str>f'Downloaded file: {filename}, {len(data)} bytes')
return data
cdef load_ai_model(self):
with open(<str>constants.AI_MODEL_FILE_BIG, 'rb') as binary_file:
encrypted_bytes_big = binary_file.read()
encrypted_bytes_small = self.load_bytes(constants.AI_MODEL_FILE_SMALL)
cdef load_ai_model(self, bint is_tensor=False):
if is_tensor:
big_file = <str> constants.AI_TENSOR_MODEL_FILE_BIG
small_file = <str> constants.AI_TENSOR_MODEL_FILE_SMALL
else:
big_file = <str>constants.AI_ONNX_MODEL_FILE_BIG
small_file = <str> constants.AI_ONNX_MODEL_FILE_SMALL
with open(big_file, 'rb') as binary_file:
encrypted_bytes_big = binary_file.read()
print('read encrypted big file')
print(f'small file: {small_file}')
encrypted_bytes_small = self.load_bytes(small_file)
print('read encrypted small file')
encrypted_model_bytes = encrypted_bytes_small + encrypted_bytes_big
key = Security.get_model_encryption_key()