Background image in st_canvas is displayed locally, but not when deployed

Hi, my following code properly displays the background image on local server but not in the deployed app. My image is a tiff stack and I am trying to display one of the stack images as background.

image_draw = Image.fromarray(image[0])
canvas_result = st_canvas(
                    fill_color="rgba(255, 165, 0, 0.2)", 
                    stroke_width=2,
                    stroke_color="rgba(255, 0, 0, 0.7)",
                    background_image=image_draw,
                    update_streamlit=True,
                    display_toolbar=True,
                    height=canvas_height,
                    width=canvas_width,
                    drawing_mode="rect",
                    key="canvas",                        
                    )

Any help would be appreciated.

Hey @toto_26,

What version of Streamlit and what version of streamlit_drawable_canvas are you using?

Hi @Caroline ! I’m using streamlit version 1.21.0 and streamlit-drawable-canvas version 0.9.3. I also tried updating both earlier to see if it resolves the issue, but I got into more issues regarding tensorboard and some other library incompatibilities, so I switched back to these versions.

Hey @Caroline Can you help me out that when I am running my code on local canva image is displayed but when deployed the image is not getting displayed of the canvas can you please help me out ?

https://army-cms-lvl-alpha.streamlit.app/Injury_Report
This is the deployed link.
This is the github link:
https://github.com/skshubham09/ArmyCMS/blob/main/pages/Injury_Report.py

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.