【587】安裝 labelme

  目前在做計算機視覺,需要自己打標,被安利 labelme,但是目前此網站以及不支持註冊了,只能本地安裝來實現。可以按照網站說明一步步操作。

  • 按照 https://github.com/wkentaro/labelme 操作完成的

  • 不同操作系統按照不同的方式安裝,本文是 MacOS

  • 需要安裝 Anaconda、Docker,前者比較容易,後者也還好

  • 下載 Docker Desktop,按照基本流程處理即可,然後運行下面代碼,在 Terminal 裏面運行即可

  • # on macOS
    socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" &
    docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=docker.for.mac.host.internal:0 -v $(pwd):/root/workdir wkentaro/labelme
  • 然後安裝 pyqt,用來實現圖形界面效果的,可以參考:mac install PyQt5,通過以下實現

  • # brew 實現挺亂的
    pip3 install sip
    pip3 install pyqt5
  • 最後在安裝 labelme 即可,如下所示:

  • pip install labelme
    

     

  使用方法:

  • Run labelme --help for detail.

  • The annotations are saved as a JSON file.

  • 直接定位到圖片所在文件夾,然後通過下面代碼即可打開窗體操作

  • labelme  # just open gui
    
    # tutorial (single image example)
    cd examples/tutorial
    labelme apc2016_obj3.jpg  # specify image file
    labelme apc2016_obj3.jpg -O apc2016_obj3.json  # close window after the save
    labelme apc2016_obj3.jpg --nodata  # not include image data but relative image path in JSON file
    labelme apc2016_obj3.jpg \
      --labels highland_6539_self_stick_notes,mead_index_cards,kong_air_dog_squeakair_tennis_ball  # specify label list
    
    # semantic segmentation example
    cd examples/semantic_segmentation
    labelme data_annotated/  # Open directory to annotate all images in it
    labelme data_annotated/ --labels labels.txt  # specify label list with a file
    

     

  其他相關鏈接及操作見 GitHub 鏈接。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章