How to get tflite models of a size similar to the project on Android (20 MB) ?
Hello everyone.
I need to get a tflite model from the weight obtained with the workouts (.weight), but this weight occupies about 200 MB, so when transforming this into tflite it occupies 200 MB, and then I need a much less capacity, like the original that occupies only 20 MB.
Thanks.
the demo model used in the android app is YOLOv4-tiny model
-
check this guide to train your model link
-
after generating your whites file save the model with this command
python save_model.py --weights ./data/yolov4-tiny.weights --output ./checkpoints/yolov4-tiny-416 --input_size 416 --model yolov4 --framework tflite --tiny -
convert your model to tflite using this command:
python convert_tflite.py --weights ./checkpoints/yolov4-tiny-416 --output ./checkpoints/yolov4-tiny-416.tflite -
copy model to android assets folder.
-
change the model file name on MainActvity and DetectorActivity.
-
open YoloV4Classifier.java and change
isTinytotrue