Hi, I made a huge progress; now the following components are unlocked!
- Media components:
st.image
,st.video
,st.audio
- matplotlib:
st.pyplot
- File upload/download:
st.file_uploader
,st.download_button
- Camera input:
st.camera_input
And a new option requirements
has been added to install external packages as below (though itโs not available on the playground app yet).
stlite.mount({
requirements: ["matplotlib"], // Install matplotlib!
mainScriptData: `
import streamlit as st
import matplotlib.pyplot as plt
import numpy as np
arr = np.random.normal(1, 1, size=100)
fig, ax = plt.subplots()
ax.hist(arr, bins=20)
st.pyplot(fig)
`
})
Moreover, Pyodide 0.21.0 has been released a couple days ago which added 34 new C-extensions including opencv-python
and xgboost
for client-side!
So I created this demo app: Serverless Image Processing App (Source code is stlite-image-processing-app/index.html at main ยท whitphx/stlite-image-processing-app ยท GitHub)
that demonstrates using OpenCV and various Streamlit components on stlite, Serverless Streamlit.