Skip to content

Commit

Permalink
Minor Fixes:alembic:
Browse files Browse the repository at this point in the history
  • Loading branch information
AdivarekarBhumit committed Jan 26, 2019
1 parent da51028 commit 932816a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Binary file added images/output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
10 changes: 5 additions & 5 deletions test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
from keras.models import load_model
from keras.optimizers import Adam
from model.iou_loss import IoU
import matplotlib.pyplot as plt

model = load_model('unet_model_whole_100epochs.h5', compile=False)
model.compile(optimizer=Adam(1e-4), loss=IoU, metrics=['binary_accuracy'])

image_name = 'test.tif'
image_name = './images/test.tif'

img = cv2.imread(image_name)
h,w = img.shape[:2]
img = cv2.resize(img, (256,256))
img = img / 255.0
predict = model.predict(img.reshape(1,256,256,3))

output = predict[0]

cv2.imshow('Output', output)
cv2.waitKey(0)
cv2.destroyAllWindows()
output = cv2.resize(output, (w,h))
plt.imsave('output.jpg', output, cmap='gray')

0 comments on commit 932816a

Please sign in to comment.