How to show the image of predict.py in colab

!python predict.py
Input image filename:

I want to im.show the output picture but it repeats

from pspnet import PSPNet

from PIL import Image

pspnet = PSPNet()

while True:

img = input('Input image filename:')

try:

    image = Image.open(img)

except:

    print('Open Error! Try again!')

    continue

else:

    r_image = pspnet.detect_image(image)

    r_image.show()

Does it display the output image more than once? Can you also attach a screenshot so that it’s easier to understand?