o Us&      "r&TcCs|durt}tj|d}tj|ddt|}tj|j}|dur&|}tjtj||}tj|sJt d|d|dt ||d|d|S) aMLoad file form http url, will download models if necessary. Ref:https://github.com/1adrianb/face-alignment/blob/master/face_alignment/utils.py Args: url (str): URL to be downloaded. model_dir (str): The path to save the downloaded model. Should be a full path. If None, use pytorch hub_dir. Default: None. progress (bool): Whether to show the download progress. Default: True. file_name (str): The downloaded file name. If None, use the file name in the url. Default: None. Returns: str: The path to the downloaded file. N checkpointsT)exist_okzDownloading: "z" to  ) hash_prefixprogress) rospathjoinmakedirsrbasenameabspathexistsr#r)url model_dirrH file_namehub_dirpartsfilename cached_filerrrload_file_from_urlSs  rW)r)Nr4)NTN)r8rIrZ torch.hubrrr urllib.parserrr.r"r&rWrrrrs