Get cache directory for LPIPS weights.
()
| 18 | |
| 19 | |
| 20 | def get_cache_dir(): |
| 21 | """Get cache directory for LPIPS weights.""" |
| 22 | # Get project root (vtp_1214 directory) |
| 23 | current_file = os.path.abspath(__file__) |
| 24 | project_root = os.path.dirname(os.path.dirname(os.path.dirname(current_file))) |
| 25 | cache_dir = os.path.join(project_root, "output", "cache", "lpips") |
| 26 | os.makedirs(cache_dir, exist_ok=True) |
| 27 | return cache_dir |
| 28 | |
| 29 | |
| 30 | def download(url, local_path, chunk_size=1024): |