Skip to content
/ LSDS Public

Code for the learned slip detection and severity models

Notifications You must be signed in to change notification settings

macs-lab/LSDS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learned Slip-Detection-Severity Framework's Codebase (Click on the link to go to the research paper)

This repository contains minimal code for implementing and trying out Learned Slip-Detection-Severity networks and algorithms. The project is organized to enable easy training, evaluation, and further customization of the codebase.


Slip Severity Training

Prerequisites

  1. Install Dependencies: Ensure you have Python 3.8 or above and install the required Python packages (can be installed in base env but conda env recommended for better project management)
# Step 0: Download Miniconda (or) Ananconda for your linux distribution (Google the steps, pretty straightforward)

# Step 1: Create a new conda environment
conda create -n lsds python=3.8 -y

# Step 2: Activate the environment
conda activate lsds

# Step 3: Use pip to install packages from requirements.txt
pip install -r requirements.txt

# Step 4: Verify the installations (optional)
conda list
  1. Dataset Structure: Ensure your dataset is placed in the datasets/ directory. For example:

    datasets/
    ├── test_1/
    ├── test_2/
    ├── test_3/
    
  2. Environment Variables: Verify dataset paths in the scripts are correct.

In case of Module not found error, go to the LSDS directory and run this in the terminal. This should fix the error.

export PYTHONPATH=$PYTHONPATH:$(pwd)

Running Training

To train the LSTM model for LSDS:

  1. Run the training script:

    python slip_severity/scripts/main.py
  2. By default, training is enabled in the main.py script. Ensure you run the script this way. You can set different flags according to your use case.

    python slip_severity/scripts/main.py --train

Outputs

  • Training:
    • Model weights will be saved to slip_severity/learned_models/<your_model_name>.pth.
    • Training logs will be printed to the console.

Slip Detection Training

Same prerequisites as Slip Severity Training

  1. Dataset Structure: Place your datasets in the datasets/ directory under slip_detection/. The expected directory structure is:

    slip_detection/
    ├── datasets/
    │   ├── NoSlip/
    │   │   ├── file1.csv
    │   │   ├── file2.csv
    │   ├── Slip/
    │   │   ├── file3.csv
    │   │   ├── file4.csv
    │   ├── Grasp/      # If applicable
    │   │   ├── file5.csv
    
  2. Environment Variables: Verify dataset paths in the scripts are correct.


Running Training

To train the Slip Detection model:

  1. Run the training script:

    python scripts/train.py

    By default, the training script will process the datasets, train the models, and save them to the trained_models/ directory.


Outputs

  • Training:
    • Trained models will be saved in the trained_models/ directory, e.g., trained_models/gb_w_grasp.sav.
    • Training metrics and accuracy scores will be printed to the console.

Troubleshooting

  1. Module Not Found: Ensure you're running the scripts from the project root:

    python slip_severity/scripts/main.py
  2. FileNotFoundError: Verify your dataset paths and structure match the expected format.

  3. Custom Dataset: Update dataset paths and feature indices in training script

About

Code for the learned slip detection and severity models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages