1

我现在正在研究一个分类问题,并尝试在网上做所有事情,而不必访问我的本地机器。因此,我已将数据添加到驱动器并将驱动器安装在 Colab 上。现在我想注释我的数据并决定使用LabelImg注释器。我将 git 克隆到 Colab 并尝试按照步骤建议的方式启动它。但是我遇到了一个错误。尽管查看了其他类似的答案,但我无法解决问题

克隆和启动的代码:

import os
os.chdir('/content')
!git clone 'https://github.com/tzutalin/labelImg.git'
os.chdir('/content/labelImg')
!sudo apt-get install pyqt5-dev-tools
!sudo pip3 install -r requirements/requirements-linux-python3.txt
!make qt5py3
!python3 labelImg.py
!python3 labelImg.py ['/content/labelImg'] []

错误(连同编译说明):

Reading package lists... Done
Building dependency tree       
Reading state information... Done
pyqt5-dev-tools is already the newest version (5.10.1+dfsg-1ubuntu2).
The following package was automatically installed and is no longer required:
  libnvidia-common-410
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Requirement already satisfied: pyqt5==5.10.1 in /usr/local/lib/python3.6/dist-packages (from -r requirements/requirements-linux-python3.txt (line 1)) (5.10.1)
Requirement already satisfied: lxml==4.2.4 in /usr/local/lib/python3.6/dist-packages (from -r requirements/requirements-linux-python3.txt (line 2)) (4.2.4)
Requirement already satisfied: sip<4.20,>=4.19.4 in /usr/local/lib/python3.6/dist-packages (from pyqt5==5.10.1->-r requirements/requirements-linux-python3.txt (line 1)) (4.19.8)
pyrcc5 -o libs/resources.py resources.qrc
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.
4

1 回答 1

2

From the error message, it's because LabelImg use QT.

QT is a GUI library that can run only on your local machine. You cannot run it in the cloud and then let it open a QT window on your machine.

You may need to find another labeling library that use web-interface instead.

于 2019-06-09T11:48:51.930 回答