rishizek / tensorflow-deeplab-v3-plus

DeepLabv3+ built in TensorFlow
MIT License
833 stars 307 forks source link

How to use saved model #49

Closed swarmt closed 5 years ago

swarmt commented 5 years ago

Do you have an example of using the saved model?

What steps are required to pre-process the image?

swarmt commented 5 years ago

For anyone else:

image_filename = 'test_images/DSCF2122_1456200337427.jpg'
image = Image.open(image_filename)
image = np.asarray(image)[np.newaxis, :, :, :]
prediction = predict_fn({'image': image})['classes'][0].astype('uint8')