MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / get_image

Method get_image

eval/utils/utils_odyssey/tokenization_qwen.py:526–534  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

524 self.fig.savefig(filepath)
525
526 def get_image(self):
527 canvas = self.canvas
528 s, (width, height) = canvas.print_to_buffer()
529
530 buffer = np.frombuffer(s, dtype="uint8")
531
532 img_rgba = buffer.reshape(height, width, 4)
533 rgb, alpha = np.split(img_rgba, [3], axis=2)
534 return rgb.astype("uint8")
535
536
537class Visualizer:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected