Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo的video无法跑出结果 #64

Closed
EmberaThomas opened this issue Jul 22, 2021 · 17 comments
Closed

demo的video无法跑出结果 #64

EmberaThomas opened this issue Jul 22, 2021 · 17 comments

Comments

@EmberaThomas
Copy link

EmberaThomas commented Jul 22, 2021

image有保存的dog结果
但是video的结果为空白

~/dev/YOLOX$ python3 tools/demo.py video -n yolox-s -c pretrained_models/yolox_s.pth.tar --path /assets/ch14_0616-0625.mp4 --conf 0.3 --nms 0.65 --tsize 640 --save_result
2021-07-22 14:34:23 | INFO | main:219 - Args: Namespace(camid=0, ckpt='pretrained_models/yolox_s.pth.tar', conf=0.3, demo='video', exp_file=None, experiment_name='yolox_s', fp16=False, fuse=False, name='yolox-s', nms=0.65, path='/assets/ch14_0616-0625.mp4', save_result=True, trt=False, tsize=640)
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
2021-07-22 14:34:23 | INFO | main:229 - Model Summary: Params: 8.97M, Gflops: 26.81
2021-07-22 14:34:28 | INFO | main:240 - loading checkpoint
2021-07-22 14:34:29 | INFO | main:245 - loaded checkpoint done.
2021-07-22 14:34:29 | INFO | main:183 - video save_path is ./YOLOX_outputs/yolox_s/vis_res/2021_07_22_14_34_29/ch14_0616-0625.mp4
但是检查该目录下 并没有mp4文件。

@HHaa-gif
Copy link

Don't use yolox_ s. Pth.tar, author's yolox.py didn't have get it_ Model () method,So the weight file cannot be loaded

@EmberaThomas
Copy link
Author

Don't use yolox_ s. Pth.tar, author's yolox.py didn't have get it_ Model () method,So the weight file cannot be loaded

But I can run image successfully?

@flydragon2018
Copy link

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558102961000] moov atom not found
VIDIOC_REQBUFS: Inappropriate ioctl for device

@flydragon2018
Copy link

it seems complain about video file format??

@EmberaThomas
Copy link
Author

似乎抱怨视频文件格式?

估计是,那应该用什么视频格式呢

@flydragon2018
Copy link

flydragon2018 commented Jul 22, 2021

source code using either real time camera or video file.
I looked up the error message that it is meta info about video file.

@flydragon2018
Copy link

I tried another mp4 file, it works. so It is about video file compatibility.

@EmberaThomas
Copy link
Author

我尝试了另一个 mp4 文件,它有效。所以这是关于视频文件的兼容性。

I tried another mp4 file, it works. so It is about video file compatibility.

I use MP4 format about 280M. Because it's too big?Or could u show your operation?

@flydragon2018
Copy link

no. similar to image file, there is meta info about whole video file. some have, some don't.
I downloaded another mp4 file, it works. same operation.

@flydragon2018
Copy link

!python tools/demo.py video -n yolox-x -c /content/YOLOX/yolox_x.pth.tar --path /content/YOLOX/airport.mp4 --conf 0.3 --nms 0.65 --tsize 640 --save_result


2021-07-22 07:51:38 | INFO | main:219 - Args: Namespace(camid=0, ckpt='/content/YOLOX/yolox_x.pth.tar', conf=0.3, demo='video', exp_file=None, experiment_name='yolox_x', fp16=False, fuse=False, name='yolox-x', nms=0.65, path='/content/YOLOX/airport.mp4', save_result=True, trt=False, tsize=640)
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
2021-07-22 07:51:39 | INFO | main:229 - Model Summary: Params: 99.07M, Gflops: 281.93
2021-07-22 07:51:43 | INFO | main:240 - loading checkpoint
2021-07-22 07:51:44 | INFO | main:245 - loaded checkpoint done.
2021-07-22 07:51:44 | INFO | main:183 - video save_path is ./YOLOX_outputs/yolox_x/vis_res/2021_07_22_07_51_44/airport.mp4
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 1.9449s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0612s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0587s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0586s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0597s

@EmberaThomas
Copy link
Author

!python tools/demo.py video -n yolox-x -c /content/YOLOX/yolox_x.pth.tar --path /content/YOLOX/airport.mp4 --conf 0.3 --nms 0.65 --tsize 640 --save_result

2021-07-22 07:51:38 | INFO | main:219 - Args: Namespace(camid=0, ckpt='/content/YOLOX/yolox_x.pth.tar', conf=0.3, demo='video', exp_file=None, experiment_name='yolox_x', fp16=False, fuse=False, name='yolox-x', nms=0.65, path='/content/YOLOX/airport.mp4', save_result=True, trt=False, tsize=640)
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
2021-07-22 07:51:39 | INFO | main:229 - Model Summary: Params: 99.07M, Gflops: 281.93
2021-07-22 07:51:43 | INFO | main:240 - loading checkpoint
2021-07-22 07:51:44 | INFO | main:245 - loaded checkpoint done.
2021-07-22 07:51:44 | INFO | main:183 - video save_path is ./YOLOX_outputs/yolox_x/vis_res/2021_07_22_07_51_44/airport.mp4
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 1.9449s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0612s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0587s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0586s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.05
I use YOLOX-s. Is it some problem with model?

@EmberaThomas
Copy link
Author

!python tools/demo.py video -n yolox-x -c /content/YOLOX/yolox_x.pth.tar --path /content/YOLOX/airport.mp4 --conf 0.3 --nms 0.65 --tsize 640 --save_result

2021-07-22 07:51:38 | INFO | main:219 - Args: Namespace(camid=0, ckpt='/content/YOLOX/yolox_x.pth.tar', conf=0.3, demo='video', exp_file=None, experiment_name='yolox_x', fp16=False, fuse=False, name='yolox-x', nms=0.65, path='/content/YOLOX/airport.mp4', save_result=True, trt=False, tsize=640)
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
2021-07-22 07:51:39 | INFO | main:229 - Model Summary: Params: 99.07M, Gflops: 281.93
2021-07-22 07:51:43 | INFO | main:240 - loading checkpoint
2021-07-22 07:51:44 | INFO | main:245 - loaded checkpoint done.
2021-07-22 07:51:44 | INFO | main:183 - video save_path is ./YOLOX_outputs/yolox_x/vis_res/2021_07_22_07_51_44/airport.mp4
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 1.9449s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0612s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0587s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0586s
2021-07-22 07:51:46 | INFO | main:128 - Infer time: 0.0597s

I tried several mp4 videos. But it couldn't work. Could u send me your video to try?

@EmberaThomas
Copy link
Author

I don't know what happened. It works

@monoloxo
Copy link

我也是换了一个mp4后可以了。

@monoloxo
Copy link

我有两个摄像头,其中一个录的mp4都不行,另一个都行。。

@xifen523
Copy link

xifen523 commented Jan 6, 2022

这是什么问题呀 解决不了 我也遇到了

@xifen523
Copy link

xifen523 commented Jan 7, 2022

我写在这个博客里面了 可以查看
https://blog.csdn.net/qq_43190806/article/details/122362243

或者有一个答复
tools/demo.py中的第219行,有这样一句,
save_path = os.path.join(save_folder, args.path.split("/")[-1])
当args.path不是"/"分割的时候,就会出错误,导致源文件被覆盖。
应该改成这样:
save_path = os.path.join(save_folder, args.path[len(os.path.dirname(args.path))+1:])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants