|
| 1 | +# OpenTAD |
| 2 | +# OpenTAD (CUDA 12.5 Compatible) |
| 3 | + |
| 4 | +> **Status**: *alpha* — installation verified on CUDA 12.5; dataset/model pipelines still untested (see **TODO**). |
| 5 | +
|
| 6 | +--- |
| 7 | + |
| 8 | +## Table of Contents |
| 9 | + |
| 10 | +1. [Installation](#installation) |
| 11 | +2. [Usage](#usage) |
| 12 | +3. [Dataset Layout](#dataset-layout) |
| 13 | +4. [`video_TAD.sh` Arguments](#video_TADsh-arguments) |
| 14 | +5. [TODO](#todo) |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +### 1. Create the environment & install **PyTorch** |
| 21 | + |
| 22 | +```bash |
| 23 | +conda create -n opentad python=3.10.12 |
| 24 | +conda activate opentad |
| 25 | + |
| 26 | +# CUDA 12.4 wheels also work on 12.5 |
| 27 | +pip install torch==2.2.2 torchvision==0.17.2 \ |
| 28 | + --extra-index-url https://download.pytorch.org/whl/cu124 |
| 29 | +``` |
| 30 | +> Python < = 3.9 or Python > = 3.11 may fail to install the environment of OpenTAD |
| 31 | +### 2. Install **MMCV** & **MMAction2** |
| 32 | + |
| 33 | +```bash |
| 34 | +pip install openmim |
| 35 | +mim install mmcv==2.1.0 |
| 36 | +mim install mmaction2==1.2.0 |
| 37 | +``` |
| 38 | + |
| 39 | +> **Heads‑up 📌** `mmaction2 == 1.2.0` may raise an `import drn` error. Fix: |
| 40 | +> |
| 41 | +> 1. Clone `https://github.com/open-mmlab/mmaction2` (matching tag). |
| 42 | +> 2. Copy the folder `mmaction/models/localizers/drn` into the same path inside your **conda** site‑packages for `mmaction2`. |
| 43 | +
|
| 44 | +### 3. Install **OpenTAD** |
| 45 | + |
| 46 | +```bash |
| 47 | +git clone git@github.com:sming256/OpenTAD.git |
| 48 | +cd OpenTAD |
| 49 | +pip install -r requirements.txt |
| 50 | +``` |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Usage |
| 55 | + |
| 56 | +The project is wrapped by a single entry‑point script: |
| 57 | + |
| 58 | +```bash |
| 59 | +bash video_TAD.sh |
| 60 | +``` |
| 61 | + |
| 62 | +This will perform: |
| 63 | + |
| 64 | +1. **Feature extraction** (Hugging Face or local `.pth` backbones) |
| 65 | +2. **Training / inference** with an Action Detection model |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## Dataset Layout |
| 70 | + |
| 71 | +``` |
| 72 | +<DATA_PATH> |
| 73 | +└── <dataset_name>/ |
| 74 | + ├── raw_data/ |
| 75 | + │ └── video/ # *.mp4 | *.avi |
| 76 | + ├── feature/ # extracted *.npy features |
| 77 | + └── annotations/ # *.json or *.csv labels |
| 78 | +``` |
| 79 | +如果数据集需要重新下载,或者 annotation 缺失,可以通过 [Encoder_TAD 数据下载指南](https://github.com/FeilongTangmonash/Encoder_TAD/blob/41f101281c6c1259e5a38f8f642e539d0861932e/doc/en/data.md) 来查看如何下载数据。 |
| 80 | + |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## `video_TAD.sh` Arguments |
| 85 | + |
| 86 | +| Variable | Description | Example | |
| 87 | +| --------------------- | ---------------------------------------- | ----------------------------------- | |
| 88 | +| `DATA_PATH` | Root folder of the dataset (see above) | `/data/charades` | |
| 89 | +| `CONFIG_PATH` | Path to the model config you want to run | `configs/charades/temporalmaxer.py` | |
| 90 | +| `CHECKPOINT_PATH` | Where to save / load model checkpoints | `./work_dirs` | |
| 91 | +| **Hugging Face mode** | | | |
| 92 | +| `MODEL_NAME` | HF *short* model id | `videomae-base` | |
| 93 | +| `CKPT` | Full HF repo path | `facebook/videomae-base` | |
| 94 | +| `MODEL_TYPE` | Backbone family name | `videomae` / `internvideo` | |
| 95 | +| **Local `.pth` mode** | | | |
| 96 | +| `MODEL_NAME` | Name accepted by `timm.create_model` | `internvideo2_tem_dense_urope_tube_small_patch16_224_fc_512_v1` | |
| 97 | +| `CKPT` | `.pth` checkpoint path | `~/checkpoints/backbone_tube248_dense_moreepoch.pt` | |
| 98 | +| `MODEL_TYPE` | Custom family name | `univit` | |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## TODO |
| 103 | + |
| 104 | +* [ ] Validate **dataset preprocessing** scripts on target datasets |
| 105 | +* [ ] Benchmark **model training** & ensure checkpoints load correctly |
| 106 | +* [ ] Add CI workflow for CUDA 12.5 container build |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## License |
| 111 | + |
| 112 | +This fork inherits the original [OpenTAD license](LICENSE) unless otherwise noted. |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +*Enjoy Temporal Action Detection!* 🚀 |
| 117 | + |
0 commit comments