junxnone / tio

Log
Other
10 stars 5 forks source link

image-segmentation-keras #584

Open junxnone opened 4 years ago

junxnone commented 4 years ago

Implementation of Segnet, FCN, UNet , PSPNet and other models in Keras.

Reference

UseCase

Predict

from keras_segmentation.pretrained import pspnet_50_ADE_20K 
import cv2
import matplotlib.pyplot as plt

model = pspnet_50_ADE_20K() # load the pretrained model trained on ADE20k dataset
input_img = "image-segmentation-keras/sample_images/3_input.jpg"
out = model.predict_segmentation(
    inp= input_img,
    out_fname="out.png"
)
org_img = cv2.imread(input_img)
plt.figure(figsize=(20,10))
plt.subplot(1,2,1)
plt.imshow(org_img)
oimg = cv2.imread('./out.png')
plt.subplot(1,2,2)
plt.imshow(oimg)

image

junxnone commented 4 years ago

TO-DO