How to incorporate html components from keras model displaying website Net2Vis?

We can get the nice interactive keras architecture from the website: https://viscom.net2vis.uni-ulm.de/.

Can we copy the html component of the upper part figures (with interactive annotations) and use in streamlit.

My attempt

  • Right click the figure and copy outer html
  • stc.html(copied_html)

Where stc is import streamlit.components.v1 as stc

MWE

import streamlit as st
import streamlit.components.v1 as stc

html = """
copy html from net2vis website
"""

stc.html(html)

You can do something like this more or less (you’d need to make sure you have all of the JavaScript dependencies), but it’d be more scalable long-term to build a Streamlit Component. That way, you could display the model for whatever changes you made, instead of copying HTML from that website.

Thanks for the reply. I ended up using iframe, which shows the website directly.

2 Likes