GithubHelp home page GithubHelp logo

vbhavank / probabilisticactionsegmentrefiner Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 29.76 MB

The following repo contains code for Action Segmentation Regulator that uses Probabilistic models to detect erroneous segmentstions

Python 100.00%

probabilisticactionsegmentrefiner's Introduction

ProbabilisticActionSegmentRefiener

The following repo contains code for Action Segmentation Regulator that uses Probabilistic models to detect erroneous action segmentstions and OOD data instances

We followed the Diffusion Action Segmentation (ICCV 2023) paper and used their code at DiffAct as a base for our work.

Environment

Python 3.9+ Pytorch Latest version CUDA 11.3+ networkx numpy scipy matplotlib tqdm json

Data

  • Download features of 50salads, GTEA and Breakfast provided by MS-TCN and ASFormer: [Link1] [Link2]
  • Unzip the data, rename it to "datasets" and put into the current directory
ProbabilisticActionSegmentRefiner/
├── datasets
│   ├── 50salads
│   │   ├── features
│   │   ├── groundTruth
│   │   ├── mapping.txt
│   │   └── splits
│   ├── breakfast
│   │   ├── features
│   │   ├── groundTruth
│   │   ├── mapping.txt
│   │   └── splits
│   └── gtea
│       ├── features
│       ├── groundTruth
│       ├── mapping.txt
│       └── splits
├── main.py
├── model.py
└── ...

Run the masked inferences

  • Generate config files by python default_configs.py
  • Run python main.py --config configs/some_config.json --device gpu_id --is_train 0
  • If you want to train the model again, set --is_train 1
  • Trained models and logs will be saved in the result folder

OOD experiment

  • Run python transitiondurationAbalation.py for GTEA dataset
  • Run python transitiondurationBreakfastAblation.py for Breakfast dataset
  • Run python transitiondurationSaladAblation.py for 50salads dataset

Model Training

  • To train a model from scratch, please use the corresponding JSON for your dataset and split. Here, we give an example of training on GTEA Split 1. In the end, we use the best model for our inference.
python main.py --config configs/GTEA-Trained-S1.json --is_train 1
  • We also provide some trained models in the trained_models folder to use for inference

Cross Domain Inference

  • Please use the --config and --model_path from the source domain and --dataset_name from the target domain. The following code will save the result to the folder result1/50salads-Trained-S1-Tested-GTEA-S1.
python main1.py --config configs/50salads-Trained-S1.json --result_dir result1 --sample_rate 1 --action test --naming 50salads-Trained-S1-Tested-GTEA-S1 --model_path trained_models/50salads-Trained-S1/release.model --dataset_name gtea

Visualization Fig.5

  • By default, it takes results in the rafid/GTEA-Trained-S1/ and saves the plot in the rafid/GTEA-Trained-S1/plot. You can change to a different dataset or split.
python rafid_v1.py --split 1

probabilisticactionsegmentrefiner's People

Contributors

tqosu avatar vbhavank avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.