utils.py 文件源码

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

项目:MIL.pytorch 作者: gujiuxiang 项目源码 文件源码
def url_to_image(url):
    # download the image, convert it to a NumPy array, and then read
    # it into OpenCV format
    resp = urllib.urlopen(url)
    image = np.asarray(bytearray(resp.read()), dtype="uint8")
    image = cv2.imdecode(image, cv2.IMREAD_COLOR)

    # return the image
    return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号