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
544 stars 83 forks source link

Change Uncompress ImageData to DataURL #67

Closed kapong closed 2 years ago

kapong commented 2 years ago

I reduce sending data from ImageData to DataURL. It's very compact and faster to transfer information when the canvas is large.

for example, I reduce from 7MB to 74kB with the same canvas size

image
andfanilo commented 2 years ago

Oh this is awesome! Have you had the chance to try it in a Cloud environment like Streamlit Sharing or Heroku, to see the data URL can be fetched correctly? (it should, but just to be sure)

kapong commented 2 years ago

@andfanilo, I just test on my own docker. But i think it will be ok because it's not required additional library to solve the dataurl.

kapong commented 2 years ago

Additional, I change backgroudImage from UInt8Array to URL using Streamlit in-mem filemanager. It's make everything faster.

I'm sorry about my English but I think you should try it you self to understand what i meant.

andfanilo commented 2 years ago

Yes I will test it, sorry I'm still giving lectures at university so I'll try to have a look next week :)

andfanilo commented 2 years ago

Hi @kapong

Finally got time to review your change and finally understood the gist of the code. Thanks for the contribution :) I'll do a release around this week, probably with a small video with the features in there. I'll probably thank you with your github username in the video except if you don't want to!

Have a nice day, Fanilo

kapong commented 2 years ago

It’s my pleasure.

On Sat, 26 Feb 2565 BE at 15:09 Fanilo Andrianasolo < @.***> wrote:

Hi @kapong https://github.com/kapong

Finally got time to review your change and finally understood the gist of the code. Thanks for the contribution :) I'll do a release around this week, probably with a small video with the features in there. I'll probably thank you with your github username in the video except if you don't want to!

Have a nice day, Fanilo

— Reply to this email directly, view it on GitHub https://github.com/andfanilo/streamlit-drawable-canvas/pull/67#issuecomment-1051801377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE62RBWZGVJKFW74KNTIVLU5CDCLANCNFSM5MUWVIOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

-- Sent from Gmail Mobile