abdelaziz-mahdy / pytorch_lite

flutter package to help run pytorch lite models classification and YoloV5 and YoloV8.
MIT License
49 stars 18 forks source link

version 4.0.0 The application size is very large #34

Closed maheralzoubi97 closed 9 months ago

maheralzoubi97 commented 10 months ago

version 4.0.0 The application size is very large

abdelaziz-mahdy commented 10 months ago

Was it smaller in 3*?

I only added opencv which is 15 mb on Android and don't know the size on iOS.

Where do you say it's too large? iOS or android

maheralzoubi97 commented 10 months ago

in android in version 2.0.5 app size 100 MB in 4.0.0 app size 400 MB

abdelaziz-mahdy commented 10 months ago

in android in version 2.0.5 app size 100 MB in 4.0.0 app size 400 MB

debug or release in both cases?

and will try to check it on weekend, but the performance is like version 2 for you? or better?

maheralzoubi97 commented 10 months ago

release

abdelaziz-mahdy commented 10 months ago

setting min sdk to 24 is the main problem

but setting android:extractNativeLibs="true"

<application android:label="pytorch_lite_example" android:name="${applicationName}" android:icon="@mipmap/ic_launcher" android:extractNativeLibs="true"

in android manifest reduced it to 181 mb

will try to find a fix for it, but looks like i cant reduce it to 21 since opencv requires 24

abdelaziz-mahdy commented 9 months ago

upon further checking,i think the problem is related to torch version, since https://github.com/zezo357/pytorch_lite/pull/42 uses same logic as version 2 but the torch version is the latest

and the apk size is 168mb

abdelaziz-mahdy commented 9 months ago

most probably fixed in 4.2.0 , check and let me know