fbelderink / flutter_pytorch_mobile

A flutter plugin for pytorch model inference. Supports image models as well as custom models.
https://pub.dev/packages/pytorch_mobile
Other
101 stars 52 forks source link

Different outputs #7

Open janishjit opened 3 years ago

janishjit commented 3 years ago

I created a custom model which detects different sneakers. On running with a particular image on a python notebook and on flutter gives two different values as outputs...

I have verified the model has been saved properly and labels are in the same order but the app returns different values...

elb3k commented 3 years ago

This might be because of default mean and std for normalization here: https://github.com/fynnmaarten/flutter_pytorch_mobile/blob/3f0dcbcb560668d36828a8d7d18c21549e46c34a/android/src/main/java/io/fynn/pytorch_mobile/PyTorchMobilePlugin.java#L109-L110

Later the package should support custom mean and std

fbelderink commented 3 years ago

I created a custom model which detects different sneakers. On running with a particular image on a python notebook and on flutter gives two different values as outputs...

I have verified the model has been saved properly and labels are in the same order but the app returns different values...

There's a new version now, could you try using that and then report if it solved the problem?