Skip to content
Snippets Groups Projects
Commit 2806c0b9 authored by Christian Kento Rasmussen's avatar Christian Kento Rasmussen
Browse files

Fix drawing issue in gr.ImageEditor

parent f4715d16
Branches
Tags
1 merge request!73Fix drawing issue in gr.ImageEditor
...@@ -15,13 +15,16 @@ app.launch() ...@@ -15,13 +15,16 @@ app.launch()
``` ```
""" """
import tifffile import getpass
import tempfile
import os import os
import tempfile
import time import time
import getpass
import numpy as np
import gradio as gr import gradio as gr
import numpy as np
import tifffile
from PIL import Image
import qim3d.utils import qim3d.utils
from qim3d.io import load, save from qim3d.io import load, save
from qim3d.io.logger import log from qim3d.io.logger import log
...@@ -112,7 +115,8 @@ class Interface: ...@@ -112,7 +115,8 @@ class Interface:
with gr.Column(scale=6): with gr.Column(scale=6):
img_editor = gr.ImageEditor( img_editor = gr.ImageEditor(
value=img, # ! Temporary fix for drawing at wrong location https://github.com/gradio-app/gradio/pull/7959
value={"background": img, "layers": [Image.new("RGBA", img.shape, (0, 0, 0, 0))], "composite": None} if img is not None else None,
type="numpy", type="numpy",
image_mode="RGB", image_mode="RGB",
brush=brush, brush=brush,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment