Open bogdan-galileo opened 1 year ago
You can do as follow:
def __init__(
self,
verbose: bool = True,
model_config: CustomModel = CustomModel()
# model_config: CustomModel = CustomModel(
# model=MobilenetV3(), transform=MobilenetV3.transform, name=MobilenetV3.name
# ),
And manually select the downloaded model like: https://github.com/idealo/imagededup/blob/master/examples/use_custom_model.ipynb
Importing
PHash
causes the import of theCNN
class and triggers the download of the Mobilenet model fromtorchvision
.Although very small, it's just and extra log that can be distracting in applications.
Can I get rid of it ? This was just introduced in the PR https://github.com/idealo/imagededup/pull/190
It seems to be caused by the import of the class
CNN
fromimagededup.methods.cnn
, which downloads the model as part as evaluating the default argument of__init__
.