working weight learning
This commit is contained in:
@@ -2,6 +2,7 @@ import json
|
||||
import numpy as np
|
||||
import tensorflow as tf
|
||||
import scipy as sp
|
||||
import cmapy as cm
|
||||
import plotly.graph_objects as go
|
||||
from plotly.subplots import make_subplots
|
||||
|
||||
@@ -216,6 +217,35 @@ def plot_3d(mesh_gt, mesh_pred_unposed, faces, collision, collision_faces, colli
|
||||
return fig
|
||||
|
||||
|
||||
def plot_weights(weights, body, faces):
|
||||
fig = go.Figure()
|
||||
colors = np.array([cm.color('jet', 1 - w) for w in weights.numpy()])
|
||||
|
||||
# if flip_xy:
|
||||
# mesh_gt = flip_axis(mesh_gt)
|
||||
# mesh_pred_unposed = flip_axis(mesh_pred_unposed)
|
||||
# collision = flip_axis(collision, ind=14475)
|
||||
|
||||
fig.add_trace(go.Mesh3d(
|
||||
x=body[:,0],
|
||||
y=body[:,2],
|
||||
z=body[:,1],
|
||||
i = faces[:,0],
|
||||
j = faces[:,1],
|
||||
k = faces[:,2],
|
||||
vertexcolor=colors
|
||||
))
|
||||
|
||||
|
||||
fig.update_layout(scene_aspectmode='manual', scene_aspectratio=dict(x=1, y=1, z=1),)
|
||||
helper = dict(xaxis = dict(nticks=4, range=[-1,1],),
|
||||
yaxis = dict(nticks=4, range=[-1,1],),
|
||||
zaxis = dict(nticks=4, range=[-1,1],),)
|
||||
fig.update_layout(scene = helper,)
|
||||
|
||||
return fig
|
||||
|
||||
|
||||
def plot_3d_collision(gt, collision_1, collision_2, collision_faces, collision_color, flip_xy=False):
|
||||
fig = make_subplots(rows=1, cols=3, start_cell="top-left", specs = [ [{ 'type': 'scene' } for _ in range(3)] ])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user