andfanilo / streamlit-drawable-canvas

Do you like Quick, Draw? Well what if you could train/predict doodles drawn inside Streamlit? Also draws lines, circles and boxes over background images for annotation.
https://drawable-canvas.streamlit.app/
MIT License
563 stars 85 forks source link

Clean the cache when rerun the function st_canvas() #21

Closed Yangxiaojun1230 closed 3 years ago

Yangxiaojun1230 commented 3 years ago

Hi author, Awesome work and really helpful to me. Now I realized automatically show photo in canvas and save the image. But I wonder how to clear the canvas when I show a new photo. Could you give me some suggestion?

andfanilo commented 3 years ago

Hey @Yangxiaojun1230, thanks for the kind works :)

I'm currently on #16 clearing the drawings with a button, so you will be able to delete all drawings after changing photo by the click of a button. I've actually been considering clearing the drawing on background_image change, maybe I'll do it, I don't have a reason to preserve drawings on image change. What do you think?

Fanilo