detect PPAP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
YOLOtiny_chainer_v2
cfg
data/ppap
doc
LICENSE
README.md
avi2gif.sh
convert.sh
create_dataset.py
demo.sh
pretrain.sh
pretrain_demo.sh
replay.py
replay_file.py
replay_movie.py
train.sh

README.md

YOLO_PPAP

PP/AP identification using YOLO_ver2 and chainer. For detail, see Qiita Entry.

example_movie

Preparation

git clone this_repositry
ln -s /path/to/darknet .
ln -s /path/to/darknet/data/labels ./data/labels

Create materials

  • Create your own PP/AP (PNG files with transparent background)
  • Place them to data/ppap/foreground/00/ and data/ppap/foreground/01/
  • Create your own background images
  • Place them to data/ppap/background

Create dataset

cd data/ppap
mkdir images_pre
mkdir images
mkdir labels
python create_pretrain_dataset.py
python create_dataset.py
cd ../..

Pre-train & conert pre-train weights to initial weight

mkdir /tmp/backup
./pretrain.sh
./convert.sh

Train

mkdir /tmp/ppap-backup
./train.sh
cp /tmp/ppap-backup/tiny-yolo-final.weights ./YOLOtiny_chainer_v2

Convert darknet weights to chainer

cd ./YOLOtiny_chainer_v2
python YOLOtiny.py
cd ..

Prediction

predict image file

python replay_file.py filename.png

Output is written to filename_out.png

predict image files in data/ppap/images/

mkdir outfiles
python replay.py

Output is written to outfiles foldes

predict avi file

python replay_movie.py filename

Output is written to out.avi