(base_path)
| 34 | |
| 35 | |
| 36 | def get_path(base_path): |
| 37 | save_path = os.path.join(BASE_DIR, base_path) |
| 38 | if not os.path.exists(save_path): |
| 39 | url = f"https://huggingface.co/aaronb/StyleGAN2-pkl/resolve/main/{base_path}" |
| 40 | print(f'{base_path} not found') |
| 41 | print('Try to download from huggingface: ', url) |
| 42 | os.makedirs(os.path.dirname(save_path), exist_ok=True) |
| 43 | download_url(url, save_path) |
| 44 | print('Downloaded to ', save_path) |
| 45 | return save_path |
| 46 | |
| 47 | |
| 48 | def tensor_to_PIL(img: torch.Tensor) -> PIL.Image.Image: |
nothing calls this directly
no test coverage detected