GithubHelp home page GithubHelp logo

fuyukai_blog's Introduction

fuyukai_blog's People

Stargazers

 avatar

Watchers

Kî Ngôo avatar

Forkers

tommywu6

fuyukai_blog's Issues

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

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 才可以。

labelImg之後的小工具

image

labelImg 後如何把圖片跟相對應的 XML 檔案提取出來?

為了不要工人智慧的取出,以及不太會寫腳本,而想到的一些小工具。
Mac 上面應該可以使用這款。

Find and delete duplicate files on your Mac.

而 Windows 上面則是爬文找到這款--CloneSpy。
下載使用的版本是 32-bit, Windows 7.

Clonespy

  1. 選好資料夾,注意把搜尋選項改成 Files having the same title,如此可以找到檔名相同,但是副檔名不同的(.jpg & .xml)。

垃圾桶要清空!
垃圾桶要清空!
垃圾桶要清空!

  1. 選擇自動刪除較大的檔案(.jpg),再去垃圾桶把圖片移出來。

  2. XML 檔直接用系統內建的類別分類就很好取出了。

image

相關推薦更詳細的教學

🔗 目标检测Tensorflow object detection API之构建自己的模型 - 知乎

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.