feat: correct mock

This commit is contained in:
ziesorx 2025-09-23 21:41:03 +07:00
parent d3d9c426f8
commit 7a38933bb0

View file

@ -323,21 +323,21 @@ class TrackingPipelineIntegration:
"licensePlateConfidence": None
}
# Get model info
model_id = 1 # Default model ID as integer
if self.tracking_model_id:
# Try to extract numeric ID from model string
try:
model_id = int(self.tracking_model_id.split('_')[-1].replace('v', ''))
except:
model_id = 1
# Get model info from tracking configuration in pipeline.json
# Use 52 (from models/52/bangchak_poc2) as modelId
# Use tracking modelId as modelName
tracking_model_id = 52
tracking_model_name = "front_rear_detection_v1" # Default
if self.pipeline_parser and self.pipeline_parser.tracking_config:
tracking_model_name = self.pipeline_parser.tracking_config.model_id
# Create proper Pydantic message using the helper function
detection_message = create_image_detection(
subscription_identifier=subscription_id,
detection_data=detection_data,
model_id=model_id,
model_name="Vehicle Tracking Detection"
model_id=tracking_model_id,
model_name=tracking_model_name
)
# Send to backend via WebSocket if sender is available