From ab5e750d1ead2b49a6f6047d896683034046bbc1 Mon Sep 17 00:00:00 2001 From: Feng Ni Date: Tue, 17 Aug 2021 14:14:38 +0800 Subject: [PATCH] [MOT] fix doc gpu nums and ffmpeg (#3995) --- configs/mot/README.md | 7 ++++--- configs/mot/README_cn.md | 7 ++++--- configs/mot/headtracking21/README_cn.md | 6 +++--- configs/mot/kitticars/README_cn.md | 6 +++--- ppdet/data/source/mot.py | 7 ++----- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/configs/mot/README.md b/configs/mot/README.md index 86b7b022c..db742814e 100644 --- a/configs/mot/README.md +++ b/configs/mot/README.md @@ -42,6 +42,7 @@ pip install -r requirements.txt **Notes:** - Install `cython_bbox` for Windows: `pip install -e git+https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox`. You can refer to this [tutorial](https://stackoverflow.com/questions/60349980/is-there-a-way-to-install-cython-bbox-for-windows). - Evaluation on Windows CUDA 11 environment may not be normally. It will be repaired as soon as possible. You can change to CUDA 10.2 or CUDA 10.1 environment for normal evaluation. +- Please make sure that [ffmpeg](https://ffmpeg.org/ffmpeg.html) is installed first, on Linux(Ubuntu) platform you can directly install it by the following command:`apt-get update && apt-get install -y ffmpeg`. ## Model Zoo @@ -129,7 +130,7 @@ If you use a stronger detection model, you can get better results. Each txt is t | DLA-34 | 1088x608 | 74.8 | 74.4 | 930 | 7038 | 37994 | - | [model](https://paddledet.bj.bcebos.com/models/mot/fairmot_dla34_30e_1088x608.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml) | **Notes:** - FairMOT used 8 GPUs for training and mini-batch size as 6 on each GPU, and trained for 30 epoches. + FairMOT used 2 GPUs for training and mini-batch size as 6 on each GPU, and trained for 30 epoches. ## Feature Tracking Model @@ -229,10 +230,10 @@ dataset/mot ### 1. Training -Training FairMOT on 8 GPUs with following command +Training FairMOT on 2 GPUs with following command ```bash -python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608/ --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml +python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608/ --gpus 0,1 tools/train.py -c configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml ``` ### 2. Evaluation diff --git a/configs/mot/README_cn.md b/configs/mot/README_cn.md index 34e7ba592..742742171 100644 --- a/configs/mot/README_cn.md +++ b/configs/mot/README_cn.md @@ -42,6 +42,7 @@ pip install -r requirements.txt **注意:** - `cython_bbox`在windows上安装:`pip install -e git+https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox`。可参考这个[教程](https://stackoverflow.com/questions/60349980/is-there-a-way-to-install-cython-bbox-for-windows)。 - Windows cuda 11环境下可能无法正常评估,会尽快修复,可换到cuda 10.2或cuda 10.1环境下进行正常评估。 +- 预测需确保已安装[ffmpeg](https://ffmpeg.org/ffmpeg.html), Linux(Ubuntu)平台可以直接用以下命令安装:`apt-get update && apt-get install -y ffmpeg`。 ## 模型库 @@ -129,7 +130,7 @@ wget https://dataset.bj.bcebos.com/mot/det_results_dir.zip | DLA-34 | 1088x608 | 74.8 | 74.4 | 930 | 7038 | 37994 | - |[下载链接](https://paddledet.bj.bcebos.com/models/mot/fairmot_dla34_30e_1088x608.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml) | **注意:** - FairMOT使用8个GPU进行训练,每个GPU上batch size为6,训练30个epoch。 + FairMOT使用2个GPU进行训练,每个GPU上batch size为6,训练30个epoch。 ## 特色垂类跟踪模型 @@ -227,10 +228,10 @@ dataset/mot ### 1. 训练 -FairMOT使用8GPU通过如下命令一键式启动训练 +FairMOT使用2个GPU通过如下命令一键式启动训练 ```bash -python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608/ --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml +python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608/ --gpus 0,1 tools/train.py -c configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml ``` ### 2. 评估 diff --git a/configs/mot/headtracking21/README_cn.md b/configs/mot/headtracking21/README_cn.md index a0b8f2ce3..01a33446a 100644 --- a/configs/mot/headtracking21/README_cn.md +++ b/configs/mot/headtracking21/README_cn.md @@ -21,14 +21,14 @@ | DLA-34 | 1088x608 | 58.2 | 61.3 | 13166 | 141872 | 197074 | - | [下载链接](https://paddledet.bj.bcebos.com/models/mot/fairmot_dla34_30e_1088x608_headtracking21.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/mot/headtracking21/fairmot_dla34_30e_1088x608_headtracking21.yml) | **注意:** - FairMOT使用8个GPU进行训练,每个GPU上batch size为6,训练30个epoch。 + FairMOT使用2个GPU进行训练,每个GPU上batch size为6,训练30个epoch。 ## 快速开始 ### 1. 训练 -使用8GPU通过如下命令一键式启动训练 +使用2个GPU通过如下命令一键式启动训练 ```bash -python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608_headtracking21/ --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/mot/headtracking21/fairmot_dla34_30e_1088x608_headtracking21.yml +python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608_headtracking21/ --gpus 0,1 tools/train.py -c configs/mot/headtracking21/fairmot_dla34_30e_1088x608_headtracking21.yml ``` ### 2. 评估 diff --git a/configs/mot/kitticars/README_cn.md b/configs/mot/kitticars/README_cn.md index 50cb3719b..25fc44bef 100644 --- a/configs/mot/kitticars/README_cn.md +++ b/configs/mot/kitticars/README_cn.md @@ -18,14 +18,14 @@ | DLA-34 | 1088x608 | 67.9 | - |[下载链接](https://paddledet.bj.bcebos.com/models/mot/fairmot_dla34_30e_1088x608_kitticars.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/mot/kitticars/fairmot_dla34_30e_1088x608_kitticars.yml) | **注意:** - FairMOT使用8个GPU进行训练,每个GPU上batch size为6,训练30个epoch。 + FairMOT使用2个GPU进行训练,每个GPU上batch size为6,训练30个epoch。 ## 快速开始 ### 1. 训练 -使用8GPU通过如下命令一键式启动训练 +使用2个GPU通过如下命令一键式启动训练 ```bash -python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608_kitticars/ --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/mot/kitticars/fairmot_dla34_30e_1088x608_kitticars.yml +python -m paddle.distributed.launch --log_dir=./fairmot_dla34_30e_1088x608_kitticars/ --gpus 0,1 tools/train.py -c configs/mot/kitticars/fairmot_dla34_30e_1088x608_kitticars.yml ``` ### 2. 评估 diff --git a/ppdet/data/source/mot.py b/ppdet/data/source/mot.py index d163d4ea0..2322165d8 100644 --- a/ppdet/data/source/mot.py +++ b/ppdet/data/source/mot.py @@ -376,11 +376,8 @@ def video2frames(video_path, outpath, frame_rate, **kargs): ] cmd = ''.join(cmd) + _dict2str(kargs) - try: - os.system(cmd) - except: - raise RuntimeError('ffmpeg process video: {} error'.format(vid_name)) - sys.stdout.flush() + if os.system(cmd) != 0: + raise RuntimeError('ffmpeg process video: {} error'.format(video_path)) sys.exit(-1) sys.stdout.flush() -- GitLab