mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:16:30 +00:00
refactor external clients
put model batch size as parameter in config
This commit is contained in:
@@ -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")
|
||||
)
|
||||
Reference in New Issue
Block a user