Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 2.84 KB

README.md

File metadata and controls

63 lines (46 loc) · 2.84 KB

K210_Yolo_framework

For old README, please visit here.

  • This repository is modified by Aoi-hosizora for Tensorflow 1.15.2 and Google Colab.

Record

Passed when 2022/01/12 and 2022/05/08.

  • Prepare environment
%tensorflow_version 1.x
!pip install tensorflow_model_optimization==0.1.1 scikit_image==0.15.0 h5py==2.10.0 --force-reinstall
# RESTART RUNTIME
%tensorflow_version 1.x
import tensorflow as tf
print(tf.__version__)
# 1.15.2
  • Model training and compiling
# Generate xxx_img_ann.npy
python make_voc_list.py datasets/test_20220501/train.txt data/test_20220501_img_ann.npy

# Generate xxx_anchor.npy
make anchors DATASET=test_20220501 ANCNUM=3 LOW="0.0 0.0" HIGH="1.0 1.0"

# Train using mobilenet_v1_base_7.h5 ()
make train MODEL=yolo_mobilev1 DATASET=test_20220501 DEPTHMUL=0.75 \
    CLSNUM=3 OBJTHRESH=0.7 MAXEP=150 BATCH=64 ILR=0.001 SPLITFACTOR=0.1 IAA=True PRUNE=False

# Test
make inference MODEL=yolo_mobilev1 DATASET=test_20220501 DEPTHMUL=0.75 \
    CLSNUM=3 OBJTHRESH=0.2 \
    CKPT=/content/drive/MyDrive/Colab/k210/K210_Yolo_framework/yolo_model.h5 IMG=/content/drive/MyDrive/Colab/k210/K210_Yolo_framework/datasets/test/24.png

# Quantize model to tflite
toco --output_file log/20220111-202657/yolo_model.tflite --keras_model_file log/20220111-202657/yolo_model.h5

# Compile model to kmodel
ncc log/20220111-202657/yolo_model.tflite log/20220111-202657/yolo_model.kmodel -i tflite -o k210model --dataset ...

Related tools

Reference