You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running an app with ColorPicker examples, the example colors are not displayed in the examples dataset/dataframe.
The color is being correctly selected and displayed in the ColorPicker component though, which makes me think the backend logic is sound and it's a problem specific to the Dataset UI component.
Is there an existing issue for this?
I have searched the existing issues
Reproduction
Run demo/color_picker/run.py with the following modifications (setting red and blue as example colors)
importgradioasgrimportnumpyasnpfromPILimportImage, ImageColordefchange_color(icon, color):
""" Function that given an icon in .png format changes its color Args: icon: Icon whose color needs to be changed. color: Chosen color with which to edit the input icon. Returns: edited_image: Edited icon. """img=icon.convert("LA")
img=img.convert("RGBA")
image_np=np.array(icon)
_, _, _, alpha=image_np.Tmask= (alpha>0)
image_np[..., :-1][mask.T] =ImageColor.getcolor(color, "RGB")
edited_image=Image.fromarray(image_np)
returnedited_imageinputs= [
gr.Image(label="icon", type="pil", image_mode="RGBA"),
gr.ColorPicker(label="color")
]
outputs=gr.Image(label="colored icon")
demo=gr.Interface(
fn=change_color,
inputs=inputs,
outputs=outputs,
examples=[["/Users/freddy/sources/gradio/demo/blocks_inputs/lion.jpg", "#ff0000"],
["/Users/freddy/sources/gradio/demo/blocks_inputs/lion.jpg", "#0000FF"]]
)
if__name__=="__main__":
demo.launch()
Screenshot
Logs
-
System Info
On main
Severity
annoying
The text was updated successfully, but these errors were encountered:
freddyaboulton
changed the title
ColorPicker examples not properly rendered in dataset
ColorPicker examples not displayed in examples dataset component
Jul 12, 2022
Describe the bug
When running an app with ColorPicker examples, the example colors are not displayed in the examples dataset/dataframe.
The color is being correctly selected and displayed in the ColorPicker component though, which makes me think the backend logic is sound and it's a problem specific to the Dataset UI component.
Is there an existing issue for this?
Reproduction
Run
demo/color_picker/run.py
with the following modifications (setting red and blue as example colors)Screenshot
Logs
System Info
Severity
annoying
The text was updated successfully, but these errors were encountered: