Coder Social home page Coder Social logo

Comments (5)

mvhsin avatar mvhsin commented on August 24, 2024

Hi @manjrekarom ,

You can try with MobileFacenet-S, which model size will be around 1.4MB when quantized with TFlite with the following cmd:

tflite_convert --output_file tf-lite/MobileFacenet_uint8_128.tflite
--graph_def_file tf-lite/MobileFacenet.pb
--input_arrays "input"
--input_shapes "1,112,112,3"
--output_arrays output
--output_format TFLITE
--mean_values 128
--std_dev_values 127.5
--default_ranges_min 0
--default_ranges_max 255
--inference_type QUANTIZED_UINT8
--inference_input_type QUANTIZED_UINT8

But I met the other issue related to accuracy.
The result seems not correct with the quantized model, please kindly share the information if you have the idea. Many thanks!

from mobilefacenet_tf.

manjrekarom avatar manjrekarom commented on August 24, 2024

Hi @mvhsin ! Thanks for your reply.

Can I get a link to pretrained MobileFacenet-S?
The model that we had quantized was also about 1.5MB in size after quantization but after converting it back to .cc file it grew to about 6x - 8x (~8MB).

Sure. I will share if I find something relevant.

from mobilefacenet_tf.

mvhsin avatar mvhsin commented on August 24, 2024

Hi @manjrekarom ,

The author of MobileFacenet mentioned in the paper.

remove the linear 1 × 1 convolution layer afterthe linear GDConv layer from MobileFaceNet, the resulting network of which is called MobileFaceNet-M. From MobileFaceNet-M, removing the 1 × 1 convolution layer before the linear GDConv layer produces the smallest network called MobileFaceNet-S.
Sorry I am not sure about *.cc file.
Is that done by TF-lite microcontroller?

from mobilefacenet_tf.

manjrekarom avatar manjrekarom commented on August 24, 2024

Oh thanks I'll take a look.

Yes it is for TF-Lite microcontrollers. The FlatBuffer obtained from an initial tf model, is converted to a C byte array.

This C file is taking up ~7x space (1.5 -> ~8MB). So we need an even smaller model. The options I feel I am left with are network pruning, knowledge distillation and training an even smaller custom architecture similar to MobileFaceNet.

from mobilefacenet_tf.

mvhsin avatar mvhsin commented on August 24, 2024

Same here! Thanks for the info of TF-lite microcontroller.

from mobilefacenet_tf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.