Files
annotations/Azaion.Inference/inference.pxd
T
Oleksandr Bezdieniezhnykh 067f02cc63 update AI initializing
rework AIAvailabilityStatus events to mediatr
2025-09-01 20:12:13 +03:00

44 lines
1.7 KiB
Cython

from ai_availability_status cimport AIAvailabilityStatus
from remote_command_inf cimport RemoteCommand
from annotation cimport Annotation, Detection
from ai_config cimport AIRecognitionConfig
from loader_client cimport LoaderClient
from inference_engine cimport InferenceEngine
cdef class Inference:
cdef LoaderClient loader_client
cdef InferenceEngine engine
cdef object on_annotation
cdef Annotation _previous_annotation
cdef dict[str, list(Detection)] _tile_detections
cdef AIRecognitionConfig ai_config
cdef bint stop_signal
cdef AIAvailabilityStatus ai_availability_status
cdef str model_input
cdef int model_width
cdef int model_height
cdef int tile_width
cdef int tile_height
cdef bytes get_onnx_engine_bytes(self)
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 _process_images_inner(self, RemoteCommand cmd, AIRecognitionConfig ai_config, list frame_data)
cdef split_to_tiles(self, frame, path, overlap_percent)
cdef stop(self)
cdef preprocess(self, frames)
cdef remove_overlapping_detections(self, list[Detection] detections, float confidence_threshold=?)
cdef postprocess(self, output, ai_config)
cdef split_list_extend(self, lst, chunk_size)
cdef bint is_valid_video_annotation(self, Annotation annotation, AIRecognitionConfig ai_config)
cdef bint is_valid_image_annotation(self, Annotation annotation)
cdef remove_tiled_duplicates(self, Annotation annotation)