logo
Loading...

Image.open(BytesIO(response.content)) - Cupoy

day 3 homework 2Image.open(BytesIO(response.conten...

ml100-2,bytesio,ml100-2-d03

Image.open(BytesIO(response.content))

2019/05/02 07:57 下午
機器學習共學討論版
Yueh-Ying Song
觀看數:3
回答數:3
收藏數:0
ml100-2
bytesio
ml100-2-d03

day 3 homework 2Image.open(BytesIO(response.content))這行 放到 function 
def img2arr_fromURLs(url_list, resize = False):
    img_list = list()
    img = np.empty([2,2])
    for url in url_list:
        print(url)
        response = requests.get(url)
        img = Image.open(BytesIO(response.content))
        type(img)
        img_list.append(img)
        print(len(img_list))