Spaces:
Sleeping
Sleeping
Update src/components/faceswap.py
Browse files
src/components/faceswap.py
CHANGED
|
@@ -46,13 +46,10 @@ class FaceSwapper:
|
|
| 46 |
pass
|
| 47 |
logger.info(f"Ensured cookies.txt exists at: {cookie_path}")
|
| 48 |
|
| 49 |
-
# Set gdown's home directory explicitly
|
| 50 |
-
gdown.config.home = gdown_cache_dir
|
| 51 |
-
|
| 52 |
# Check if model path exists, and download if not
|
| 53 |
if not os.path.exists(model_path):
|
| 54 |
os.makedirs(os.path.dirname(model_path), exist_ok=True)
|
| 55 |
-
gdown.download(model_url, model_path, quiet=False)
|
| 56 |
|
| 57 |
self.swapper = insightface.model_zoo.get_model(model_path, download=False, download_zip=False)
|
| 58 |
logger.info('Swapper model loaded')
|
|
|
|
| 46 |
pass
|
| 47 |
logger.info(f"Ensured cookies.txt exists at: {cookie_path}")
|
| 48 |
|
|
|
|
|
|
|
|
|
|
| 49 |
# Check if model path exists, and download if not
|
| 50 |
if not os.path.exists(model_path):
|
| 51 |
os.makedirs(os.path.dirname(model_path), exist_ok=True)
|
| 52 |
+
gdown.download(model_url, model_path, quiet=False, use_cookies=False)
|
| 53 |
|
| 54 |
self.swapper = insightface.model_zoo.get_model(model_path, download=False, download_zip=False)
|
| 55 |
logger.info('Swapper model loaded')
|