我试图用yolov5模型对Docker容器中Nvidia Jetson Nano的网络摄像头流进行推断。在我的Windows PC和Jetson上,我都得到了错误:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.10/site-packages/cv2/qt/plugins"
even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
Aborted
Dockerfile看起来像这样:
FROM python:latest
WORKDIR /yolov5_aiss
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY ./app ./app
RUN apt-get update -y
RUN apt-get install -y ffmpeg libsm6 libxext6 -y
RUN apt install -y libxkbcommon-x11-0
CMD ["python", "./app/detect.py", "--weights","./app/weights/best.pt", "--source", "0"]
1条答案
按热度按时间kqlmhetl1#
这就是解决办法。
无头模式不能使用
detect.py
的--view-img
标志