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

Merge branch 'solve_warnings' into 'main'

Solved: 2 tests for gradio app launch failed on windows + investigation of pytest warnings

See merge request !39
parents 6f3d9b86 6001673e
No related branches found
No related tags found
1 merge request!39Solved: 2 tests for gradio app launch failed on windows + investigation of pytest warnings
...@@ -9,14 +9,15 @@ def test_starting_class(): ...@@ -9,14 +9,15 @@ def test_starting_class():
assert app.title == "Annotation tool" assert app.title == "Annotation tool"
def start_server(ip, port):
app = qim3d.gui.annotation_tool.Interface()
app.launch(server_name=ip, server_port=port)
def test_app_launch(): def test_app_launch():
ip = "0.0.0.0" ip = "localhost"
port = 65432 port = 65432
def start_server(ip, port):
app = qim3d.gui.annotation_tool.Interface()
app.launch(server_name=ip, server_port=port)
proc = multiprocessing.Process(target=start_server, args=(ip, port)) proc = multiprocessing.Process(target=start_server, args=(ip, port))
proc.start() proc.start()
......
...@@ -9,14 +9,15 @@ def test_starting_class(): ...@@ -9,14 +9,15 @@ def test_starting_class():
assert app.title == "Isosurfaces for 3D visualization" assert app.title == "Isosurfaces for 3D visualization"
def start_server(ip, port):
app = qim3d.gui.iso3d.Interface()
app.launch(server_name=ip, server_port=port)
def test_app_launch(): def test_app_launch():
ip = "0.0.0.0" ip = "localhost"
port = 65432 port = 65432
def start_server(ip, port):
app = qim3d.gui.iso3d.Interface()
app.launch(server_name=ip, server_port=port)
proc = multiprocessing.Process(target=start_server, args=(ip, port)) proc = multiprocessing.Process(target=start_server, args=(ip, port))
proc.start() proc.start()
......
...@@ -6,7 +6,6 @@ import outputformat as ouf ...@@ -6,7 +6,6 @@ import outputformat as ouf
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib import matplotlib
import numpy as np import numpy as np
import socket
import os import os
import shutil import shutil
import requests import requests
......
""" Provides a collection of visualization functions.""" """ Provides a collection of visualization functions."""
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap from matplotlib.colors import LinearSegmentedColormap
from matplotlib import cm from matplotlib import colormaps
import torch import torch
import numpy as np import numpy as np
from qim3d.io.logger import log from qim3d.io.logger import log
...@@ -56,7 +56,7 @@ def grid_overview(data, num_images=7, cmap_im="gray", cmap_segm="viridis", alpha ...@@ -56,7 +56,7 @@ def grid_overview(data, num_images=7, cmap_im="gray", cmap_segm="viridis", alpha
num_images = len(data) num_images = len(data)
# Adapt segmentation cmap so that background is transparent # Adapt segmentation cmap so that background is transparent
colors_segm = cm.get_cmap(cmap_segm)(np.linspace(0, 1, 256)) colors_segm = colormaps.get_cmap(cmap_segm)(np.linspace(0, 1, 256))
colors_segm[:128, 3] = 0 colors_segm[:128, 3] = 0
custom_cmap = LinearSegmentedColormap.from_list("CustomCmap", colors_segm) custom_cmap = LinearSegmentedColormap.from_list("CustomCmap", colors_segm)
...@@ -142,7 +142,7 @@ def grid_pred(in_targ_preds, num_images=7, cmap_im="gray", cmap_segm="viridis", ...@@ -142,7 +142,7 @@ def grid_pred(in_targ_preds, num_images=7, cmap_im="gray", cmap_segm="viridis",
inputs,targets,preds = [items[:num_images] for items in in_targ_preds] inputs,targets,preds = [items[:num_images] for items in in_targ_preds]
# Adapt segmentation cmap so that background is transparent # Adapt segmentation cmap so that background is transparent
colors_segm = cm.get_cmap(cmap_segm)(np.linspace(0, 1, 256)) colors_segm = colormaps.get_cmap(cmap_segm)(np.linspace(0, 1, 256))
colors_segm[:128, 3] = 0 colors_segm[:128, 3] = 0
custom_cmap = LinearSegmentedColormap.from_list("CustomCmap", colors_segm) custom_cmap = LinearSegmentedColormap.from_list("CustomCmap", colors_segm)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment