pytorch-deeplab-xception icon indicating copy to clipboard operation
pytorch-deeplab-xception copied to clipboard

Where is the saved data

Open QuanPham99 opened this issue 5 years ago • 2 comments

Hi, I am wondering after training, where will the images are saved to? As well as when I testing my own image, where will the output image will be set ?

Thank you

QuanPham99 avatar Aug 20 '19 09:08 QuanPham99

I suppose in train.py image in function validation you can save ndarray pred and convert it to an image but I don't know how to save it as a mask image because it is a ndarray with shape (8,513,513)

YoruCathy avatar Aug 29 '19 01:08 YoruCathy

I just modified train.py to save a predicted image.

image

Inserted this code as in the image.

            for each_pred in pred:
                rgb_img = decode_segmap(each_pred, 'cityscapes')
                rgb_img = Image.fromarray((rgb_img * 255).astype(np.uint8))
                rgb_img.save('x.jpg')
                print('Saved image prediction')

Also imported these items in train.py

from dataloaders.utils import decode_segmap
from PIL import Image

Here I will be saving over and over on the same file for all images. You can modify the save file path according to your wish.

Sample saved image image

sreeragh-ar avatar Dec 19 '20 12:12 sreeragh-ar