Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

從零開始安裝 labelImg (Mac/Windows) #1

Open
kino-ngoo opened this issue Nov 7, 2018 · 0 comments
Open

從零開始安裝 labelImg (Mac/Windows) #1

kino-ngoo opened this issue Nov 7, 2018 · 0 comments

Comments

@kino-ngoo
Copy link
Owner

kino-ngoo commented Nov 7, 2018

labelImg

🔗 tzutalin/labelImg: LabelImg is a graphical image annotation tool and label object bounding boxes in images

LabelImg is a graphical image annotation tool.
It is written in Python and uses Qt for its graphical interface.
Annotations are saved as XML files in PASCAL VOC format, the format used by ImageNet.

TL; DR

連猴子都能懂的安裝這邊請 🐒
由作者提供的 🔗 LabelImg 下載後解壓縮,執行 labelImg.exe。
LabelImg


以下為紀錄我處處碰壁的安裝過程。

Mac Setup

OS 10.13.4 (17E202) / Python 2.7.15 (default)

Mac安裝參考這篇 🔗 Mac安装图像标注工具labelImg - CSDN博客

brew install cartr/qt4/pyqt

後進入 python 檢查是否安裝成功:

>>> import PyQt4

雖然成功 import 但還是照著教學文檢查環境變量:

$ which python  
/usr/bin/python  
$ which brew
/usr/local/bin/brew

PyQt4 是用 brew 安裝的,但是路徑顯示不一致需要修改:

$ cd /usr/local/lib/python2.7/site-packages  
$ ls
init.py   labelImg.py   resources.py  setup.py
init.pyc  labelImg.pyc  resources.pyc setup.pyc
$ open ~/.bash_profile

open ~/.bash_profile 並將下面的加入文件中:

export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

存檔後,關閉 terminal 並重新進入 python 中 import 檢查。


後來發現更簡單的安裝,不需要以上步驟 🙂️

pip install labelImg
labelImg
labelImg [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

是的沒錯!就是作者去年(2017/05)在 repo 頁面新增的 Get from PyPI


Windows Setup

Windows 7 pro / Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32

Windows 一開始裝更是處處碰壁,完全沒有想到我大 pip 就直接收工了。

參考教學:

主要參考第一個教程,其他是來排錯用的。

第一個教程在設定變數那邊是把 Anaconda 的路徑設在使用者變數,而其他教程沒列舉的幾乎都是設定在系統變數 🤔

並且注意路徑要包含到 Scripts,而不是只有 Anaconda。

image

再來卡關在 PyQt4 的這個指令,怎麼都是" 'pyrcc4' 不是內部或外部指令、可執行的程式或批次檔。"

pyrcc4 -o resources.py resources.qrc

後來是完全放棄此路直接 pip 來解決,但是還是不如 Mac 版順暢。

$ pip install msgpack
$ pip install labelImg

在有安裝 Anaconda3 的情況下,並 conda list 檢查與 Mac 同樣是有 msgpack-python,不清楚為什麼 Windows 還需要多安裝 msgpack 才可以。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant