This repository provides the code for the ICRA 2024 paper "Multimodal Transformer for Real-time Surgical Activity Recognition and Prediction".
This repo is the official code for the ICRA 2024 paper "Multimodal Transformer for Real-time Surgical Activity Recognition and Prediction"
Please follow the below instructions to setup the code in your environment.
-
Anaconda: Make sure to have Anaconda installed on your system. You can download it from Anaconda's official website.
-
Preprocessed Dataset: Obtain the preprocessed dataset required for your project. Refer to the Usage section for detailed instructions on acquiring and incorporating the dataset.
-
Operating System: While the project is designed to be compatible with various operating systems, Ubuntu is the preferred environment.
- Create the conda environment using the environment file.
conda env create -f environment.yml
- Verify PyTorch was installed correclty.
- Place the preprocessed data in the ProcessedData.
- Verify the configuration is as required in
config.py
. Learning parameters are defined inconfig.py
.
To reproduce gesture recognition results use the following command with the original configuration.
Note that the dataset required is not publicly available. Hence, please reach out to the original authors to obtain the data used for this work.
The model parameters and dataloader scripts needs to be changed to suit custom datasets. The current dataloader and config is designed for the above dataset.
python train_recognition.py --model transformer --dataloader v1 --modality 16
Results will be in the results folder specifically in following files.
train_results.json
: Detailed results for each subject in LOUO setup.Train_{task}_{model}_{date-time}.csv
: Final results of the run.
Please feel free to improve the model, add features and use this for research purposes.
If you have any questions, please feel free to reach out using the following email addresses (cjh9fw@virginia.edu, ydq9ag@virginia.edu)
The code for this project is made available to the public via the MIT License.
Special Thanks to Colin Lea for providing features for the dataset and inspiring further development in action segmentation.