refactor external clients

put model batch size as parameter in config
This commit is contained in:
Alex Bezdieniezhnykh
2025-03-24 00:33:41 +02:00
parent 32f9de3c71
commit 6429ad62c2
28 changed files with 352 additions and 226 deletions
+14 -10
View File
@@ -11,7 +11,8 @@ cdef class AIRecognitionConfig:
tracking_intersection_threshold,
file_data,
paths
paths,
model_batch_size
):
self.frame_period_recognition = frame_period_recognition
self.frame_recognition_seconds = frame_recognition_seconds
@@ -23,26 +24,29 @@ cdef class AIRecognitionConfig:
self.file_data = file_data
self.paths = paths
self.model_batch_size = model_batch_size
def __str__(self):
return (f'frame_seconds : {self.frame_recognition_seconds}, distance_confidence : {self.tracking_distance_confidence}, '
f'probability_increase : {self.tracking_probability_increase}, '
f'intersection_threshold : {self.tracking_intersection_threshold}, '
f'frame_period_recognition : {self.frame_period_recognition}, '
f'paths: {self.paths}')
f'paths: {self.paths}, '
f'model_batch_size: {self.model_batch_size}')
@staticmethod
cdef from_msgpack(bytes data):
unpacked = unpackb(data, strict_map_key=False)
return AIRecognitionConfig(
unpacked.get("FramePeriodRecognition", 0),
unpacked.get("FrameRecognitionSeconds", 0.0),
unpacked.get("ProbabilityThreshold", 0.0),
unpacked.get("f_pr", 0),
unpacked.get("f_rs", 0.0),
unpacked.get("pt", 0.0),
unpacked.get("TrackingDistanceConfidence", 0.0),
unpacked.get("TrackingProbabilityIncrease", 0.0),
unpacked.get("TrackingIntersectionThreshold", 0.0),
unpacked.get("t_dc", 0.0),
unpacked.get("t_pi", 0.0),
unpacked.get("t_it", 0.0),
unpacked.get("Data", b''),
unpacked.get("Paths", []),
unpacked.get("d", b''),
unpacked.get("p", []),
unpacked.get("m_bs")
)