pytorch-deeplab-xception
pytorch-deeplab-xception copied to clipboard
Where is the saved data
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
I suppose in train.py
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)
I just modified train.py to save a predicted 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