You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See for example the following line (86) from run_mission.py #image = Image.frombytes('RGB', (frame.width, frame.height), str(bytearray(frame.pixels)) )
str(bytearray(frame.pixels)) by itself takes 0.056 seconds per call on average and takes up > 50% of my network training time. In particular, it seems that bytearray() is the slow operation.
Is there a way to get around this slowness in python if I still want to use Pillow for image processing? Thanks!
The text was updated successfully, but these errors were encountered:
The boost python vector_indexing_suite that we use to expose vectors as python objects apparently doesn't implement the buffer protocol, which is what things like numpy, PIL etc use for fast memory access (eg to get at the raw bytes without needing to copy).
Hopefully we can use something else to expose the unsigned char vector - if necessary we can create our own Python/C wrapper for that one object manually (without using boost python), though I'm sure there are easier ways...
See for example the following line (86) from run_mission.py
#image = Image.frombytes('RGB', (frame.width, frame.height), str(bytearray(frame.pixels)) )
str(bytearray(frame.pixels))
by itself takes 0.056 seconds per call on average and takes up > 50% of my network training time. In particular, it seems thatbytearray()
is the slow operation.Is there a way to get around this slowness in python if I still want to use Pillow for image processing? Thanks!
The text was updated successfully, but these errors were encountered: