How to implement cv2.imshow

Hi!

Thank you for creating such a wonderful project. I’m building a small app to visualize some images. In order to fit my requirements, I used some hacky things like private methods or unsafe_allow_html style injection (javascript injection is not supported :lying_face: ).

The main purpose of the app is to visualize images and charts similar to cv2.imshow or matplotlib.pyplot.show but using a web backend. I want minimal changes of the original programs and dataflows. Specifically, the only change needs to be done is replacing imports (no startup method changes are needed either).

Now I’m modifying Server and ReportSession to get more features and it’s divergent a lot. I’m worrying the unstable APIs I’m using and the future compatibility.
Is there any better idea how to implement this?

Here’s my implementation:

Thanks

1 Like

Hi @liuyibo,
thanks for posting! We are working a lot on extensibility and we are planning to release a Plugin framework. Here is the FR.

That said, for matplotlib, have you tried st.pyplot(). It should just render a matplotlib figure.

Matteo