k210-face-detection
k210-face-detection copied to clipboard
Starter version yolo net achieve face detection in kendryte K210~
k210 face detection demo
I implement face detection based on the idea of yolo network in Kendryte K210. ps : this model only 500kb
Usage
environmental preparation
you should install python package:
tensorflow 1.12 imgaug scikit-image numpy opencv-python matpltlib scipy tqdm
train model
-
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-foldsnow 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=falseILR : the init learning rate
MAXEP : max epoch
IAA : whether to use data augmenter
NOTE: you can use
CKPT:xxxxxto continue trainexample:
make train_pureconv CKPT=log/20190216-152633 ILR=0.0005 MAXEP=20 IAA=trueAnd you can use
tensorboard --logdir logto look the record
test model
make inference PB=Freeze_save.pb
export pb
-
freeze ckpt
make freeze CKPT=log/20190216-154422now 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-compileror refer to see the kendryte-model-compiler
modfiy k210 code
-
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
Final effect

todo
- [] add nms to avoid box overlapping