zweigraf / face-landmarking-ios

👦 Basic face landmarking on iPhone with Dlib via Swift & ObjC++
481 stars 125 forks source link

reduce app size #12

Open odedharth opened 8 years ago

odedharth commented 8 years ago

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)?

zweigraf commented 8 years ago

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.

andreapiso commented 8 years ago

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.

wlads commented 7 years ago

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.

zweigraf commented 7 years ago

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.

singhiam commented 7 years ago

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

zweigraf commented 7 years ago

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.