forked from serengil/deepface
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
991 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# built-in dependencies | ||
import os | ||
|
||
# 3rd party dependencies | ||
import gdown | ||
|
||
# project dependencies | ||
from deepface.commons import logger as log | ||
|
||
logger = log.get_singletonish_logger() | ||
|
||
|
||
def download_external_file(file_name: str, exact_file_path: str, url: str) -> None: | ||
""" | ||
Download an external file | ||
Args: | ||
file_name (str): file name with extension | ||
exact_file_path (str): exact location of the file with file name | ||
url (str): url to be downloaded | ||
Returns: | ||
None | ||
""" | ||
if os.path.exists(exact_file_path) is False: | ||
logger.info(f"Downloading MiniFASNetV2 weights to {exact_file_path}") | ||
try: | ||
gdown.download(url, exact_file_path, quiet=False) | ||
except Exception as err: | ||
raise ValueError( | ||
f"Exception while downloading {file_name} from {url} to {exact_file_path}." | ||
"You may consider to download it and copy to the target destination." | ||
) from err |
Oops, something went wrong.