a
    d                      @   s.   d dl Z d dlmZ ddlmZ d	ddZdS )
    N)load_file_from_url   )HopeNetFcudac                 C   sx   | dkrt dg dd}d}nt|  dt|ddd |d	}tj|d
d dd }|j|dd |  ||}|S )NZhopenetZresnet)         r   B   zQhttps://github.com/xinntao/facexlib/releases/download/v0.2.0/headpose_hopenet.pthz is not implemented.zfacexlib/weightsT)urlZ	model_dirprogress	file_namesave_dirc                 S   s   | S )N )Zstoragelocr   r   c/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/facexlib/headpose/__init__.py<lambda>       z%init_headpose_model.<locals>.<lambda>)Zmap_locationparams)strict)r   NotImplementedErrorr   torchloadZload_state_dictevalto)Z
model_nameZhalfZdeviceZmodel_rootpathmodelZ	model_urlZ
model_pathZload_netr   r   r   init_headpose_model   s    

r   )Fr   N)r   Zfacexlib.utilsr   Zhopenet_archr   r   r   r   r   r   <module>   s   