idealo / imagededup

😎 Finding duplicate images made easy!
https://idealo.github.io/imagededup/
Apache License 2.0
5.1k stars 458 forks source link

avoid download on import #201

Open bogdan-galileo opened 1 year ago

bogdan-galileo commented 1 year ago

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

tanujjain commented 1 year ago

Could you also update the relevant test cases please?

bogdan-galileo commented 1 year ago

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.

papayalove commented 1 year ago

please merge this branch to Master!

bogdan-galileo commented 1 year ago

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

bogdan-galileo commented 11 months ago

@tanujjain can we merge ?