face-landmarking-ios icon indicating copy to clipboard operation
face-landmarking-ios copied to clipboard

reduce app size

Open odedharth opened this issue 7 years ago • 6 comments

As the landmarks file is very big (around 90mb) its causes the IOS app to be much larger in size. Do you think there is a way reduce the size of the file (maybe zip it in some way)?

odedharth avatar Nov 08 '16 13:11 odedharth

I am not sure if it is zipped already, so that may be worth a try.

Also, you can generate your own Dlib model which includes less landmarks and possible less accuracy, giving you a smaller model file size. I did not test that, as you need quite a powerful computer (lots of memory) for generating the model.

zweigraf avatar Nov 18 '16 18:11 zweigraf

Also, you should zip the file to see how much space it will actually take when you build the app, since the IPA is already a compressed archive.

andreapiso avatar Nov 19 '16 10:11 andreapiso

Using gzip the shape_predictor_68_face_landmarks.dat file goes from 99,693,937 to 72,325,689 bytes.. don't think it is worth. Besides you will have to decompress the file at runtime.

wlads avatar Mar 15 '17 15:03 wlads

Well that is a nice improvement, around 20%.

If you combine this with a custom model with less landmarks, you could have some nice results.

zweigraf avatar Mar 15 '17 15:03 zweigraf

Thanks for the repo and efforts you guys put on this 👍

Can you please guide me how can I create custom models ?

Looking forward to hear from you..

thanks

singhiam avatar Jul 19 '17 10:07 singhiam

I did not do that myself yet, so I can only refer you to the Dlib documentation.

They talk about this feature here and talk about it in the comments of this article. Sample code for training a model is here.

zweigraf avatar Jul 22 '17 14:07 zweigraf