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
576 stars 88 forks source link

Canvas disappearing shortly after loading #95

Open julienperichon opened 1 year ago

julienperichon commented 1 year ago

I noticed a bug, which seem to have been discussed at #79 and on the forum.

Context: I'm on a multipage streamlit, and I try to display a canvas with a background image (and sized to this image) in order to draw boxes to create new annotations. Just after displaying the canvas, I try to access the JSON data to display drawn boxes and let the user choose the annotation. I noticed that the canvas often disappears <1 second after loading. I don't observe this issue at each loading, but maybe close to 50% of the loadings.

I tried 2 methods (I did not see that some people retrograded to 0.7.0 at that time):

Therefore, it seems that it is linked to some issue during the loading of the canvas' state.

Here's my configuration: python==3.7.12 streamlit==1.12.2 streamlit-drawable-canvas==0.9.0

Hope this helps!

EDIT: Seems like changing the update_streamlit parameter to False was not sufficient, even though it appears the problem is less frequent.