Integrating the amazing cropperjs with streamlit.
This streamlit module is primarily built with mobile usage in mind.
Access the demo app here: https://st-cropperjs.streamlit.app/
pip install streamlit-cropperjs
import streamlit as st
from streamlit_cropperjs import st_cropperjs
pic = st.file_uploader("Upload a picture", key="uploaded_pic")
if pic:
pic = pic.read()
cropped_pic = st_cropperjs(pic=pic, btn_text="Detect!", key="foo")
if cropped_pic:
st.image(cropped_pic, output_format="PNG")
- Crop and return image data
- Supports touch (mobile)
- Supports cropping on demand with a button (customised button text)
- Support for all cropperjs options
- Support for cropperjs v2