PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.81k stars 2.89k forks source link

NVJetson-AGX部署摄像头预测出现错误 #4373

Closed song121982 closed 2 years ago

song121982 commented 3 years ago

PaddleDetection team appreciate any suggestion or problem you delivered~

描述问题/Describe the bug

按照GitHub paddledetection官方文档,依次完成训练、模型导出、部署到jetson 图片和视频都能正常预测,调用摄像头报错

复现/Reproduction

  1. 您使用的命令是?
python deploy/python/infer.py --model_dir=./output_inference/yolov3_mobilenet_v1_rsod --camera_id=0
  1. 您是否更改过代码或配置文件?您是否理解您所更改的内容?还请您提供所更改的部分代码。/Did you make any modifications on the code or config? Did you understand what you have modified? Please provide the codes that you modified. 更改过,不过是根据官方文档更改的训练部分,使用的自己的数据集

  2. 您使用的数据集是?/What dataset did you use? 自己分割的rsod数据集,VOC格式

  3. 请提供您出现的报错信息及相关log。/Please provide the error messages or relevant log information. 9638d45721aafb314cfa064a5392b03

环境/Environment

  1. 请提供您使用的Paddle和PaddleDetection的版本号/Please provide the version of Paddle and PaddleDetection you use: release2.2
  2. 如您在使用PaddleDetection的同时还在使用其他产品,如PaddleServing、PaddleInference等,请您提供其版本号/ Please provide the version of any other related tools/products used, such as the version of PaddleServing and etc: 使用paddleinference
  3. 请提供您使用的操作系统信息,如Linux/Windows/MacOS /Please provide the OS information, e.g., Linux: L4T JETSON agx
  4. 请问您使用的Python版本是?/ Please provide the version of Python you used. 3.6.9
  5. 请问您使用的CUDA/cuDNN的版本号是?/ Please provide the version of CUDA/cuDNN you used. jetpack4.4 cuda10.2 cudnn8

如果您的issue是关于安装或环境,您可以先查询安装文档尝试解决~

If your issue looks like an installation issue / environment issue, please first try to solve it yourself with the instructions in https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/docs/tutorials/INSTALL.md

yghstill commented 3 years ago

@song121982 单张图片预测有问题吗?

song121982 commented 3 years ago

@yghstill 单张图片和视频都没问题。下面是预测视频时的显示,可以正常输出output。 video(1)

yghstill commented 3 years ago

@song121982 看着像是摄像头没链接成功,确认下摄像头有没有链接成功吧,可以写个python脚本读摄像头并可视化能不能成功。

song121982 commented 3 years ago

@yghstill 好的 ,我今天晚上再试试,请问无论是csi摄像头、usb摄像头还是网口摄像头,--camera_id 指令都可以调用吗?

song121982 commented 3 years ago

@yghstill 找到原因了,首先按照您说的执行了简单的OpenCV测试程序,imshow读取摄像头,发现用CSI摄像头报错如下: camera

然后把CSI摄像头拔掉插上USB的摄像头可以用。

同样想起来之前用inference摄像头预测的时候CSI摄像头一直插着,今天拔掉,只插USB摄像头的时候就可以正常预测了。

这才想起来CSI与V4L2是有区别的。 最后想问下,对于其他接口的摄像头inference不能直接支持,得自己改代码是吗?

yghstill commented 3 years ago

@song121982 关于摄像头,改下代码可以读取到视频就行,您先手动改下,现在deploy支持的摄像头是比较简单的场景,我们之后会适配更多接口,感谢反馈。

paddle-bot-old[bot] commented 2 years ago

Since this issue has not been updated for more than three months, it will be closed, if it is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于该问题超过三个月未更新,将会被关闭,若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。