IntegrationTest / download_l2cs_weights.py
Abdelrahman Almatrooshi
Integrate L2CS-Net gaze estimation
2eba0cc
#!/usr/bin/env python3
# Downloads L2CS-Net Gaze360 weights into checkpoints/
import os
import sys
CHECKPOINTS_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "checkpoints")
DEST = os.path.join(CHECKPOINTS_DIR, "L2CSNet_gaze360.pkl")
GDRIVE_ID = "1dL2Jokb19_SBSHAhKHOxJsmYs5-GoyLo"
def main():
if os.path.isfile(DEST):
print(f"[OK] Weights already at {DEST}")
return
try:
import gdown
except ImportError:
print("gdown not installed. Run: pip install gdown")
sys.exit(1)
os.makedirs(CHECKPOINTS_DIR, exist_ok=True)
print(f"Downloading L2CS-Net weights to {DEST} ...")
gdown.download(f"https://drive.google.com/uc?id={GDRIVE_ID}", DEST, quiet=False)
if os.path.isfile(DEST):
print(f"[OK] Downloaded ({os.path.getsize(DEST) / 1024 / 1024:.1f} MB)")
else:
print("[ERR] Download failed. Manual download:")
print(" https://drive.google.com/drive/folders/17p6ORr-JQJcw-eYtG2WGNiuS_qVKwdWd")
print(f" Place L2CSNet_gaze360.pkl in {CHECKPOINTS_DIR}/")
sys.exit(1)
if __name__ == "__main__":
main()