The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Image Handling - Plot an Image

btibertbtibert Member, University Professor Posts: 146 Guru
edited January 2022 in Help
Is it possible to plot an image to the Results view, especially in the context of the Image Handling Extension?  I know that there is an option to Store the Image to a file system, but my ask is to plot the image within the process > Results.

My use cases:

- Teaching to show an image is just a dataset.  This is particularly helpful when extending the concept of data shapes outside of tabular 2D datasets.
- After fitting an image classification model, it would be nice to be able to review the predicted labels (e.g. MNIST) with the actual image classified for visual inspection.  Perhaps a 3 was misclassified as a 9, and this feature would allow us to visually review how these networks learn (or fail).


Best Answer

  • ceaperezceaperez Member Posts: 541 Unicorn
    Solution Accepted
    Hi @btibert

    please find attached an image of sample process for MNIST dataset.

    1- Inside to the Pre-Process Image operator you can create a flows with operators for image preprocessing: crop, rotate, flip, resize. 
    2- To be able to compare the the predicted label and the current label, I use to joint the Exa output of the Perform Operator with a copy of the outuput of the Read Image Metadata Operator used for testing dataset.
    I hope you find this flow clearest than the previous one. 
    Best, 

    Cesar

Answers

  • ceaperezceaperez Member Posts: 541 Unicorn
    Hi @btibert

    To handle with this situation I use to proceed as follows.
    1- Multiply the output of the Read Image Metadata operator that goes to Apply Model operator.
    2- Inner Join of Path from Perform operator and Read Image Metadata.
    3- Apply a Read Image as Exampleset operator to testing images.
    4- Plot images in Visualization Module as Heatmaps using all the attibutes.

    Best, 

    Cesar
  • btibertbtibert Member, University Professor Posts: 146 Guru
    Thanks!  I didn't think about Read Image as ExampleSet, and that is a nice hack.  With that said, I am not 100% certain I follow the flow above. Any chance you could diagram that out?

    Also, when using Read Image As ExampleSet, it doesn't appear that we can do any image pre-processing unless I am missing a Tensor to ExampleSet conversion operator.  For example my images need to be rotated.

    Thanks again.  I am trying to map how I do certain tasks in python within RM (either base or Extensions) and avoid using Execute Python as much as possible.  
  • btibertbtibert Member, University Professor Posts: 146 Guru
    Thank you
Sign In or Register to comment.