0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TensorFlowを使ってDir en greyの顔分類器を作ってみた - ⑤学習データ準備編

Last updated at Posted at 2017-05-31

はじめに

  • 画像の整理に神経使います。
  • 噂の通り、機械学習する前に、私がメンバーの画像を見分けられる力を少し得ました。

準備

ディレクト構成

workspace/dir
├ data [学習結果の出力先]
├ face [OpenCVで顔抽出データの出力先]
│ ├ kaoru
│ ├ kyo
│ └ shinya
├ original [APIから取得してきた画像データの出力先]
│ ├ kaoru
│ ├ kyo
│ └ shinya
├ test [学習後にモデルの精度をチェックする検証用データの出力先]
│ ├ data.txt [画像のパスを記載したファイル]
│ ├ kaoru
│ ├ kyo
│ └ shinya
└ train [学習用データの出力先]
  ├ data.txt [画像のパスを記載したファイル]
  ├ kaoru
  ├ kyo
  └ shinya
date.txt
/workspace/dir/train/kyo/cutted_kyo0.jpg 0
/workspace/dir/train/kyo/cutted_kyo1.jpg 0
/workspace/dir/train/kyo/cutted_kyo10.jpg 0
/workspace/dir/train/kyo/cutted_kyo107.jpg 0
/workspace/dir/train/kyo/cutted_kyo109.jpg 0
/workspace/dir/train/kyo/cutted_kyo110.jpg 0
/workspace/dir/train/kyo/cutted_kyo111.jpg 0
/workspace/dir/train/kyo/cutted_kyo112.jpg 0
/workspace/dir/train/kyo/cutted_kyo113.jpg 0
/workspace/dir/train/kyo/cutted_kyo114.jpg 0
/workspace/dir/train/kyo/cutted_kyo122.jpg 0
/workspace/dir/train/kyo/cutted_kyo127.jpg 0
/workspace/dir/train/kyo/cutted_kyo128.jpg 0
/workspace/dir/train/kyo/cutted_kyo131.jpg 0
/workspace/dir/train/kyo/cutted_kyo133.jpg 0
/workspace/dir/train/kyo/cutted_kyo134.jpg 0
/workspace/dir/train/kyo/cutted_kyo135.jpg 0
/workspace/dir/train/kyo/cutted_kyo139.jpg 0
/workspace/dir/train/kyo/cutted_kyo143.jpg 0
/workspace/dir/train/kyo/cutted_kyo144.jpg 0
/workspace/dir/train/kyo/cutted_kyo146.jpg 0
/workspace/dir/train/kyo/cutted_kyo155.jpg 0
/workspace/dir/train/kyo/cutted_kyo156.jpg 0
/workspace/dir/train/kyo/cutted_kyo159.jpg 0
/workspace/dir/train/kyo/cutted_kyo16.jpg 0
/workspace/dir/train/kyo/cutted_kyo160.jpg 0
/workspace/dir/train/kyo/cutted_kyo163.jpg 0
/workspace/dir/train/kyo/cutted_kyo164.jpg 0
/workspace/dir/train/kyo/cutted_kyo165.jpg 0
/workspace/dir/train/kyo/cutted_kyo20.jpg 0
/workspace/dir/train/kyo/cutted_kyo23.jpg 0
/workspace/dir/train/kyo/cutted_kyo27.jpg 0
/workspace/dir/train/kyo/cutted_kyo29.jpg 0
/workspace/dir/train/kyo/cutted_kyo30.jpg 0
/workspace/dir/train/kyo/cutted_kyo33.jpg 0
/workspace/dir/train/kyo/cutted_kyo34.jpg 0
/workspace/dir/train/kyo/cutted_kyo39.jpg 0
/workspace/dir/train/kyo/cutted_kyo41.jpg 0
/workspace/dir/train/kyo/cutted_kyo46.jpg 0
/workspace/dir/train/kyo/cutted_kyo48.jpg 0
/workspace/dir/train/kyo/cutted_kyo50.jpg 0
/workspace/dir/train/kyo/cutted_kyo53.jpg 0
/workspace/dir/train/kyo/cutted_kyo54.jpg 0
/workspace/dir/train/kyo/cutted_kyo55.jpg 0
/workspace/dir/train/kyo/cutted_kyo56.jpg 0
/workspace/dir/train/kyo/cutted_kyo57.jpg 0
/workspace/dir/train/kyo/cutted_kyo58.jpg 0
/workspace/dir/train/kyo/cutted_kyo6.jpg 0
/workspace/dir/train/kyo/cutted_kyo65.jpg 0
/workspace/dir/train/kyo/cutted_kyo66.jpg 0
/workspace/dir/train/kyo/cutted_kyo68.jpg 0
/workspace/dir/train/kyo/cutted_kyo69.jpg 0
/workspace/dir/train/kyo/cutted_kyo73.jpg 0
/workspace/dir/train/kyo/cutted_kyo74.jpg 0
/workspace/dir/train/kyo/cutted_kyo75.jpg 0
/workspace/dir/train/kyo/cutted_kyo79.jpg 0
/workspace/dir/train/kyo/cutted_kyo83.jpg 0
/workspace/dir/train/kyo/cutted_kyo84.jpg 0
/workspace/dir/train/kyo/cutted_kyo86.jpg 0
/workspace/dir/train/kyo/cutted_kyo92.jpg 0
/workspace/dir/train/kaoru/cutted_kaoru10.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru104.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru114.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru125.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru128.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru142.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru22.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru5.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru59.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru6.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru71.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru75.jpg 1
/workspace/dir/train/kaoru/cutted_kaoru91.jpg 1
/workspace/dir/train/shinya/cutted_shinya0.jpg 2
/workspace/dir/train/shinya/cutted_shinya12.jpg 2
/workspace/dir/train/shinya/cutted_shinya14.jpg 2
/workspace/dir/train/shinya/cutted_shinya15.jpg 2
/workspace/dir/train/shinya/cutted_shinya16.jpg 2
/workspace/dir/train/shinya/cutted_shinya18.jpg 2
/workspace/dir/train/shinya/cutted_shinya19.jpg 2
/workspace/dir/train/shinya/cutted_shinya2.jpg 2
/workspace/dir/train/shinya/cutted_shinya20.jpg 2
/workspace/dir/train/shinya/cutted_shinya21.jpg 2
/workspace/dir/train/shinya/cutted_shinya24.jpg 2
/workspace/dir/train/shinya/cutted_shinya25.jpg 2
/workspace/dir/train/shinya/cutted_shinya29.jpg 2
/workspace/dir/train/shinya/cutted_shinya3.jpg 2
/workspace/dir/train/shinya/cutted_shinya30.jpg 2
/workspace/dir/train/shinya/cutted_shinya32.jpg 2
/workspace/dir/train/shinya/cutted_shinya33.jpg 2
/workspace/dir/train/shinya/cutted_shinya37.jpg 2
/workspace/dir/train/shinya/cutted_shinya4.jpg 2
/workspace/dir/train/shinya/cutted_shinya41.jpg 2
/workspace/dir/train/shinya/cutted_shinya43.jpg 2
/workspace/dir/train/shinya/cutted_shinya45.jpg 2
/workspace/dir/train/shinya/cutted_shinya5.jpg 2
/workspace/dir/train/shinya/cutted_shinya53.jpg 2
/workspace/dir/train/shinya/cutted_shinya54.jpg 2
/workspace/dir/train/shinya/cutted_shinya59.jpg 2
/workspace/dir/train/shinya/cutted_shinya60.jpg 2
/workspace/dir/train/shinya/cutted_shinya8.jpg 2
/workspace/dir/train/shinya/cutted_shinya9.jpg 2

※ 京:0,薫:1,Shinya:2にしてます。

補足と言い訳

  • 画像パスは絶対パスが良いです。
  • ls -1で縦に出してExcelに貼り付けて....みたいな感じで作りました。
  • dataディレクトリにはevents.out.tfevents.1496104637.xxxxxxxみたいな名前のファイルが学習後にできます。
  • なんだかんだであまり画像ないです。平均50枚もないかもです。

全ページリンク

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?