mmaction2 icon indicating copy to clipboard operation
mmaction2 copied to clipboard

[Bug] demo_skeleton.py error

Open Ishihara-Masabumi opened this issue 1 year ago • 2 comments

Branch

main branch (1.x version, such as v1.0.0, or dev-1.x branch)

Prerequisite

Environment

pytorch 2.0.1 python 3.8.17

Describe the bug

At the line 108, "visualizer.add_datasample(", the following error occurred. TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Reproduces the problem - code sample

No response

Reproduces the problem - command or script

No response

Reproduces the problem - error message

(openmmlab) dl@dl-machine:~/mmaction2/mmaction2$ python ./demo/demo_skeleton.py ./demo/demo_skeleton.mp4 ./out02.mp4 Loads checkpoint by http backend from path: http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth Performing Human Detection for each frame [ ] 0/72, elapsed: 0s, ETA:08/01 09:47:23 - mmengine - WARNING - "FileClient" will be deprecated in future. Please use io functions in https://mmengine.readthedocs.io/en/latest/api/fileio.html#file-io 08/01 09:47:23 - mmengine - WARNING - "HardDiskBackend" is the alias of "LocalBackend" and the former will be deprecated in future. [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 72/72, 16.9 task/s, elapsed: 4s, ETA: 0s Loads checkpoint by http backend from path: https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth Performing Human Pose Estimation for each frame [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 72/72, 16.3 task/s, elapsed: 4s, ETA: 0s Loads checkpoint by http backend from path: https://download.openmmlab.com/mmaction/skeleton/posec3d/slowonly_r50_u48_240e_ntu60_xsub_keypoint/slowonly_r50_u48_240e_ntu60_xsub_keypoint-f3adabf1.pth Drawing skeleton for each frame [ ] 0/72, elapsed: 0s, ETA:Traceback (most recent call last): File "./demo/demo_skeleton.py", line 189, in main() File "./demo/demo_skeleton.py", line 183, in main visualize(args, frames, pose_data_samples, action_label) File "./demo/demo_skeleton.py", line 108, in visualize visualizer.add_datasample( File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/dist/utils.py", line 401, in wrapper return func(*args, **kwargs) File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmpose/visualization/local_visualizer.py", line 581, in add_datasample self.add_image(name, drawn_img, step) File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/dist/utils.py", line 401, in wrapper return func(*args, **kwargs) File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/visualization/visualizer.py", line 1082, in add_image vis_backend.add_image(name, image, step) # type: ignore File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/visualization/vis_backend.py", line 56, in wrapper obj._init_env() # type: ignore File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/visualization/vis_backend.py", line 212, in _init_env if not os.path.exists(self._save_dir): File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/genericpath.py", line 19, in exists os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Additional information

No response

Ishihara-Masabumi avatar Aug 01 '23 00:08 Ishihara-Masabumi

It seems that some frames of your video don't have any detection results. Currently, the demo can't handle an empty detection result, you could try to fix it.

cir7 avatar Aug 10 '23 03:08 cir7

I will fix it this weekend, please hold on.

Dai-Wenxun avatar Aug 11 '23 11:08 Dai-Wenxun