import gradio as gr
import numpy as np
def create_canvas(img):
return (img).astype(np.uint8)
block = gr.Blocks().queue()
with block:
with gr.Row():
gr.Markdown("## Dummy")
with gr.Column():
with gr.Row():
input_image = gr.Image(source='upload', label='Input Image', type="numpy",)
input_mask = gr.Image(label='draw', type="numpy", tool="color-sketch")
input_image.change(fn=create_canvas, inputs=[input_image], outputs=[input_mask], queue=False)
block.launch(share='True')
When I use the above code, I am unable to draw on the image in the draw
component. The screenshot of the output is attached