I have had the pleasure to try out streamlit-cropper by turner-anderson. It is a wonderful module for all computer vision projects! Unfortunately, I faced some issue getting the module to work properly on mobile.
As such, I took some time to integrate another amazing project from fengyuanchen: cropperjs using streamlit components.
Have released the component on pypi and can be easily installed via
pip install streamlit-cropperjs
Check out the repo at streamlit-cropperjs (github.com)
Thanks for sharing! Pretty cool component! I would recommend deploying a demo app of the component that the community can play with for preview.
Thanks @tonykip for the suggestion!
Have deployed a demo app over at this link: streamlit-cropperjs
If u could provide download option for cropped image it would be very helpful.
One suggestion : if the user upload different format than the specified format, app should alert the user to upload the correct format. (Error info)
Thanks! I’ve updated the component’s return value to allow easy and direct use of the st.download_button functionality.
cropped_pic = st_cropperjs(pic=pic, btn_text="Detect!", key="foo")
"Download", cropped_pic, file_name="output.png", mime="image/png"