jakeret / tf_unet

Generic U-Net Tensorflow implementation for image segmentation
GNU General Public License v3.0
1.9k stars 748 forks source link

Can not save prediction #246

Closed I-CANT-CODE closed 5 years ago

I-CANT-CODE commented 5 years ago

my code:

my code is as such:

prediction = net.predict(path/to/model, input_test) util.save_image(prediction, "file.jpg")

I get a TypeError: Can't handle this data type

how can I save just the prediction image?

jakeret commented 5 years ago

the returned prediction is a 4d tensor. To save an image tf_unet relies on the Pillow package which expects an array that can be converted into an RGB image

I-CANT-CODE commented 5 years ago

are there any examples of how I can save it as an image that I can display?