Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

การดาวน์โหลดภาพเดี่ยวทดสอบโมเดลด้วย TensorFlow และ Python


แนวคิด

ใช้ get_file ดาวน์โหลดภาพเดี่ยวจาก Google API มาทดสอบโมเดล

แนวคิด Transfer Learning, TensorFlow Hub, Google Colab เหมือนเดิม

ตัวอย่างโค้ด

print("Run it on a single image")
grace_hopper = tf.keras.utils.get_file('image.jpg',
    'https://storage.googleapis.com/download.tensorflow.org/example_images/grace_hopper.jpg')
grace_hopper = Image.open(grace_hopper).resize(IMAGE_SHAPE)
grace_hopper

Credit: TensorFlow Tutorials

ผลลัพธ์

Run it on a single image
Downloading data from https://storage.googleapis.com/download.tensorflow.org/example_images/grace_hopper.jpg
65536/61306 [================================] - 0s 0us/step

การดาวน์โหลดภาพเดี่ยวทดสอบโมเดลด้วย TensorFlow และ Python

คำอธิบาย

  • ดาวน์โหลดข้อมูลภาพเดี่ยว
  • รันโมเดล pre-trained บนภาพเดี่ยว
  • แสดงภาพบนคอนโซล