Skip to content

Instantly share code, notes, and snippets.

View wkentaro's full-sized avatar

Kentaro Wada wkentaro

View GitHub Profile
#!/usr/bin/env python3
import sys
import numpy as np
arr = sys.stdin.read().split()
arr = np.array(arr)
import itertools
import random
import time
try:
import numpy as np
import pybullet as p
import pybullet_data
except ImportError:
print("Run `pip install numpy pybullet`")
import numpy as np
import open3d
import trimesh
def from_trimesh(trimesh_geometry):
if isinstance(trimesh_geometry, trimesh.Trimesh):
geometry = open3d.geometry.TriangleMesh()
geometry.vertices = open3d.utility.Vector3dVector(
trimesh_geometry.vertices
import numpy as np
import trimesh
import pickpp
scene = trimesh.Scene()
coord = pickpp.geometry.Coordinate()
axis = trimesh.creation.axis()
import trimesh
import numpy as np
voxel_size = 0.01 # 1cm
encoding = np.random.randint(0, 2, size=(32, 32, 32), dtype=bool)
colors = np.random.random((32, 32, 32, 3))
transform = trimesh.transformations.scale_and_translate(
scale=voxel_size, translate=(0, 0, 0)
)
import numpy as np
import trimesh
import pickpp
models = pickpp.datasets.YCBVideoModelDataset()
# cad_ids = models.get_cad_ids(class_id=15)
cad_ids = models.get_cad_ids(class_id=20)
visual_file = models.get_cad_file_from_id(cad_ids[0])
import numpy as np
import torch
import trimesh
import pickpp
import contrib
np.random.seed(0)
#!/usr/bin/env python
import argparse
import os.path as osp
import sys
import imgviz
try:
import pycocotools.coco
import contrib
import numpy as np
import pickpp
env = contrib.RlightPickAndPlaceEnv(
version="v3", num_instances=1, train=False
).env
env.launch()
import contrib
import numpy as np
import pickpp
import trimesh
env = contrib.RlightPickAndPlaceEnv(version="v3", num_instances=1).env
obs = env.reset()