Giter Site home page Giter Site logo

choonsik93 / mcpd Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 753 KB

This is the code for Unsupervised 3D Link Segmentation of Articulated Objects with a Mixture of Coherent Point Drift, a.k.a. mcpd.

Home Page: https://choonsik93.github.io/mcpd.github.io/

Python 100.00%

mcpd's Introduction

Unsupervised 3D Link Segmentation of Articulated Objects with a Mixture of Coherent Point Drift

This is the code for Unsupervised 3D Link Segmentation of Articulated Objects with a Mixture of Coherent Point Drift.

This codebase is implemented using CPD.

Setup

The code can be run under any environment with Python 3.7 and above. (It may run with lower versions, but we have not tested it).

We recommend using Miniconda and setting up an environment:

conda create --name mcpd python=3.7

Next, install the required packages:

pip install -r requirements.txt

Running with example data

We provide the running code using an example point clouds.

python train.py \
    --num_mixture 5 \
    --num_iterations 1000 \
    --vis \
    --vis_interval 500 \
    --datadir "data/glasses0" \
    --save \
    --savedir "results/glasses0" \
    --torch

Here's what each option means

  • num_mixture - the number of maximum parts
  • num_ierations - the number of maximum EM steps
  • vis - whether to visualize point clouds during optimization
  • vis_interval - if vis is True, it visualize point clouds in every vis_interval EM steps
  • datadir - the path of point clouds data
  • save - whether to save the optimized results
  • savedir - the path of saved results
  • torch - optimization can be done using only numpy when torch is false, and matrix computation can be done using pytorch when torch is true (much faster)

Basic Usage

Basic usage includes providing any of the registration methods with 2 arrays that are MxN & BxN. E.g., they can have different numbers of points (M & B) but must have the same number of dimensions per point (N).

from mcpd.articulated_registration import ArtRegistration
import numpy as np

# create 3D source point cloud and target point clouds
# M: the number of points in the point cloud
# T: the number of target point clouds
# N:  the number of points in the each target point cloud
M = 2048
N = 2048
T = 5
source = np.random.randn(M, 3)
target = np.random.randn(T, N, 3)

# set parameters
num_mixture = 5
num_iterations = 1000
vis = False
vis_interval = 1000
torch = True

# running mcpd and obtain the optimized results
# R: [T, K, 3, 3] the optimized rotations for each part and each target point cloud
# t: [T, K, 3] the optimized translations for each part and each target point cloud
# Z: [M, K] the optimized decomposition matrix of the source point cloud
reg = ArtRegistration(source, target, num_mixture, max_iterations=num_iterations, vis_interval=vis_interval, vis=vis, gpu=torch)
TY, params = reg.register()
R, t, Z = params

mcpd's People

Contributors

choonsik93 avatar cjg429 avatar

Watchers

 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.