I implement face detection based on the idea of yolo network in Kendryte K210. ps : this model only 500kb
you should install python package:
tensorflow 1.12 imgaug scikit-image numpy opencv-python matpltlib scipy tqdm
-
prepare dataset and make train list
cd k210-face-detection wget http://tamaraberg.com/faceDataset/originalPics.tar.gz mkdir FDDB tar -zxvf originalPics.tar.gz -C FDDB wget http://vis-www.cs.umass.edu/fddb/FDDB-folds.tgz tar -zxvf FDDB-folds.tgz -C FDDB python3 tools/make_list.py --fddb_dir FDDB --ann_dir FDDB/FDDB-folds
now your data fold have train.list
NOTE: When generate the train.list I set the box width and height only half. if you want use the normal value to train, please remove the comment in tools/make_list.py line
47
-
train
make train_pureconv ILR=0.001 MAXEP=20 IAA=false
ILR : the init learning rate
MAXEP : max epoch
IAA : whether to use data augmenter
NOTE: you can use
CKPT:xxxxx
to continue trainexample:
make train_pureconv CKPT=log/20190216-152633 ILR=0.0005 MAXEP=20 IAA=true
And you can use
tensorboard --logdir log
to look the record
make inference PB=Freeze_save.pb
-
freeze ckpt
make freeze CKPT=log/20190216-154422
now your fold will have
Freeze_save.pb
-
use kendryte-model-complier to complie pb file
you can use my script (you should modify MODELCMP):
make kmodel_convert PB=Freeze_save.pb MODELCMP=~/Documents/kendryte-model-compiler
or refer to see the kendryte-model-compiler
-
copy weights array to code
cp ~/Documents/kendryte-model-compiler/build/gencode_output.* K210_code/
-
compile the code
you can refer to the documents k210 use in windows or k210 use in linux
And you can find some useful article in my bolg.
-
down load program
now you can use kflash.py down load the program
- [] add nms to avoid box overlapping