feat: custom bot-sort based tracker

This commit is contained in:
ziesorx 2025-09-26 14:22:38 +07:00
parent bd201acac1
commit 791f611f7d
8 changed files with 649 additions and 282 deletions

9
app.py
View file

@ -158,21 +158,18 @@ async def get_camera_image(camera_id: str):
# Get frame from the shared cache buffer
from core.streaming.buffers import shared_cache_buffer
# Debug: Log available cameras in buffer
# Only show buffer debug info if camera not found (to reduce log spam)
available_cameras = shared_cache_buffer.frame_buffer.get_camera_list()
logger.debug(f"Available cameras in buffer: {available_cameras}")
logger.debug(f"Looking for camera: '{actual_camera_id}'")
frame = shared_cache_buffer.get_frame(actual_camera_id)
if frame is None:
logger.warning(f"No cached frame available for camera '{actual_camera_id}' (from subscription '{camera_id}')")
logger.warning(f"Available cameras in buffer: {available_cameras}")
logger.warning(f"\033[93m[API] No frame for '{actual_camera_id}' - Available: {available_cameras}\033[0m")
raise HTTPException(
status_code=404,
detail=f"No frame available for camera {actual_camera_id}"
)
logger.debug(f"Retrieved cached frame for camera '{actual_camera_id}' (from subscription '{camera_id}'), shape: {frame.shape}")
# Successful frame retrieval - log only occasionally to avoid spam
# Encode frame as JPEG
success, buffer_img = cv2.imencode('.jpg', frame, [cv2.IMWRITE_JPEG_QUALITY, 85])