from tensorflow.python.keras.preprocessing.image import load_img,img_to_array

def main():
    #tagert_size 修改图像大小
    image = load_img("./bus/300.jpg",target_size=(50,50))
    print(image)
    image.show()
    print(img_to_array(image))


if __name__ == '__main__':
    main()

                                  TensorFlow keras读取图片_python

 

     

多思考也是一种努力,做出正确的分析和选择,因为我们的时间和精力都有限,所以把时间花在更有价值的地方。