Giter Club home page Giter Club logo

digit-depth's Introduction


DIGIT

This codebase allows you:

  • Collect image frames from DIGIT and annotate circles in each frame.
  • Save the annotated frame values into a csv file.
  • Train a baseline MLP model for RGB to Normal mapping.
  • Generate depth maps in real-time using a fast Poisson Solver.
  • Estimate 2D object pose using PCA and OpenCV built-in algorithms.

Currently, labeling circles is done manually for each sensor. It can take up to an hour for annotating 30 images.
This codebase has a script that will replace manual labeling and model training process up to 10 mins.

Visualization

Estimating object pose by fitting an ellipse (PCA and OpenCV):


Depth image point cloud :


Marker movement tracking ( useful for force direction and magnitude estimation):


TODO

  • Add a Pix2Pix model to generate depth maps from RGB images.
  • Add an LSTM model for predicting slip from collected video frames.
  • Add a baseline ResNet based model for estimating total normal force magnitude.

Config files

There are a number of configs params to be edited before you can run the scripts. This is the rough execution order:

  • python scripts/mm_to_pix.py : record a single image and label the distance. Update mm_to_pixel in config file.
  • Update calibration ball diameter.
  • Update your DIGIT serial_num
  • Update gel_width and gel_height
  • Update fps

Usage

Be careful about python path. It is assumed that you run all the scripts from the package folder(/digit-depth)

Change **gel height,gel width, mm_to_pix, base_img_path, sensor :serial_num ** values in rgb_to_normal.yaml file in config folder.

  • pip install .
  • python scripts/record.py : Press SPACEBAR to start recording.
  • python scripts/label_data.py : Press LEFTMOUSE to label center and RIGHTMOUSE to label circumference.
  • python scripts/create_image_dataset.py : Create a dataset of images and save it to a csv file.
  • python scripts/train_mlp.py : Train an MLP model for RGB to Normal mapping.

color2normal model will be saved to a separate folder "models" in /digit-depth/ with its datetime.

After training finishes, update the following config params inside /config/rgb_to_normal.yaml:

  • model_path: absolute path to your trained model
  • base_img_path: absolute path to a single RGB image without any contact

Visualization

  • python scripts/point_cloud.py : Opens up Open3D screen to visualize point clouds generated by depth image
  • python scripts/depth.py : Publishes a ROS topic with the depth image. Modify the params inside for better visualization(threshold values,etc).

You can also try these ROS nodes to publish RGB image and maximum deformation value from depth images inside /scripts/ros folder:

- cd scripts/ros
- python scripts/ros/depth_value_pub.py
- python scripts/ros/digit_image_pub.py

depth_value_pub.py publishes the maximum depth (deformation) value for the entire image when object is pressed. Accuracy depends on your MLP-depth model.

Please star this repo if you like it!

Feel free to post an issue and create PRs.

digit-depth's People

Contributors

vocdex 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.