Views
No views yet
checkpoint-best.pth untuk VideoMAE ViT-Base K400 yang difinetune pada dataset Anda.checkpoint-best.pth: model weightspip install torch torchvision timm decord numpy opencv-python huggingface_hub1from huggingface_hub import hf_hub_download
2
3checkpoint_path = hf_hub_download(
4 repo_id="Luckystg/SIBI_Recognition_VideoMAE",
5 filename="checkpoint-best.pth"
6)
7print(checkpoint_path)1import torch
2from VideoMAE import modeling_finetune
3
4model = modeling_finetune.vit_base_patch16_224(
5 pretrained=False,
6 num_classes=10,
7 all_frames=16,
8 tubelet_size=2,
9 drop_rate=0.0,
10 drop_path_rate=0.0,
11 attn_drop_rate=0.0,
12 use_mean_pooling=True,
13 init_scale=0.001,
14)
15
16ckpt = torch.load(checkpoint_path, map_location='cpu', weights_only=False)
17sd = ckpt.get('model', ckpt)
18model.load_state_dict({k: v for k, v in sd.items() if k in model.state_dict() and v.shape == model.state_dict()[k].shape}, strict=False)
19model.eval()AutoModel.from_pretrained dari transformers.VideoMAE di environment Anda saat menjalankan inferensi.README.md dengan instruksi inirequirements.txt minimal untuk dependencyinferensi_manual.py