rishizek/tensorflow-deeplab-v3-plus

How to use saved model

swarmt opened this issue · 1 comments

Do you have an example of using the saved model?

What steps are required to pre-process the image?

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')