mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 06:56:31 +00:00
25 lines
645 B
Cython
25 lines
645 B
Cython
cdef class InferenceEngine:
|
|
def __init__(self, model_bytes: bytes, batch_size: int = 1, **kwargs):
|
|
self.batch_size = batch_size
|
|
|
|
@property
|
|
def engine_name(self):
|
|
return "onnx"
|
|
|
|
@staticmethod
|
|
def get_engine_filename():
|
|
return None
|
|
|
|
@staticmethod
|
|
def convert_from_onnx(bytes onnx_bytes):
|
|
return onnx_bytes
|
|
|
|
cdef tuple get_input_shape(self):
|
|
raise NotImplementedError("Subclass must implement get_input_shape")
|
|
|
|
cdef int get_batch_size(self):
|
|
return self.batch_size
|
|
|
|
cdef run(self, input_data):
|
|
raise NotImplementedError("Subclass must implement run")
|