The file "s3fd.pth" will never load automatically

We check if path_to_detector is None, but `path_to_detector` will never be None because he is hardcoded in method params.
Hence, the file will never be automatically downloaded. I suggest checking if such a file exists and if not, then load it via the "load_url" method.
This commit is contained in:
Student B 2020-10-22 16:50:38 +03:00 committed by GitHub
parent 7ea7ef8961
commit ba6289a866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ class SFDDetector(FaceDetector):
super(SFDDetector, self).__init__(device, verbose)
# Initialise the face detector
if path_to_detector is None:
if not os.path.isfile(path_to_detector):
model_weights = load_url(models_urls['s3fd'])
else:
model_weights = torch.load(path_to_detector)