Zhongdao / Towards-Realtime-MOT

Joint Detection and Embedding for fast multi-object tracking
MIT License
2.38k stars 539 forks source link

实测感觉有点慢 #153

Open hushunda opened 4 years ago

hushunda commented 4 years ago

在rtx2080ti上,测试JDE-576x320模型,使用的是摄像头读取的图像,但是速度只有8fps. 还有什么可以加速的吗?

`def track(opt):

cfg_dict = parse_model_cfg(opt.cfg)
opt.img_size = [int(cfg_dict[0]['width']), int(cfg_dict[0]['height'])]

# run tracking
timer = Timer()
accs = []
n_frame = 0
tracker = JDETracker(opt, frame_rate=30)
cap= cv2.VideoCapture(3)
cap.set(3,1920)
cap.set(4,1080)
# 目标尺度处理
vw,vh = [int(cfg_dict[0]['width']), int(cfg_dict[0]['height'])]
wa, ha = float(cap.get(3)) / vw, float(cap.get(4)) / vh
a=min(wa,ha)
w,h=int(vw * a), int(vh * a)
cv2.namedWindow('show',0)
while 1:
    timer.tic()
    ret,img0 = cap.read()
    if ret:
        img = cv2.resize(img0, (w, h))
        img, _, _, _ = letterbox(img, height=vh, width=vw)
        # Normalize RGB
        img = img[:, :, ::-1].transpose(2, 0, 1)
        img = np.ascontiguousarray(img, dtype=np.float32)
        img /= 255.0
        blob = torch.from_numpy(img).cuda().unsqueeze(0)
        online_targets = tracker.update(blob, img0)
        if len(online_targets)>0:
            print('ok')
        print(len(online_targets))
        online_tlwhs = []
        online_ids = []
        for t in online_targets:
            tlwh = t.tlwh
            tid = t.track_id
            vertical = tlwh[2] / tlwh[3] > 1.6
            if tlwh[2] * tlwh[3] > opt.min_box_area and not vertical:
                online_tlwhs.append(tlwh)
                online_ids.append(tid)
        timer.toc()
        online_im = vis.plot_tracking(img0, online_tlwhs, online_ids, frame_id=1,
                                          fps=1. / timer.average_time)
        cv2.imshow('show', online_im)
        cv2.waitKey(1)`
jwnirvana commented 4 years ago

请问对于精度,你跑出了论文结果吗

PetitBai commented 4 years ago

我是在 Colab 上用 K80测试的,用的 JDE-1088x608 模型,demo.py 直接跑, 输入 720 p 视频文件 , 也是 8fps 左右

nimochuanzhang commented 3 years ago

我是在 Colab 上用 K80测试的,用的 JDE-1088x608 模型,demo.py 直接跑, 输入 720 p 视频文件 , 也是 8fps 左右

我也是8fps左右,请问作者给的结果是22FPS,为啥测的是8FPS,是机器不一样吗,如果要对比FPS的话,那么应该如何对比呢。