Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,12 +64,12 @@ SAMPLE_RATE = int(os.getenv("SAMPLE_RATE", "16000"))
|
|
| 64 |
# grc_utils._json_schema_to_python_type = patched__json_schema_to_python_type
|
| 65 |
|
| 66 |
|
| 67 |
-
def _fig_to_rgb_array(fig):
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
|
| 74 |
def _fig_to_rgb_array(fig):
|
| 75 |
"""Convert a matplotlib figure to an RGB numpy array (robust across matplotlib versions)."""
|
|
|
|
| 64 |
# grc_utils._json_schema_to_python_type = patched__json_schema_to_python_type
|
| 65 |
|
| 66 |
|
| 67 |
+
# def _fig_to_rgb_array(fig):
|
| 68 |
+
# """Convert a matplotlib figure to an RGB numpy array."""
|
| 69 |
+
# fig.canvas.draw()
|
| 70 |
+
# w, h = fig.canvas.get_width_height()
|
| 71 |
+
# img = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8).reshape(h, w, 3)
|
| 72 |
+
# return img
|
| 73 |
|
| 74 |
def _fig_to_rgb_array(fig):
|
| 75 |
"""Convert a matplotlib figure to an RGB numpy array (robust across matplotlib versions)."""
|