I am developing a photo management Android app that has a labelling feature, it must recognize everyday objects/buildings/animals/plants. When I take a picture that shows a bicycle, a house and a mountain, my app will add the picture to each of these categories.
Tensorflow + pre-trained MobileNet v2 fits the requirement perfectly, with this dependency in my build.gradle
:
implementation 'org.tensorflow:tensorflow-android:1.2.0'
Problem: It makes the APK grow tenfolds to 32 MB, which is unacceptable for my target audience (people with slow/expensive mobile data plans and no WiFi/LAN/broadband).
Question: What tricks can I use to make Tensorflow + pre-trained MobileNet v2 much much smaller?
In particular, how to remove from Tensorflow the classes that are not used when labelling? No training will be done on Android, so I don't need all of the training classes, for instance. I can recompile if needed, but any other method is also welcome.
答案 0 :(得分:0)
您可以执行一些选择来减小模式大小,
您可以阅读很多here,我假设您的模型在转换后将为4MB。