Unet-learner predict's return values

(Nitin Pasumarthy) #1

Have 3 questions from lesson 7 on super resolution notebook.

p,img_hr,b = my_unet_learner.predict(img)

The file sizes in bytes for p.save("my-file.jpg") and Image(img_hr).save("my-file2.jpg") are different. What is the right way to save the prediction as a file?

  1. Is there a way to get size in bytes without saving the predicted image file to disk?
  2. Another small confusion is the string representation of DataBunch instance shows x and y like below. Paths for train and validation sets are also printed. Are these the paths for y or x? Because ideally, path for x should be small-96 and y should be small-96-compressed in my case.
ImageDataBunch;

Train: LabelList (6651 items)
x: ImageImageList
Image (3, 96, 128),Image (3, 96, 141),Image (3, 96, 128),Image (3, 96, 136),Image (3, 96, 128)
y: ImageList
Image (3, 96, 128),Image (3, 96, 141),Image (3, 96, 128),Image (3, 96, 136),Image (3, 96, 128)
Path: /home/username/.fastai/data/oxford-iiit-pet/small-96;

Valid: LabelList (739 items)
x: ImageImageList
Image (3, 96, 128),Image (3, 144, 96),Image (3, 96, 128),Image (3, 96, 112),Image (3, 96, 128)
y: ImageList
Image (3, 96, 128),Image (3, 144, 96),Image (3, 96, 128),Image (3, 96, 112),Image (3, 96, 128)
Path: /home/username/.fastai/data/oxford-iiit-pet/small-96;

Test: None

Thank you

0 Likes

(Nitin Pasumarthy) #2

Thoughts anyone?

On a side note, Have you tried opening up the unet from fastai and modifying it?

0 Likes