sketch2pose / src /utils.py
kbrodt's picture
Upload utils.py
38e46a7
raw
history blame
556 Bytes
import json
import pickle
import trimesh
def load_json(path):
with open(path) as f:
return json.load(f)
def save_json(o, path):
with open(path, "w") as f:
json.dump(o, f)
def load_pkl(path):
with open(path, "rb") as f:
return pickle.load(f)
def save_pkl(o, path):
with open(path, "wb") as f:
pickle.dump(o, f)
def save_mesh_with_colors(vertices, faces, save_path):
mesh = trimesh.Trimesh(
vertices=vertices,
faces=faces,
process=False,
)
mesh.export(save_path)