GeekAlexis / FastMOT

High-performance multiple object tracking based on YOLO, Deep SORT, and KLT 🚀
MIT License
1.12k stars 256 forks source link

A decline in performance when I use FasMot #240

Closed arielkantorovich closed 2 years ago

arielkantorovich commented 2 years ago

Hello everyone, When I run Yolov4Tiny that I train I get this result video: Pickup_Yolov4Tiny.mp4 attached, you can see the result on the video. When I combine my detector with the same Yolov4Tiny and FastMOT my detector performance decrease and I don't understand why? {video: Pickup_FastMOT.mp4 } Maybe the settings I entered are incorrect. Please someone can help me. Addition: class_number=6

`{
"resize_to": [640, 640],

"stream_cfg": {
    "resolution": [704, 576],
    "frame_rate": 30,
    "buffer_size": 10
},

"mot_cfg": {
    "detector_type": "YOLO",
    "detector_frame_skip": 6,
    "class_ids": [0,1,2,3,4,5],

    "ssd_detector_cfg": {
        "model": "SSDInceptionV2",
        "tile_overlap": 0.25,
        "tiling_grid": [4, 2],
        "conf_thresh": 0.5,
        "merge_thresh": 0.6,
        "max_area": 120000
    },
    "yolo_detector_cfg": {
        "model": "YOLOv4Tiny",
        "conf_thresh": 0.25,
        "nms_thresh": 0.5,
        "max_area": 800000,
        "min_aspect_ratio": 1.2
    },
    "public_detector_cfg": {
        "sequence_path": "MOT20/train/MOT20-01",
        "conf_thresh": 0.5,
        "max_area": 800000
    },

    "feature_extractor_cfgs": [
        {
            "model": "OSNet025",
            "batch_size": 16
        },
        {
            "model": "OSNet025",
            "batch_size": 16
        },
        {
            "model": "OSNet025",
            "batch_size": 16
        },
        {
            "model": "OSNet025",
            "batch_size": 16
        },
        {
            "model": "OSNet025",
            "batch_size": 16
        },
        {
            "model": "OSNet025",
            "batch_size": 16
        }
    ],

    "tracker_cfg": {
        "max_age": 6,
        "age_penalty": 2,
        "motion_weight": 0.5,
        "max_assoc_cost": 0.5,
        "max_reid_cost": 0.6,
        "iou_thresh": 0.4,
        "duplicate_thresh": 0.8,
        "occlusion_thresh": 0.7,
        "conf_thresh": 0.5,
        "confirm_hits": 1,
        "history_size": 50,

        "kalman_filter_cfg": {
            "std_factor_acc": 2.25,
            "std_offset_acc": 78.5,
            "std_factor_det": [0.08, 0.08],
            "std_factor_klt": [0.14, 0.14],
            "min_std_det": [4.0, 4.0],
            "min_std_klt": [5.0, 5.0],
            "init_pos_weight": 5,
            "init_vel_weight": 12,
            "vel_coupling": 0.6,
            "vel_half_life": 2
        },

        "flow_cfg": {
            "bg_feat_scale_factor": [0.1, 0.1],
            "opt_flow_scale_factor": [0.5, 0.5],
            "feat_density": 0.005,
            "feat_dist_factor": 0.06,
            "ransac_max_iter": 500,
            "ransac_conf": 0.99,
            "max_error": 100,
            "inlier_thresh": 4,
            "bg_feat_thresh": 10,
            "obj_feat_params": {
                "maxCorners": 1000,
                "qualityLevel": 0.06,
                "blockSize": 3
            },
            "opt_flow_params": {
                "winSize": [5, 5],
                "maxLevel": 5,
                "criteria": [3, 10, 0.03]
            }
        }
    },

    "visualizer_cfg": {
        "draw_detections": false,
        "draw_confidence": false,
        "draw_covariance": false,
        "draw_klt": false,
        "draw_obj_flow": false,
        "draw_bg_flow": false,
        "draw_trajectory": false

    }
}

} `

https://user-images.githubusercontent.com/56262208/149121337-057bad08-52a0-4807-9a24-94901a4807b4.mp4

https://user-images.githubusercontent.com/56262208/149121351-81ff9f4b-1fe8-48aa-b8ca-b5ff6b9c1b3c.mp4

GeekAlexis commented 2 years ago

You need to change min_aspect_ratio. https://github.com/GeekAlexis/FastMOT/blob/a185b78b771546151d42e02397f6940e4ee47bd8/fastmot/detector.py#L246-L248

arielkantorovich commented 2 years ago

Thank you for your help it works better now. When I change the aspect ratio only in detector.py nothing changed but when I change the aspect ratio in mot.json everything worked out.