Computer Vision News - May 2020
2 Summary Deep Learning Library 4 To plot and save the final prediction and the entropy as displayed above we can use the following lines of code. r = Image.fromarray(final_pred.byte().cpu().numpy()).resize(copy_image.size) r.putpalette(colors) fig,ax = plt.subplots( 1 ) fig.subplots_adjust(left= 0 ,right= 1 ,bottom= 0 ,top= 1 ) ax.imshow(copy_image) ax.axis('tight') ax.axis('off') plt.imshow(r, alpha= 0.5 ) plt.savefig("prediction.png",format="png") plt.show() fig,ax = plt.subplots( 1 ) fig.subplots_adjust(left= 0 ,right= 1 ,bottom= 0 ,top= 1 ) ax.imshow(entropy) ax.axis('tight') ax.axis('off') plt.savefig("entropy.png",format="png") plt.show() Application 2: augmentation to images + masks For the second section of this article, I decided to show you how we can handle transformations to images and their ground truth masks at the same time. To do that, you either need to select some already available images you might want to augment or download some others with the annotated masks. I used the COCO website again to get both.
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=