Hi all,
I'm currently drawing a graph snapshot to an image file, then loading it
back in and writing that image to a video with OpenCV. This I/O process is
a big bottleneck. Does anyone know a faster way to do this? Are there ways
in graph-tool to speed this up or skip the I/O alltogether?
- Lex
attachment.html (373 Bytes)
`graph_draw` accepts either a file name or a file object. I would investigate passing a BytesIO (https://docs.python.org/3/library/io.html#io.BytesIO) object to the `output` parameter of `graph_draw` (instead of a filename).
You can then read from the BytesIO object (for instance, to a numpy array) and then pass it to OpenCV. This should avoid disk I/O entirely.
Joe
attachment.html (3.33 KB)