Open deepxiaobai opened 2 years ago
这边可以加个判断,如果t2-t1>0才走这一步。按道理,时间差不应该为0.
这边可以加个判断,如果t2-t1>0才走这一步。按道理,时间差不应该为0.
按照这种方式规避,发现结果视频中帧率波动非常大
建议排查下各个模块的耗时,从您提供的日志信息来看,耗时瓶颈不在模型推理。另外,出现模型推理时间差为0的情况,是不是此时的图像帧有问题?
我在计算更新帧率之前添加了以下代码: if t2 - t1 == 0: cv2.imshow('test', img_ori) cv2.waitKey(0) fps_calculator.update(1.0 / (t2 - t1)) avg_fps = fps_calculator.accumulate()
当时间差为0时,显示如下:
Before Asking
[X] I have read the README carefully. 我已经仔细阅读了README上的操作指引。
[ ] I want to train my custom dataset, and I have read the tutorials for training your custom data carefully and organize my dataset correctly; (FYI: We recommand you to apply the config files of xx_finetune.py.) 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。(FYI: 我们推荐使用xx_finetune.py等配置文件训练自定义数据集。)
[X] I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。
Search before asking
Question
(yolov6) D:\work\YOLOv6-main>python tools/infer.py --weights yolov6s.pt --source test.mp4 Namespace(agnostic_nms=False, classes=None, conf_thres=0.4, device='0', half=False, hide_conf=False, hide_labels=False, img_size=[640, 640], iou_thres=0.45, max_det=1000, name='exp', project='runs/inference', save_dir=None, save_img=True, save_txt=False, source='te st.mp4', view_img=False, weights='yolov6s.pt', yaml='data/coco.yaml') Save directory already existed Loading checkpoint from yolov6s.pt
Fusing model... Switch model to deploy modality. D:\soft\anaconda3\envs\yolov6\lib\site-packages\torch\functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\TensorSh ape.cpp:2228.) return _VF.meshgrid(tensors, kwargs) # type: ignore[attr-defined] 0%| | 0/1 [00:00<?, ?it/s]t 1: 1667541017.5683622 t2 1667541017.584088 t1: 1667541017.5918918 t2 1667541017.5918918 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 25.55it/s] Traceback (most recent call last): File "tools/infer.py", line 116, in
main(args)
File "tools/infer.py", line 111, in main
run( vars(args))
File "D:\soft\anaconda3\envs\yolov6\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "tools/infer.py", line 104, in run
inferer.infer(conf_thres, iou_thres, classes, agnostic_nms, max_det, save_dir, save_txt, save_img, hide_labels, hide_conf, view_img)
File "D:\work\YOLOv6-main\yolov6\core\inferer.py", line 115, in infer
fps_calculator.update(1.0 / (t2 - t1))
ZeroDivisionError: float division by zero
Additional
No response