imagededup icon indicating copy to clipboard operation
imagededup copied to clipboard

avoid download on import

Open bogdan-galileo opened this issue 2 years ago • 5 comments

What

Prevent downloading the mobilenetV3 model at import time.

Why

It creates an extra log that can be disturbing when integrating the repo in applications Screenshot 2023-07-26 at 3 25 33 PM

How

Set the default argument to None, and evaluate and download the model within the __init__ method only (since default args are evaluated at import time but the code in __init__ is not run)

See Issue: https://github.com/idealo/imagededup/issues/200

bogdan-galileo avatar Jul 26 '23 19:07 bogdan-galileo

Could you also update the relevant test cases please?

tanujjain avatar Jul 28 '23 15:07 tanujjain

Thanks @tanujjain. All tests are passing on my side, I added an extra test to check that the model is not downloaded at import time.

bogdan-galileo avatar Jul 31 '23 14:07 bogdan-galileo

please merge this branch to Master!

papayalove avatar Aug 01 '23 08:08 papayalove

@tanujjain any thoughts ? I added a new test and they were all passing on my side!

bogdan-galileo avatar Aug 11 '23 13:08 bogdan-galileo

@tanujjain can we merge ?

bogdan-galileo avatar Oct 05 '23 19:10 bogdan-galileo