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