Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 941 Bytes

README.md

File metadata and controls

27 lines (24 loc) · 941 Bytes

edge2panda

An Android application for pix2pix with tensorflow mobile.

Demo

image

Model transformer

We use the tensorflow mobile for mobile application. There are some tricks for model transformation.

  • Reduce the pix2pix model, by only saving Generator.
python pix2pix_android.py --model-input <raw model input folder> --model-output <reduced model output folder>
  • freeze model
python freeze_model.py --model-folder <reduced model output folder>
  • Quantization by using bazel
bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
--in_graph=<frozen model folder>/frozen_model.pb \
--out_graph=<frozen model folder>/frozen_model_android_quantized.pb --inputs='image_tensor' \
--outputs='generator/deprocess/div' \
--transforms='quantize_weights'
  • Last Put the quantized model to the assest folder in project.