Deep Learning visualization using dash app

Hi

I am trying to create an app which shows input image after each layer of convolution neural network. I create below image using matplotlib. Is there any way to do the same in dash.

Here

column 1 is the first layer (3 x 3 filters)
column 2 is the second layer (maxpool)
column 3 is the third layer (3 x 3 filters)
column 4 is the fourth layer (maxpool)

Next 8 columns are the same as above but for a two different input image

Does anyone know how to create subplot and display image in each subplot in dash?

To initiate subplots:

fig=make_subplots(rows=2, cols=1, subplot_titles=['Plot1', 'Plot2', 'Plot3'])

You then can fill those suplots with:

        fig.append_trace(trace=go.Scatter(
         x=data[x],
         y=data[y]), 
         #by defining the rows and columns you are defining which of the suplots you are adressing
          row=1, col=1)

You can add an image as the background to a graph with:

y_C=1024
x_C=1024
  fig.update_layout(
            showlegend=False,
            images=[
                    go.layout.Image(source=img,
                                    xref='x',
                                    yref='y',
                                    x=0,
                                    y=y_C,
                                    #using input image sizes as the
                                    #axes lengths for the graph
                                    sizex=x_C,
                                    sizey=y_C,
                                    sizing='stretch',
                                    opacity=1,
                                    layer='below')],
            #defining height and width of the graph                        
            height=750,
            width=750*aspect_ratio)

You would have to adapt this last piece to add the layout directly to the subplot and not for the whole graph.
I haven’t done this before and the syntax is a bit different in that case, so you would have to fiddle around with that a bit.

Some more examples for images in plots: https://plot.ly/python/images/
Maybe this helps with the layout: Subplots within figure layout dictionary