无法加载Qt平台插件(在对接应用程序时)

2024-09-27 21:26:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用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.

请建议我如何解决这个问题


Tags: thedocker模型应用程序视频applicationpluginsqt
1条回答
网友
1楼 · 发布于 2024-09-27 21:26:28

要显示Docker容器内部的图像,应按如下方式运行:

docker run -it \
   -e DISPLAY=$DISPLAY \                # < - here
   -v /tmp/.X11-unix:/tmp/.X11-unix \   # < - Here
# everyting else

确保cv2正确安装在docker映像中后,您可能希望运行

xhost +local:root

在主机上(假设是本地实验)

相关问题 更多 >

    热门问题