o
    ϯi                  	   @   sh   d dl mZ d dlmZ d dlmZ d dlmZ 	 dZde diZ			dd
e
de
dedejfddZdS )    )AnyN)
create_csn)load_state_dict_from_urlz>https://dl.fbaipublicfiles.com/pytorchvideo/model_zoo/kineticscsn_r101z/CSN_32x2_R101.pythFT
pretrainedprogresskwargsreturnc                 K   sH   t d	dtjdd|}| r"td }t||dd}|d }|| |S )
a  
    Channel-Separated Convolutional Networks (CSN) R101 model architecture [1]
    with pretrained weights based on 32x2 setting on the Kinetics dataset.
    Model with pretrained weights has top1 accuracy of 77.0 (trained on 16x8 GPUs).

    [1] "Video classification with channel-separated convolutional networks"
        Du Tran, Heng Wang, Lorenzo Torresani, Matt Feiszli. ICCV 2019.
        https://arxiv.org/abs/1904.02811

    Args:
        pretrained (bool): If True, returns a model pre-trained on the Kinetics dataset
        progress (bool): If True, displays a progress bar of the download to stderr
        kwargs: use these to modify any of the other model settings. All the
            options are defined in pytorchvideo/models/resnet.py

    NOTE: to use the pretrained model, do not modify the model configuration
    via the kwargs. Only modify settings via kwargs to initialize a new model
    without pretrained weights.
    e   )      r   )model_depth	stem_poolhead_pool_kernel_sizer   cpu)r   map_locationmodel_stateN )r   nn	MaxPool3dcheckpoint_pathsr   load_state_dict)r   r   r   modelpath
checkpoint
state_dictr   r   O/home/ubuntu/.local/lib/python3.10/site-packages/pytorchvideo/models/hub/csn.pyr      s   
)FT)typingr   torch.nnr   pytorchvideo.models.csnr   	torch.hubr   root_dirr   boolModuler   r   r   r   r   <module>   s$   
