1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

labelmeの使い方

Last updated at Posted at 2024-02-15

アノテーションツールであるlabelmeの使い方をメモしておきます。
実行環境:MacBook Air M1, 2020

labelme(アノテーションツール)

https://github.com/wkentaro/labelme
https://qiita.com/omuram/items/a3be821734fd81c3ac59
https://farml1.com/yolact/
https://farml1.com/multiclass_classification/

ターミナルにてインストール

git clone https://github.com/wkentaro/labelme.git
cd labelme
conda create -n labelme python=3.9 # 仮想環境を構築
conda activate labelme
pip install -e .

labelmeを起動

conda activate labelme
labelme

画像データ(.jpeg)とアノテーションデータ(.json)の配置

labelme
└── examples
    └── semantic_segmentation
        └── train
            ├── 0001.jpeg
            ├── 0001.json
            ├── 0002.jpeg
            ├── 0002.json
            ├── 0003.jpeg
            └── 0003.json

labelme/examples/semantic_segmentation/labels.txtを書き換える(nameはラベル名)

labelme/examples/semantic_segmentation/labels.txt
__ignore__
_background_
name

以下のコードを実行し、データセットを生成します。

cd labelme/examples/semantic_segmentation
python labelme2voc.py train data_dataset --labels labels.txt --noobject

生成されたデータセットの配置

data_dataset
├── JPEGImages
│   ├── 0001.jpg
│   ├── 0002.jpg
│   └── 0003.jpg
├── SegmentationClass
│   ├── 0001.png
│   ├── 0002.png
│   └── 0003.png
├── SegmentationClassNpy
└── SegmentationClassVisualization

参考文献

https://github.com/wkentaro/labelme
https://qiita.com/omuram/items/a3be821734fd81c3ac59
https://farml1.com/yolact/
https://farml1.com/multiclass_classification/

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?