Upload 11 files
Browse files- .gitattributes +1 -0
- _preview.py +39 -0
- character_native_rig.glb +3 -0
- motion_1.bvh +0 -0
- motion_1.npz +3 -0
- motion_1_preview.mp4 +3 -0
- motion_2.bvh +0 -0
- motion_2.npz +3 -0
- motion_2_preview.mp4 +3 -0
- motion_3.bvh +0 -0
- motion_3.npz +3 -0
- motion_3_preview.mp4 +3 -0
.gitattributes
CHANGED
|
@@ -59,3 +59,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
base_basic_pbr.glb filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
base_basic_pbr.glb filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
character_native_rig.glb filter=lfs diff=lfs merge=lfs -text
|
_preview.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import numpy as np
|
| 3 |
+
import matplotlib
|
| 4 |
+
matplotlib.use("Agg")
|
| 5 |
+
import matplotlib.pyplot as plt
|
| 6 |
+
import imageio.v2 as imageio
|
| 7 |
+
npz_path, mp4_path = sys.argv[1], sys.argv[2]
|
| 8 |
+
title = sys.argv[3] if len(sys.argv) > 3 else ""
|
| 9 |
+
d = np.load(npz_path)
|
| 10 |
+
pj = d["posed_joints"]
|
| 11 |
+
T = pj.shape[0]
|
| 12 |
+
stride = max(1, T // 240)
|
| 13 |
+
idx = list(range(0, T, stride))
|
| 14 |
+
lo = pj[idx].reshape(-1, 3).min(0); hi = pj[idx].reshape(-1, 3).max(0)
|
| 15 |
+
c = (lo + hi) / 2; r = max((hi - lo).max() / 2, 0.5)
|
| 16 |
+
pairs = []
|
| 17 |
+
for key in ("parents", "parent", "joint_parents", "bones", "edges"):
|
| 18 |
+
if key in d.files:
|
| 19 |
+
par = np.asarray(d[key]).ravel()
|
| 20 |
+
if len(par) == pj.shape[1]:
|
| 21 |
+
pairs = [(int(p), j) for j, p in enumerate(par) if int(p) >= 0]
|
| 22 |
+
break
|
| 23 |
+
frames = []
|
| 24 |
+
fig = plt.figure(figsize=(5, 5))
|
| 25 |
+
for t in idx:
|
| 26 |
+
plt.clf()
|
| 27 |
+
ax = fig.add_subplot(111, projection="3d")
|
| 28 |
+
p3 = pj[t]
|
| 29 |
+
for a, b in pairs:
|
| 30 |
+
ax.plot([p3[a,0], p3[b,0]], [p3[a,1], p3[b,1]], [p3[a,2], p3[b,2]], lw=1.5)
|
| 31 |
+
ax.scatter(p3[:,0], p3[:,1], p3[:,2], s=8)
|
| 32 |
+
ax.set_xlim(c[0]-r, c[0]+r); ax.set_ylim(c[1]-r, c[1]+r); ax.set_zlim(c[2]-r, c[2]+r)
|
| 33 |
+
ax.view_init(elev=12, azim=-60)
|
| 34 |
+
ax.set_title((title[:60] + f" f{t}/{T}") if title else f"f{t}/{T}")
|
| 35 |
+
fig.canvas.draw()
|
| 36 |
+
frames.append(np.asarray(fig.canvas.buffer_rgba())[..., :3].copy())
|
| 37 |
+
plt.close(fig)
|
| 38 |
+
imageio.mimsave(mp4_path, frames, fps=30, codec="libx264", quality=7)
|
| 39 |
+
print("preview OK:", mp4_path, len(frames), "frames")
|
character_native_rig.glb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88b3dddb8f027a1a2ca4d3aec393722dc00c53f76eefb708d14b50acc1459533
|
| 3 |
+
size 57854036
|
motion_1.bvh
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
motion_1.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d288a9c0a759ea62c5a41b59dc6e7c73ee0ed890c1c4eebbb4adfcd22651e89d
|
| 3 |
+
size 1172930
|
motion_1_preview.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:857cc36981793c58e2c8afc1fd691e0dcdc47a65948f94af781d23d9e2723728
|
| 3 |
+
size 91603
|
motion_2.bvh
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
motion_2.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bf81d9d0a2b6a781a8eedabd3e7a30cd43c3fb2ead3daa26e39d2924f581b4c6
|
| 3 |
+
size 782570
|
motion_2_preview.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bca41c9b1ed9d0cb45b3d4fd71b2595eba5ba0c6be339b9a318b4fe5a9a07b2d
|
| 3 |
+
size 104358
|
motion_3.bvh
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
motion_3.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:beca0dd81d50b3b23fc5386a10ddac57756ba519208c9d15ac56a6a03f5415dc
|
| 3 |
+
size 1172930
|
motion_3_preview.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfe062ffc7568a84819df55157a6eca17b0c2fb6d06c850852349805973fd86b
|
| 3 |
+
size 170895
|