data_utils.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:tflearn 作者: tflearn 项目源码 文件源码
def load_image(in_image):
    """ Load an image, returns PIL.Image. """
    # if the path appears to be an URL
    if urlparse(in_image).scheme in ('http', 'https',):
        # set up the byte stream
        img_stream = BytesIO(request.urlopen(in_image).read())
        # and read in as PIL image
        img = Image.open(img_stream)
    else:
        # else use it as local file path
        img = Image.open(in_image)
    return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号