-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The library size is very large #57
Comments
Sadly I couldn't find a way to do so, prs are always welcomed in this matter |
I was facing the same issue and after some research found out that yolo v8 model can be exported with --optimize flag which will call the
and commented these :-
With that you also have to use |
When I tried that the size didn't change much in my case , can you let me know the difference in size between the normal one and lite one And if you don't mind can you open a pr? |
Thank you very much, will run workflows and test if everything good |
as i mentioned the difference is not much 5mb before it the problem is i dont know if the reduction in size hurts the models options that can be ran? and the reduction is roughly 5mb i dont know if it worth taking the risk confirm with me if you any other opinion i think it can be published as a work in progress (beta) while we convert to pytorch lite and latest ios version if its stable i think it has some problems #63 |
I understand.. actually i posted the comment because i thought this code change will help in reducing I guess the issue can remain open until further optimizations are found then we can consider creating another PR |
if you don't mind can you build output apk file with --analyze-size flag. I want to see the space taken by assets and the |
Sadly I can't do it now, maybe tomorrow and I will let you know |
added it in master and in your pr |
pr: https://github.com/zezo357/pytorch_lite/actions/runs/7351145699/job/20014024960
master: https://github.com/zezo357/pytorch_lite/actions/runs/7351120618/job/20013953038
|
As you can see 83MB is taken by the flutter assets which I believe is from the model. So I don't think the package can perform any further optimizations over there. And |
Yes I agree the power is in pytorch themselves, for the problem of assets I will try to split app and models so I download models at run time to show true app size Sadly I can't do it now and don't think I will be able for the next days Anyway thank you very much for your contribution and for checking the possibility of reducing it to that depth, hopefully pytorch reduces their lib size |
happy to help :) |
Btw I will leave your pr open, since it's valid until the assets stuff is handled if it's better then I guess we have a solution |
I would like to use the library
pytorch_lite
for object detection using a YOLO8 model.However I saw that the size of the APK file is too large, and then I found that the file
libpytorch_jni.so
is ~74MB.It does not matter whether I specify the version explicitly
pytorch_lite: ^4.2.1
or I provide thepath: ../
to thepytorch_lite
package, the result is roughly the same.Is there a way to shrink the lib size somehow by removing some unnecessary dependencies?
The text was updated successfully, but these errors were encountered: