Update visualization/plot_3d_global.py
Browse files
visualization/plot_3d_global.py
CHANGED
|
@@ -94,16 +94,13 @@ def plot_3d_motion(args, figsize=(10, 10), fps=120, radius=4):
|
|
| 94 |
ax.set_yticklabels([])
|
| 95 |
ax.set_zticklabels([])
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
img = Image.open(io_buf)
|
| 105 |
-
frame = np.array(img)
|
| 106 |
-
io_buf.close()
|
| 107 |
|
| 108 |
plt.close(fig)
|
| 109 |
return frame
|
|
|
|
| 94 |
ax.set_yticklabels([])
|
| 95 |
ax.set_zticklabels([])
|
| 96 |
|
| 97 |
+
# Adjusting frame output for GIF compatibility
|
| 98 |
+
io_buf = io.BytesIO()
|
| 99 |
+
plt.savefig(io_buf, format='png', dpi=96)
|
| 100 |
+
io_buf.seek(0)
|
| 101 |
+
img = Image.open(io_buf)
|
| 102 |
+
frame = np.array(img.convert('RGB'), dtype=np.uint8) # Ensure correct data type and remove alpha channel if present
|
| 103 |
+
io_buf.close()
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
plt.close(fig)
|
| 106 |
return frame
|