Views
No views yet
| Protocol | Split | Top-1 |
|---|---|---|
| single-clip val | test_val_seed42 (31,993) | 98.69% |
| 12-view test (4 seg × 3 crop) | test/reorganized (20,000) | 99.67% |
Note: this val split differs from the GitHubsiftformerrepo'ssplit_dataset(seed=42, val_ratio=0.15)(34,418 val). For an exact 1:1 vs Video Swin-T, load this model inside that repo and evaluate on its split (see "Fair comparison" below).
pytorch_model.bin — inference weights (model state_dict, 416 tensors)videomamba.py — model definition (OpenGVLab VideoMamba, video_sm)checkpoint-best.pth is not included (training ckpt w/ optimizer); ask if needed.model = videomamba_small # patch16, embed_dim 384, depth 24, rms_norm
num_classes = 4
num_frames = 8
tubelet_size = 1
img_size = 224
sampling = uniform 8 frames (Kinetics_sparse), single clip
norm = ImageNet mean[0.485,0.456,0.406] std[0.229,0.224,0.225]0 정상 / 1 졸음 / 2 주의분산 / 3 폭행 (matches the GitHub repo).videomamba.py calls Mamba(..., bimamba=True). The bimamba argument exists
only in OpenGVLab's mamba fork — standard mamba-ssm (e.g. 2.3.0 from PyPI) does
NOT have it and will raise TypeError: unexpected keyword argument 'bimamba'.1git clone https://github.com/OpenGVLab/VideoMamba
2pip install -e VideoMamba/causal-conv1d # bundled fork
3pip install -e VideoMamba/mamba # bundled fork (provides bimamba)
4pip install timm==0.4.12 einops1import torch
2from videomamba import videomamba_small # this repo's file
3
4model = videomamba_small(num_classes=4, num_frames=8, img_size=224)
5sd = torch.load("pytorch_model.bin", map_location="cpu")
6model.load_state_dict(sd, strict=True)
7model.eval().cuda()
8
9# x: (B, C=3, T=8, H=224, W=224), ImageNet-normalized, uniform 8 frames, center crop
10with torch.no_grad(), torch.amp.autocast("cuda", dtype=torch.bfloat16):
11 logits = model(x) # (B, 4)
12pred = logits.argmax(-1)1import json
2from src.data.dataset import DriverBehaviorDataset, split_dataset, DatasetConfig
3ds = DriverBehaviorDataset(DatasetConfig(...))
4_, val, _ = split_dataset(ds, train_ratio=0.7, val_ratio=0.15, seed=42)
5paths = [ds.samples[i][0] for i in val.indices]
6json.dump(paths, open("val_seed42_filelist.json", "w"), ensure_ascii=False)val_seed42_filelist.json. Evaluate VideoMamba on a Linux box over
exactly those files (same mango videos), single-clip argmax top-1.