# config.py
CAMERAS = [
    # {
    #     "cam_id": 0,
    #     "gst_str": (
    #             "v4l2src device=/dev/video0 ! "
    #             "image/jpeg, width=1280, height=720, framerate=30/1 ! "
    #             "jpegdec ! videoconvert ! appsink"
    #         ),
    #     # "gst_str": (
    #     #         "v4l2src device=/dev/video0 ! "
    #     #         "image/jpeg, width=1280, height=720, framerate=30/1 ! "
    #     #         "jpegparse ! jpegdec ! videoconvert ! appsink"
    #     #     ),
    #     # "gst_str": (
    #     #         "v4l2src device=/dev/video0 ! image/jpeg, width=1280, height=720, framerate=30/1 ! "
    #     #         "jpegparse ! jpegdec ! videoconvert ! video/x-raw, format=BGR ! appsink drop=true sync=false"
    #     #     ),
    #     "tcp_send_cls": ["井盖眼"],
    #     "remark": "机械臂摄像头",
    #     "save_annotated_images": True,
    #     "frame_interval": 5,
    #     "receive_capture_command": True
    # },
    # {
    #     "cam_id": 1,
    #     "gst_str": (
    #             "udpsrc address=230.1.1.1 port=1720 multicast-iface=eth0 ! "
    #             "application/x-rtp, media=video, encoding-name=H264 ! "
    #             "rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! "
    #             "video/x-raw,width=1280,height=720,format=BGR ! appsink drop=1"
    #         ),
    #     "tcp_send_cls": [],
    #     "remark": "机器狗前置摄像头",
    #     "save_annotated_images": True,
    #     "frame_interval": 5,
    # },
    {
        "cam_id": 0,
        "gst_str": 0,
        "tcp_send_cls": ["井盖眼"],
        "frame_interval": 5,
        "remark": "本地测试摄像头",
        "save_annotated_images": True,
        "receive_capture_command": True
    },
]

TCP_SERVER = {
    "host": "192.168.123.18",
    "port": 8888
}

HTTP_SERVER = {
    "url": "http://127.0.0.1:8000/test",
    "timeout": 5  # 超时重试
}

MODEL_CLASS = {
    0: '井盖', 
    1: '井盖塌陷', 
    2: '井盖眼', 
    3: '井盖破损', 
    4: '井盖移位', 
    5: '井盖缺失', 
    6: '人', 
    7: '压路机', 
    8: '反光衣', 
    9: '土堆', 
    10: '土方车', 
    11: '头', 
    12: '安全帽', 
    13: '挖掘机', 
    14: '推土机', 
    15: '施工路牌', 
    16: '水马', 
    17: '路锥', 
    18: '铁锹', 
    19: '防护栏', 
    20: '风镐'
}

MODEL = {
    "path": "weights/go-v8s-20250117.pt",
    "size": 640,
    "class_map": MODEL_CLASS,
    "batch_size": 1,
}