GithubHelp home page GithubHelp logo

Dataset preparation about anchorudf HOT 2 CLOSED

kampelmuehler avatar kampelmuehler commented on August 27, 2024
Dataset preparation

from anchorudf.

Comments (2)

zhaofang0627 avatar zhaofang0627 commented on August 27, 2024 1

Actually, the keypoints/anchorpoints can be easily obtained by the following code:

import numpy as np
import trimesh
from sklearn.cluster import KMeans

sample_num = 100000 
point_num = 600

mesh = trimesh.load(input_mesh_path)
surface_points, _ = trimesh.sample.sample_surface(mesh, sample_num)
kmeans = KMeans(n_clusters=point_num, random_state=0).fit(surface_points)
key_points = kmeans.cluster_centers_

trimesh.Trimesh(vertices=key_points, faces=[]).export(out_file_off)
np.savez(out_file_path, kp=key_points)

from anchorudf.

kampelmuehler avatar kampelmuehler commented on August 27, 2024

Thanks you very much for sharing!

from anchorudf.

Related Issues (20)

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.