warisqr007 commited on
Commit
12cdb01
·
verified ·
1 Parent(s): 490f512

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- """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)."""
 
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)."""