use*_*713 6 python qt opencv face-recognition docker
我使用 opencv 和迁移学习模型(resnetSSD)构建了一个人脸检测应用程序。应用程序的输出:视频将打开,模型将能够识别面孔。
应用程序在我的本地系统中完美运行..也能够构建docker,但是当运行docker容器时出现以下错误:
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.6/dist-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.
Run Code Online (Sandbox Code Playgroud)
请建议我如何解决这个问题?
要显示 Docker 容器内部的图像,您应该像下面这样运行它:
docker run -it \
-e DISPLAY=$DISPLAY \ # <--- here
-v /tmp/.X11-unix:/tmp/.X11-unix \ # <--- Here
# everyting else
Run Code Online (Sandbox Code Playgroud)
确保cv2正确安装在 docker 镜像中后,您可能希望运行
xhost +local:root
Run Code Online (Sandbox Code Playgroud)
在主机上(假设它是本地实验)。