mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:56:30 +00:00
fix bug with annotation result gradient stops
add tensorrt engine
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user