win11
cuda 11.7
python 3.8
1.创建新环境
conda create -n mmaction python=3.8
2.激活环境
conda activate mmaction
3.安装pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
4.下载github上的代码
https://github.com/open-mmlab/mmaction2
5.安装mmcv-full
pip install mmcv==2.0.0rc4 -f https://download.openmmlab.com/mmcv/dist/cu117/torch2.0.0/index.html
安装依赖包和mmaction2
pip install -U openmim
mim install mmcv
mim install mmengine
mim install mmdet
mim install mmpose
git clone https://github.com/open-mmlab/mmaction2.git
cd mmaction2
pip install -r requirements.txt
pip install -v -e .
pip install mmaction2
验证安装
为了验证 MMAction2 是否安装正确,我们提供了一些示例代码来运行推理演示。
第一步:下载配置文件和权重文件
mim download mmaction2 --config tsn_imagenet-pretrained-r50_8xb32-1x1x8-100e_kinetics400-rgb --dest .
第二步。 验证推理演示。
如果是从源代码安装的 mmaction2,运行以下命令:
python demo/demo.py tsn_imagenet-pretrained-r50_8xb32-1x1x8-100e_kinetics400-rgb.py tsn_imagenet-pretrained-r50_8xb32-1x1x8-100e_kinetics400-rgb_20220906-2692d16c.pth demo/demo.mp4 tools/data/kinetics/label_map_k400.txt
A将在终端看到前5个标签及其对应的分数。