Skip to content
Snippets Groups Projects
Commit 851d5719 authored by fima's avatar fima :beers:
Browse files

Hotfix: no relative import for interface

parent f156a3cf
No related branches found
No related tags found
No related merge requests found
......@@ -30,23 +30,21 @@ from PIL import Image
from qim3d.io import load, save
from qim3d.utils import overlay_rgb_images
from .interface import BaseInterface
from qim3d.gui.interface import BaseInterface
# TODO: img in launch should be self.img
class Interface(BaseInterface):
def __init__(self,
name_suffix:str = "",
verbose: bool = False,
img = None):
super().__init__(title = "Annotation Tool",
def __init__(self, name_suffix: str = "", verbose: bool = False, img=None):
super().__init__(
title="Annotation Tool",
height=768,
width="100%",
verbose=verbose,
custom_css="annotation_tool.css"
custom_css="annotation_tool.css",
)
self.username = getpass.getuser()
self.temp_dir = os.path.join(tempfile.gettempdir(), f"qim-{self.username}")
self.name_suffix = name_suffix
......@@ -140,7 +138,9 @@ class Interface(BaseInterface):
default_size=10,
)
with gr.Row():
with gr.Column(scale=6, ):
with gr.Column(
scale=6,
):
img_editor = gr.ImageEditor(
value=(
{
......@@ -166,12 +166,12 @@ class Interface(BaseInterface):
with gr.Row():
overlay_img = gr.Image(
show_download_button=False, show_label=False, visible=False,
show_download_button=False,
show_label=False,
visible=False,
)
with gr.Row():
masks_download = gr.File(
label="Download masks", visible=False
)
masks_download = gr.File(label="Download masks", visible=False)
# fmt: off
img_editor.change(
......@@ -180,6 +180,3 @@ class Interface(BaseInterface):
fn = self.set_visible, inputs = None, outputs = overlay_img).then( # Makes the preview visible
fn = self.cerate_download_list, inputs = img_editor, outputs = masks_download).then(# Separates the color mask and put them into file list
fn = self.set_visible, inputs = None, outputs = masks_download) # Displays the download file list
......@@ -28,7 +28,7 @@ from qim3d.io import load
from qim3d.io.logger import log
from qim3d.utils import internal_tools
from .interface import BaseInterface
from qim3d.gui.interface import BaseInterface
class Interface(BaseInterface):
......
......@@ -25,7 +25,7 @@ from scipy import ndimage
from qim3d.io import load
from qim3d.io.logger import log
from .interface import InterfaceWithExamples
from qim3d.gui.interface import InterfaceWithExamples
#TODO img in launch should be self.img
......
......@@ -42,7 +42,7 @@ import tifffile
import localthickness as lt
from qim3d.io import load
from .interface import InterfaceWithExamples
from qim3d.gui.interface import InterfaceWithExamples
class Interface(InterfaceWithExamples):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment