I am working on a classification problem now and trying to do everything online, without having to access my local machine. So I have added my data to drive and mounted my drive on Colab. Now I want to annotate my data and have decided to use the LabelImg annotator. I cloned the git to Colab and tried launching it like how the steps suggest I do. But I am hit with an error. Despite looking at other similar answers I could not solve the issue
Code to clone and launch:
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'] []
Error (along with compilation notes):
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.
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.