forked from kornia/kornia
-
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.
feat (CI): cache model weights (kornia#2984)
- Loading branch information
Showing
4 changed files
with
147 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import argparse | ||
|
||
import torch | ||
|
||
fonts = { | ||
"sold2_wireframe": "http://cmp.felk.cvut.cz/~mishkdmy/models/sold2_wireframe.pth", | ||
} | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser("WeightsDownloader") | ||
parser.add_argument("--target_directory", "-t", required=False, default="target_directory") | ||
|
||
args = parser.parse_args() | ||
|
||
torch.hub.set_dir(args.target_directory) | ||
|
||
for name, url in fonts.items(): | ||
print(f"Downloading weights of `{name}` from `url`. Caching to dir `{args.target_directory}`") | ||
torch.hub.load_state_dict_from_url(url, model_dir=args.target_directory, map_location=torch.device("cpu")) | ||
|
||
raise SystemExit(0) |
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