未验证 提交 95e07d18 编写于 作者: XYZ_916's avatar XYZ_916 提交者: GitHub

Develop: get fight recognition model from model dir (#6324)

* Update action.md

delete the step of change model name of fight recognition

* Update video_action_infer.py

get model path from model_dir without model name

* optimize action vis
上级 fe9e983d
......@@ -184,9 +184,8 @@ VIDEO_ACTION: # 基于视频分类的行为识别模型配置
### 使用方法
1. 从上表链接中下载预测部署模型并解压到`./output_inference`路径下;
2. 修改解压后`ppTSM`文件夹中的文件名称为`model.pdiparams、model.pdiparams.info和model.pdmodel`
3. 修改配置文件`deploy/pipeline/config/infer_cfg_pphuman.yml``VIDEO_ACTION`下的`enable``True`
4. 输入视频,启动命令如下:
2. 修改配置文件`deploy/pphuman/config/infer_cfg_pphuman.yml``VIDEO_ACTION`下的`enable``True`
3. 输入视频,启动命令如下:
```
python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_pphuman.yml \
--video_file=test_video.mp4 \
......
......@@ -919,9 +919,12 @@ class PipePredictor(object):
video_action_score = None
if video_action_res and video_action_res["class"] == 1:
video_action_score = video_action_res["score"]
mot_boxes = None
if mot_res:
mot_boxes = mot_res['boxes']
image = visualize_action(
image,
mot_res['boxes'],
mot_boxes,
action_visual_collector=None,
action_text="SkeletonAction",
video_action_score=video_action_score,
......
......@@ -96,8 +96,8 @@ class VideoActionRecognizer(object):
self.recognize_times = Timer()
model_file_path = os.path.join(model_dir, "ppTSM.pdmodel")
params_file_path = os.path.join(model_dir, "ppTSM.pdiparams")
model_file_path = glob.glob(os.path.join(model_dir, "*.pdmodel"))[0]
params_file_path = glob.glob(os.path.join(model_dir, "*.pdiparams"))[0]
self.config = Config(model_file_path, params_file_path)
if device == "GPU" or device == "gpu":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册