LoginSignup
0
3

More than 5 years have passed since last update.

クラス名画像の作り方

Posted at

yoloなどのDeepLearningを見ると、よくお目にかかる
  ・car
  ・bicycle
  ・dog
などの文字

alt

これは学習済みのモデルから、物体検出された物体(クラス)をみやすく表示するのに使われる「クラス名画像」と言われるものらしい

この画像が準備されていないと、学習時に「クラス名を分類する画像がないぞ!」とエラーになるので、何かしらの手段で準備する必要がある

yoloで準備されている画像はこんな感じ

$ file dog.png bicycle.png car.png
dog.png: PNG image data, 36 x 25, 8-bit grayscale, non-interlaced
bicycle.png: PNG image data, 58 x 25, 8-bit grayscale, non-interlaced
car.png: PNG image data, 31 x 25, 8-bit grayscale, non-interlaced

因みにyoloにはスクリプト(make_labels.py)が準備されており、クラス名画像も簡単に作れる。

私の環境にはFontがあまり準備されていなかったので、ImageMagickをインストールして、最低限のオプションでクラス名画像を作ってからトレーニングを始めてみた

$ sudo apt-get -y install imagemagick
$ convert -fill black -background white -bordercolor white -border 4 -pointsize 18 label:<ラベル名> <ラベル名>.png

0
3
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
0
3