### Install Project Dependencies Source: https://github.com/minghchen/carl_code/blob/master/README.md Installs necessary packages for the project using conda and pip. It sets up a conda environment and installs PyTorch, torchvision, cudatoolkit, and other required libraries from requirements.txt. ```bash # create conda env and install packages conda create -y --name carl python=3.7.9 conda activate carl # The code is tested on cuda10.1-cudnn7 and pytorch 1.6.0 conda install -y pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1 -c pytorch conda install -y conda-build ipython pandas scipy pip av -c conda-forge # install pip packages pip install --upgrade pip pip install -r requirements.txt ``` -------------------------------- ### Launch TensorBoard for Visualization Source: https://github.com/minghchen/carl_code/blob/master/README.md This command starts TensorBoard, a visualization tool for TensorFlow, which is commonly used to monitor training progress and visualize results from machine learning experiments. It points to the log directory where experiment data is stored. ```bash tensorboard --logdir=~/tmp/scl_transformer_logs ``` -------------------------------- ### Start Evaluation with CARL Source: https://github.com/minghchen/carl_code/blob/master/README.md This command initiates the evaluation process for the CARL method. It utilizes PyTorch's distributed launch utility and specifies configuration files and log directories for the evaluation. ```bash python -m torch.distributed.launch --nproc_per_node 1 evaluate.py --workdir ~/datasets --cfg_file ./configs/scl_transformer_config.yml --logdir ~/tmp/scl_transformer_logs ``` -------------------------------- ### Prepare FineGym Dataset Source: https://github.com/minghchen/carl_code/blob/master/README.md Scripts to prepare the FineGym dataset. This involves downloading raw videos (potentially using youtube-dl) and then running a processing script to standardize resolution and frame rate. ```bash python dataset_preparation/finegym_process.py ``` -------------------------------- ### Download Pretrained ResNet50 Weights Source: https://github.com/minghchen/carl_code/blob/master/README.md Provides a link to download ResNet50 backbone weights pre-trained with BYOL. The downloaded weights should be placed in a specific directory for initialization. ```bash # Download the pretrained weight at [pretrained_models](https://drive.google.com/drive/folders/1VwC4x5xj4Ho3bnh9wZZx--iYhIUguR-q?usp=sharing), and place it at /home/username/datasets/pretrained_models. ``` -------------------------------- ### Prepare Pouring Dataset Source: https://github.com/minghchen/carl_code/blob/master/README.md Scripts to prepare the Pouring dataset. This involves downloading the data using a shell script and then converting TFRecords to videos. ```bash sh dataset_preparation/download_pouring_data.sh python dataset_preparation/tfrecords_to_videos.py ``` -------------------------------- ### Prepare PennAction Dataset Source: https://github.com/minghchen/carl_code/blob/master/README.md Scripts to prepare the PennAction dataset. This involves downloading the original dataset and label files, then running Python scripts to convert them into TFRecords and subsequently into videos. ```bash python dataset_preparation/penn_action_to_tfrecords.py python dataset_preparation/tfrecords_to_videos.py ``` -------------------------------- ### Train Model on FineGym Dataset Source: https://github.com/minghchen/carl_code/blob/master/README.md Initiates the training process for the FineGym dataset using distributed training. It specifies the working directory, configuration file, and log directory. It also provides a tip for adjusting the number of data workers to prevent CPU overload. ```bash python -m torch.distributed.launch --nproc_per_node 1 train.py --workdir ~/datasets --cfg_file ./configs/scl_transformer_finegym_config.yml --logdir ~/tmp/scl_transformer_finegym_logs # Tips: The default number of data worker is 4, which might causes CPU overloaded for some Machines. In this case, you can set --opt DATA.NUM_WORKERS 1. ``` -------------------------------- ### Pretrain Model on Kinetics400 Dataset Source: https://github.com/minghchen/carl_code/blob/master/README.md Initiates the pretraining process on the Kinetics400 dataset using distributed training. It specifies the working directory, configuration file, and log directory. ```bash python -m torch.distributed.launch --nproc_per_node 1 train.py --workdir ~/datasets --cfg_file ./configs/scl_transformer_k400_pretrain_config.yml --logdir ~/tmp/scl_transformer_k400_pretrain_logs ``` -------------------------------- ### Train Model on PennAction Dataset Source: https://github.com/minghchen/carl_code/blob/master/README.md Initiates the training process for the PennAction dataset using distributed training. It specifies the working directory, configuration file, and log directory. ```bash python -m torch.distributed.launch --nproc_per_node 1 train.py --workdir ~/datasets --cfg_file ./configs/scl_transformer_action_config.yml --logdir ~/tmp/scl_transformer_action_logs ``` -------------------------------- ### Train Model on Pouring Dataset Source: https://github.com/minghchen/carl_code/blob/master/README.md Initiates the training process for the Pouring dataset using distributed training. It specifies the working directory, configuration file, and log directory. Optional arguments can adjust batch size and epochs. ```bash python -m torch.distributed.launch --nproc_per_node 1 train.py --workdir ~/datasets --cfg_file ./configs/scl_transformer_config.yml --logdir ~/tmp/scl_transformer_logs # The config can be changed by adding --opt TRAIN.BATCH_SIZE 1 TRAIN.MAX_EPOCHS 500 ``` -------------------------------- ### CARL Citation Source: https://github.com/minghchen/carl_code/blob/master/README.md This is the BibTeX entry for the CARL paper, providing citation details for academic referencing. ```bibtex @inproceedings{chen2022framewise, title={Frame-wise Action Representations for Long Videos via Sequence Contrastive Learning}, author={Minghao Chen and Fangyun Wei and Chong Li and Deng Cai}, booktitle={CVPR}, year={2022} } ``` -------------------------------- ### Python Project Dependencies Source: https://github.com/minghchen/carl_code/blob/master/requirements.txt This snippet lists the Python packages and their exact versions as specified in the project's requirements. These packages cover various functionalities including machine learning (tensorflow-gpu, scikit-learn, Keras-Applications), data manipulation (numpy, pandas), image processing (opencv-python, imageio), and development utilities (docker, jupyterlab). ```python absl-py==0.13.0 Cython==0.29.24 docker==4.4.4 dtw==1.4.0 easydict==1.9 einops==0.3.0 gpustat==0.6.0 h5py==2.10.0 imageio==2.9.0 imageio-ffmpeg==0.4.4 iopath==0.1.9 jupyterlab==3.0.16 Keras-Applications==1.0.8 Markdown==3.3.4 matplotlib==3.4.2 moviepy==1.0.3 ninja==1.10.0.post3 numba==0.53.1 opencv-python==4.5.3.56 prettytable==2.1.0 PyYAML==5.4.1 scikit-build==0.11.1 scikit-learn==0.24.2 seaborn==0.11.2 simplejson==3.17.3 spacy==3.1.1 tensorboard==2.5.0 tensorboardX==2.4 tensorflow-gpu==2.3.0 timm==0.3.2 yacs==0.1.8 youtube-dl==2021.6.6 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.