python-imageio

ffmpeg installation on macOS for MoviePy fails with SSL error

柔情痞子 提交于 2019-12-09 10:16:49
问题 I'm trying to write a Python program that uses MoviePy on Mac OS 10.11.16 to convert an MP4 file to GIF. I use: import moviepy.editor as mp and I get an error saying I need to call imageio.plugins.ffmpeg.download() so I can download ffmpeg. I use: import imageio imageio.plugins.ffmpeg.download() which gives me the following error: Imageio: 'ffmpeg.osx' was not found on your computer; downloading it now. Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate

ValueError: Could not find a format to read the specified file in mode 'i'

这一生的挚爱 提交于 2019-12-07 12:21:00
问题 I am trying to read a png file into a python-flask application running in docker and am getting an error that says ValueError: Could not find a format to read the specified file in mode 'i' i have uploaded a file using an HTML file and now i am trying to read it for further processing. i see that scipy.misc.imread is deprecated and i am trying to replace this with imageio.imread if request.method=='POST': file = request.files['image'] if not file: return render_template('index.html', label=

VOC2012: PIL Image.open converts PNG to 2d array

风流意气都作罢 提交于 2019-12-02 01:59:16
I am working with VOC2012 dataset. The input image is in PNG format which has a shape of (375, 500, 4) when I use imageio to open the image. When I use PIL to open the image, then suddenly the shape becomes (500, 375). PNG images should have four dimensions on the last axis: r g b & alpha. The image is obviously colored image, so it should have 3 dimensions (height, width, depth). PIL seems to suggest that it only has two dimensions: width & height. Can PNG images be represented by a 2d array? Please help! So lost at the moment. Thanks! from PIL import Image from keras.preprocessing.image

transparent background in gif using Python Imageio

六月ゝ 毕业季﹏ 提交于 2019-11-29 21:16:42
问题 Basically I am using following piece of code to make gif out of images, my images are png with transparent background but the gif is with black background. I dont know how to make the gif with transparent background. #gif writer with io.get_writer('my.gif', mode='I', duration=0.1) as writer: for filename in file_names: image = io.imread(filename) writer.append_data(image) #writer.close() where filenames is an array with all the names of file to be used. 回答1: try PIL from PIL import Image def