--- license: apache-2.0 library_name: pytorch tags: - video-prediction - spatiotemporal-forecasting - openstl - safetensors - kth - human-motion datasets: - dronefreak/KTH-Actions --- # OpenSTL Checkpoints: KTH Actions (10 → 20 frames) [](https://www.apache.org/licenses/LICENSE-2.0) [](https://arxiv.org/abs/2306.11249) [](https://github.com/chengtan9907/OpenSTL) [](https://huggingface.co/dronefreak/OpenSTL-KTH/tree/main) - **Benchmark:** KTH Actions, 10 to 20 frames - **Checkpoints:** 23 - **Task:** spatiotemporal predictive learning - **Source:** OpenSTL GitHub release kth20-weights - **License:** Apache-2.0 > **Unofficial mirror.** These are the pretrained weights and training logs that the [OpenSTL](https://github.com/chengtan9907/OpenSTL) authors (CAIRI AI Lab, Westlake University) published as GitHub release assets, re-hosted here with safetensors copies so they stay available. All credit belongs to the original authors. ## Disclaimer This repo is not affiliated with or endorsed by the OpenSTL authors. The weights come from the [`kth20-weights`](https://github.com/chengtan9907/OpenSTL/releases/tag/kth20-weights) release of https://github.com/chengtan9907/OpenSTL, which is licensed under Apache-2.0 (Copyright 2022-2023 CAIRI AI Lab). The model zoo tables come from [`docs/en/model_zoos`](https://github.com/chengtan9907/OpenSTL/tree/OpenSTL-Lightning/docs/en/model_zoos). Several methods are OpenSTL re-implementations of other authors' work (ConvLSTM, PredNet, PredRNN family, E3D-LSTM, MIM, CrevNet, PhyDNet, MAU, DMVFN); please credit them too. If you are an author and want this mirror changed or removed, open a discussion on this repo. **Training data.** [KTH Actions](https://huggingface.co/datasets/dronefreak/KTH-Actions) (Schüldt, Laptev and Caputo, ICPR 2004). The KTH authors state the dataset is free for non-commercial use, so check those terms before any commercial use of these weights. **Task.** Predict 20 future frames of KTH Actions video from 10 observed frames, 128x128 grayscale. ## Changes from the Official Release - Added `model.safetensors` next to every original `.pth` (23 checkpoints). Tensors are bit-identical to the original state dicts. - Grouped each checkpoint with its training log in one folder named after the original file. - Rewrote the model-zoo links to point at this repo. 28 links in the upstream docs use the wrong file names (`moganet` vs `moga`, `mlpmixer` vs `mlp`, `dmvfn` vs `dmfvn`, `mfmnist_` vs `fmnist_`); here they resolve to the files that actually exist. - Added `openstl_hub.py`, a loader that rebuilds each architecture from its training log. - Added the upstream visualisation GIFs (`visualizations/`) and a banner made from six of them. - Removed the `module.` (DDP) key prefix in `model.safetensors` for 19 checkpoint(s); the `.pth` files are unchanged. ### Problems in the upstream release Found while verifying the files. They are documented here and left as they are. - `kth20_simvp_vit_one_ep100`: the docs list 12.7M parameters for the ViT row, the checkpoint has 15.33M. - `kth20_simvp_uniformer_one_ep100`: the docs list 11.8M parameters for the Uniformer row, the checkpoint has 14.42M. ## Model Zoo Results, parameter counts, FLOPs and FPS are copied from the OpenSTL docs; they were not re-measured here. `model` and `log` link to the files in this repo. We provide long-term prediction benchmark results on [KTH Action](https://ieeexplore.ieee.org/document/1334462) dataset using $10\rightarrow 20$ frames prediction setting. Metrics (MSE, MAE, SSIM, pSNR, LPIPS) of the best models are reported in three trials. Parameters (M), FLOPs (G), and V100 inference FPS (s) are also reported for all methods. The default training setup is trained 100 epochs by Adam optimizer with a batch size of 16 and Onecycle scheduler on **single GPU** or **4GPUs**, and we report the used GPU setups for each method (also shown in the config). ### **STL Benchmarks on KTH** For a fair comparison of different methods, we report the best results when models are trained to convergence. We provide config files in [configs/kth](https://github.com/chengtan9907/OpenSTL/tree/OpenSTLv0.3.0/configs/kth). Notice that `4xbs4` indicates 4GPUs DDP training with the batch size of 4 on each GPU. | Method | Setting | GPUs | Params | FLOPs | FPS | MSE | MAE | SSIM | PSNR | LPIPS | Download | |--------------|:---------:|:------:|:------:|:-------:|:---:|:------:|:-----:|:------:|:-----:|:-------:|:------------:| | ConvLSTM-S | 100 epoch | 1xbs16 | 14.9M | 1368.0G | 16 | 47.65 | 445.5 | 0.8977 | 26.99 | 0.26686 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_convlstm_one_ep100/kth20_convlstm_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_convlstm_one_ep100/kth20_convlstm_one_ep100.log) | | E3D-LSTM | 100 epoch | 2xbs8 | 53.5M | 217.0G | 17 | 136.40 | 892.7 | 0.8153 | 21.78 | 0.48358 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_e3dlstm_one_ep100/kth20_e3dlstm_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_e3dlstm_one_ep100/kth20_e3dlstm_one_ep100.log) | | PredNet | 100 epoch | 1xbs16 | 12.5M | 3.4G | 399 | 152.11 | 783.1 | 0.8094 | 22.45 | 0.32159 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_prednet_one_ep100/kth20_prednet_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_prednet_one_ep100/kth20_prednet_one_ep100.log) | | PhyDNet | 100 epoch | 1xbs16 | 3.1M | 93.6G | 58 | 91.12 | 765.6 | 0.8322 | 23.41 | 0.50155 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_phydnet_one_ep100/kth20_phydnet_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_phydnet_one_ep100/kth20_phydnet_one_ep100.log) | | MAU | 100 epoch | 1xbs16 | 20.1M | 399.0G | 8 | 51.02 | 471.2 | 0.8945 | 26.73 | 0.25442 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_mau_one_ep100/kth20_mau_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_mau_one_ep100/kth20_mau_one_ep100.log) | | MIM | 100 epoch | 1xbs16 | 39.8M | 1099.0G | 17 | 40.73 | 380.8 | 0.9025 | 27.78 | 0.18808 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_mim_one_ep100/kth20_mim_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_mim_one_ep100/kth20_mim_one_ep100.log) | | PredRNN | 100 epoch | 1xbs16 | 23.6M | 2800.0G | 7 | 41.07 | 380.6 | 0.9097 | 27.95 | 0.21892 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_predrnn_one_ep100/kth20_predrnn_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_predrnn_one_ep100/kth20_predrnn_one_ep100.log) | | PredRNN++ | 100 epoch | 1xbs16 | 38.3M | 4162.0G | 5 | 39.84 | 370.4 | 0.9124 | 28.13 | 0.19871 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_predrnnpp_one_ep100/kth20_predrnnpp_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_predrnnpp_one_ep100/kth20_predrnnpp_one_ep100.log) | | PredRNN.V2 | 100 epoch | 1xbs16 | 23.6M | 2815.0G | 7 | 39.57 | 368.8 | 0.9099 | 28.01 | 0.21478 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_predrnnv2_one_ep100/kth20_predrnnv2_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_predrnnv2_one_ep100/kth20_predrnnv2_one_ep100.log) | | DMVFN | 100 epoch | 1xbs16 | 3.5M | 0.88G | 727 | 59.61 | 413.2 | 0.8976 | 26.65 | 0.12842 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_dmvfn_one_ep100/kth20_dmvfn_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_dmvfn_one_ep100/kth20_dmvfn_one_ep100.log) | | SimVP+IncepU | 100 epoch | 2xbs8 | 12.2M | 62.8G | 77 | 41.11 | 397.1 | 0.9065 | 27.46 | 0.26496 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_incepu_one_ep100/kth20_simvp_incepu_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_incepu_one_ep100/kth20_simvp_incepu_one_ep100.log) | | SimVP+gSTA-S | 100 epoch | 4xbs4 | 15.6M | 76.8G | 53 | 45.02 | 417.8 | 0.9049 | 27.04 | 0.25240 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_gsta_one_ep100/kth20_simvp_gsta_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_gsta_one_ep100/kth20_simvp_gsta_one_ep100.log) | | TAU | 100 epoch | 4xbs4 | 15.0M | 73.8G | 55 | 45.32 | 421.7 | 0.9086 | 27.10 | 0.22856 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_tau_one_ep100/kth20_tau_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_tau_one_ep100/kth20_tau_one_ep100.log) | ### **Benchmark of MetaFormers Based on SimVP (MetaVP)** Since the hidden Translator in [SimVP](https://arxiv.org/abs/2211.12509) can be replaced by any [Metaformer](https://arxiv.org/abs/2111.11418) block which achieves `token mixing` and `channel mixing`, we benchmark popular Metaformer architectures on SimVP with 100-epoch training. We provide config files in [configs/kth/simvp](https://github.com/chengtan9907/OpenSTL/tree/OpenSTLv0.3.0/configs/kth/simvp/). | MetaFormer | Setting | GPUs | Params | FLOPs | FPS | MSE | MAE | SSIM | PSNR | LPIPS | Download | |------------------|:---------:|:------:|:------:|:------:|:---:|:-----:|:-----:|:------:|:-----:|:-------:|:------------:| | IncepU (SimVPv1) | 100 epoch | 2xbs8 | 12.2M | 62.8G | 77 | 41.11 | 397.1 | 0.9065 | 27.46 | 0.26496 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_incepu_one_ep100/kth20_simvp_incepu_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_incepu_one_ep100/kth20_simvp_incepu_one_ep100.log) | | gSTA (SimVPv2) | 100 epoch | 2xbs8 | 15.6M | 76.8G | 53 | 45.02 | 417.8 | 0.9049 | 27.04 | 0.25240 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_gsta_one_ep100/kth20_simvp_gsta_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_gsta_one_ep100/kth20_simvp_gsta_one_ep100.log) | | ViT | 100 epoch | 2xbs8 | 12.7M | 112.0G | 28 | 56.57 | 459.3 | 0.8947 | 26.19 | 0.27494 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_vit_one_ep100/kth20_simvp_vit_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_vit_one_ep100/kth20_simvp_vit_one_ep100.log) | | Swin Transformer | 100 epoch | 2xbs8 | 15.3M | 75.9G | 65 | 45.72 | 405.7 | 0.9039 | 27.01 | 0.25178 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_swin_one_ep100/kth20_simvp_swin_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_swin_one_ep100/kth20_simvp_swin_one_ep100.log) | | Uniformer | 100 epoch | 2xbs8 | 11.8M | 78.3G | 43 | 44.71 | 404.6 | 0.9058 | 27.16 | 0.24174 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_uniformer_one_ep100/kth20_simvp_uniformer_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_uniformer_one_ep100/kth20_simvp_uniformer_one_ep100.log) | | MLP-Mixer | 100 epoch | 2xbs8 | 20.3M | 66.6G | 34 | 57.74 | 517.4 | 0.8886 | 25.72 | 0.28799 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_mlpmixer_one_ep100/kth20_simvp_mlpmixer_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_mlpmixer_one_ep100/kth20_simvp_mlpmixer_one_ep100.log) | | ConvMixer | 100 epoch | 2xbs8 | 1.5M | 18.3G | 175 | 47.31 | 446.1 | 0.8993 | 26.66 | 0.28149 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_convmixer_one_ep100/kth20_simvp_convmixer_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_convmixer_one_ep100/kth20_simvp_convmixer_one_ep100.log) | | Poolformer | 100 epoch | 2xbs8 | 12.4M | 63.6G | 67 | 45.44 | 400.9 | 0.9065 | 27.22 | 0.24763 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_poolformer_one_ep100/kth20_simvp_poolformer_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_poolformer_one_ep100/kth20_simvp_poolformer_one_ep100.log) | | ConvNeXt | 100 epoch | 2xbs8 | 12.5M | 63.9G | 72 | 45.48 | 428.3 | 0.9037 | 26.96 | 0.26253 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_convnext_one_ep100/kth20_simvp_convnext_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_convnext_one_ep100/kth20_simvp_convnext_one_ep100.log) | | VAN | 100 epoch | 2xbs8 | 14.9M | 73.8G | 55 | 45.05 | 409.1 | 0.9074 | 27.07 | 0.23116 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_van_one_ep100/kth20_simvp_van_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_van_one_ep100/kth20_simvp_van_one_ep100.log) | | HorNet | 100 epoch | 2xbs8 | 15.3M | 75.3G | 58 | 46.84 | 421.2 | 0.9005 | 26.80 | 0.26921 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_hornet_one_ep100/kth20_simvp_hornet_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_hornet_one_ep100/kth20_simvp_hornet_one_ep100.log) | | MogaNet | 100 epoch | 2xbs8 | 15.6M | 76.7G | 48 | 42.98 | 418.7 | 0.9065 | 27.16 | 0.25146 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_moga_one_ep100/kth20_simvp_moga_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_simvp_moga_one_ep100/kth20_simvp_moga_one_ep100.log) | | TAU | 100 epoch | 2xbs8 | 15.0M | 73.8G | 55 | 45.32 | 421.7 | 0.9086 | 27.10 | 0.22856 | [model](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_tau_one_ep100/kth20_tau_one_ep100.pth) \| [log](https://huggingface.co/dronefreak/OpenSTL-KTH/blob/main/kth20_tau_one_ep100/kth20_tau_one_ep100.log) |
## Structure ``` OpenSTL-KTH/ ├── kth20_tau_one_ep100/ │ ├── model.safetensors # weights (safetensors) │ ├── kth20_tau_one_ep100.pth # original checkpoint, unchanged │ └── kth20_tau_one_ep100.log # original training log (hyper-parameters + test metrics) ├── ... # 23 checkpoint folders in total ├── visualizations/*.gif # upstream ground-truth vs prediction GIFs ├── openstl_hub.py # loader └── assets/demo_banner.mp4 ``` ## Usage The checkpoints need the OpenSTL code they were trained with (branch `OpenSTLv0.3.0`). `openstl_hub.py` rebuilds the network from the hyper-parameters in the checkpoint's own log and loads the weights strictly. ```bash git clone -b OpenSTLv0.3.0 https://github.com/chengtan9907/OpenSTL pip install -e OpenSTL "timm<=0.6.11" huggingface_hub safetensors ``` ```python import torch from huggingface_hub import hf_hub_download hf_hub_download("dronefreak/OpenSTL-KTH", "openstl_hub.py", local_dir=".") from openstl_hub import load_openstl method, args = load_openstl("dronefreak/OpenSTL-KTH", "kth20_tau_one_ep100") T, C, H, W = args.in_shape x = torch.rand(1, args.pre_seq_length, C, H, W) # observed frames, values in [0, 1] y = torch.zeros(1, args.aft_seq_length, C, H, W) # placeholder for the frames to predict with torch.no_grad(): pred = method._predict(x, y) # (1, aft_seq_length, C, H, W) ``` `method.model` is the plain `torch.nn.Module`. RNN-type methods (ConvLSTM, PredRNN family, MIM, MAU, E3D-LSTM) take the target tensor only for its shape at test time. For DMVFN the loader returns only the network (its training wrapper downloads VGG19 for a loss); it predicts one frame: `method.model(torch.cat([x, y], 1), training=False)[-1]`. CrevNet's code calls `.cuda()` internally; on CPU run it inside `with openstl_hub.cuda_to_cpu():`. CrevNet also reads the whole 20-frame clip (`torch.cat([x_all_10, y], 1)` with `x` of length `in_shape[0]`) and its recurrent state is sized for the training batch, so call it with batches of `args.batch_size` (16). To use the weights without OpenSTL's loader: `safetensors.torch.load_file("