Im build an API that generates a video from a NumPy array.
from skimage import img_as_ubyte
import imageio
imageio.mimsave('temp/{}.mp4'.format(id), [img_as_ubyte(frame) for frame in predictions], fps=fps)
however, I need to send this video as a Flask response:
send_file('temp/{}.mp4'.format(id),attachment_filename='{}.mp4'.format(id))
The only way I could find to do this is by saving it in a temp folder and then loading back... The video is very short, is there any way I could do this without saving it ??