Skip to the content.

Action Recognition

Dataset and Code

Structure of Action Recognition Dataset

Evaluation Metric

Instructions to run Action Recognition models

This code was separately tested on RTX 3090, and 3080Ti using CUDA10.2.

  1. To prepare the environment, refer to https://github.com/facebookresearch/SlowFast. (Please use the earlier version from https://github.com/facebookresearch/SlowFast/tree/haooooooqi-patch-2 as the latest version in May 2022 does not work). We used Facebook Research’s SlowFast code for I3D, SlowFast, X3D.

  2. Move and replace files according to the directories in $DIR_AK/action_recognition/code/code_new:
    • Helper script to move / create symbolic links to files
      • Remember to change the root directory $DIR_ROOT in $DIR_AK/action_recognition/code/code_new/prepare_dir_AR.sh
      • bash $DIR_AK/action_recognition/code/code_new/prepare_dir_AR.sh
  3. Run the model using the following command
    • python ./tools/run_net.py --cfg configs/AK/SLOWFAST_8x8_R50.yaml

Instructions to handle long-tailed distribution

  1. Move and replace files according to the directories in $DIR_AK/action_recognition/code/code_new:

</details>

Solutions to potential issues:

Click to expand 1. TypeError: __init__() got an unexpected keyword argument 'num_sync_devices' * Use the earlier version <https://github.com/facebookresearch/SlowFast/tree/haooooooqi-patch-2> 2. Searching for PIL Reading https://pypi.org/simple/PIL/ No local packages or working download links found for PIL error: Could not find suitable distribution for Requirement.parse('PIL') * https://github.com/facebookresearch/SlowFast/pull/463 * Change `PIL` to `Pillow` (Line 26) in `$DIR_SLOWFAST/setup.py` * Helper script will help replace this file. Remember to run helper script before building slowfast. 3. ImportError: cannot import name 'cat_all_gather' from 'pytorchvideo.layers.distributed' (`$DIR_anaconda_envs`/slowfast/lib/python3.8/site-packages/pytorchvideo/layers/distributed.py) * Download and replace the file with <https://github.com/facebookresearch/pytorchvideo/raw/main/pytorchvideo/layers/distributed.py> 4. TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are: 1. Downgrade the protobuf package to 3.20.x or lower. 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower). More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates * `pip install protobuf==3.20.0` * Helper script will help install this. Remember to activate the environment before running the helper script. 5. Configuration description * https://github.com/facebookresearch/SlowFast/blob/84cb0ac1780685525aecf51a10cc5ed86ec22705/slowfast/config/defaults.py