Comments (3)
The main script is shown in following lines. You need to put this .py under this repo. For DexYCB, you need to modify the script and generate meshes from mano parameters yourself.
import os
from tqdm import tqdm
import numpy as np
import open3d
from obman.obman import ObMan
MANO_WATERTIGHT_OBJ_PATH = './MANO_WATERTIGHT.obj'
def generate_open3d_mesh(vertices, faces, category = 'hand'):
mesh = open3d.geometry.TriangleMesh()
mesh.vertices = open3d.utility.Vector3dVector(np.copy(vertices))
if category == 'hand':
mesh.triangles = open3d.utility.Vector3iVector(np.copy(faces))
elif category == 'obj':
mesh.triangles = open3d.utility.Vector3iVector(np.copy(faces))
return mesh
parser = argparse.ArgumentParser()
parser.add_argument('--root', default="/home2/zerui/dataset/obman/obman", required=False, help="Path to dataset root")
parser.add_argument(
'--shapenet_root', default="/home2/zerui/dataset/ShapeNetCore.v2", required=False, help="Path to root of ShapeNetCore.v2")
parser.add_argument(
'--split', type=str, default='train', help='Usually [train|test]')
parser.add_argument('--sides', type=str, default='left')
args = parser.parse_args()
pose_dataset = ObMan(args.root, args.shapenet_root, split=args.split, use_cache=False)
os.makedirs(os.path.join(args.root, args.split, 'mesh_hand'), exist_ok=True)
os.makedirs(os.path.join(args.root, args.split, 'mesh_obj'), exist_ok=True)
for i in tqdm(range(len(pose_dataset.image_names))):
filename = pose_dataset.image_names[i].split('/')[-1].split('.')[0]
hand_verts3d = pose_dataset.get_verts3d(i)
hand_faces = np.load('closed_fmano.npy')
obj_verts3d, obj_faces = pose_dataset.get_obj_verts_faces(i)
hand_mesh = generate_open3d_mesh(hand_verts3d, hand_faces, 'hand')
obj_mesh = generate_open3d_mesh(obj_verts3d, obj_faces, 'obj')
open3d.io.write_triangle_mesh(os.path.join(args.root, args.split, 'mesh_hand', filename +'.obj'), hand_mesh)
from alignsdf.
Hi,
Thanks for your interests! For ObMan, I mainly use this toolbox. For the mesh_obj folder, you could have a look at this function about how to load object vertices and faces. Since ObMan annotations provide hand vertices, you could use the closed MANO faces here for the hand mesh. When getting vertices and faces, I use trimesh to export the final mesh. For DexYCB, I mainly use the script provided by the official toolbox to generate the hand mesh and the object mesh.
Hope it helps.
from alignsdf.
Hi,
Thank you very much for answering me.
Because I'm new in this domain, after few days trying, I'm still confusing about the data format, file extention and layout in mesh_hand and mesh_obj folders. Can you please give an example?
And for DexYCB, the script only gives some information of the 1000th example in each split, e.g., label file, mano_side, mano_betas, etc. It cannot directly generate meshes. Does this mean I need to generate meshes with the mano parameters by myself?
from alignsdf.
Related Issues (20)
- Question Regarding the SDF Scale Factor HOT 8
- Question about the training epochs HOT 4
- Issue related to DexYCB dataset cropping HOT 4
- Dataset download HOT 2
- occur "do not support renderer in this machine" problem HOT 2
- occur "do not support renderer in this machine" problem
- The difference between sdf_hand and sdf_hand_mini HOT 6
- Test the model on novel images
- **源 HOT 5
- Training HOT 3
- Issue related to the result of Ote HOT 2
- mesh_hand and mesh_obj folders HOT 1
- Pre-trained weights of AlignSDF HOT 1
- How to evaluate like Table 4 in ECCV paper? HOT 1
- 'obj_corners_3d' and 'obj_rest_corners_3d' in obman meta file HOT 4
- Hi, when i try to run the code, i meet some problems. HOT 9
- Missing test/mesh_obj_rest/ for obman test HOT 3
- How to generate dexycb split names? HOT 2
- Dex_YCB dataset organization HOT 2
- Question Regarding the SDF Sampling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alignsdf.