mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 21:46:30 +00:00
d92da6afa4
notifying client of AI model conversion
35 lines
1.2 KiB
Cython
35 lines
1.2 KiB
Cython
from remote_command cimport RemoteCommand
|
|
from annotation cimport Annotation, Detection
|
|
from ai_config cimport AIRecognitionConfig
|
|
from api_client cimport ApiClient
|
|
from inference_engine cimport InferenceEngine
|
|
|
|
cdef class Inference:
|
|
cdef ApiClient api_client
|
|
cdef InferenceEngine engine
|
|
cdef object on_annotation
|
|
cdef Annotation _previous_annotation
|
|
cdef AIRecognitionConfig ai_config
|
|
cdef bint stop_signal
|
|
|
|
cdef str model_input
|
|
cdef int model_width
|
|
cdef int model_height
|
|
|
|
cdef build_tensor_engine(self, object updater_callback)
|
|
cdef init_ai(self)
|
|
cdef bint is_building_engine
|
|
cdef bint is_video(self, str filepath)
|
|
|
|
cdef run_inference(self, RemoteCommand cmd)
|
|
cdef _process_video(self, RemoteCommand cmd, AIRecognitionConfig ai_config, str video_name)
|
|
cdef _process_images(self, RemoteCommand cmd, AIRecognitionConfig ai_config, list[str] image_paths)
|
|
cdef stop(self)
|
|
|
|
cdef preprocess(self, frames)
|
|
cdef remove_overlapping_detections(self, list[Detection] detections)
|
|
cdef postprocess(self, output, ai_config)
|
|
cdef split_list_extend(self, lst, chunk_size)
|
|
|
|
cdef bint is_valid_annotation(self, Annotation annotation, AIRecognitionConfig ai_config)
|