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():
assert app.title == "Annotation tool"
def test_app_launch():
ip = "0.0.0.0"
port = 65432
def start_server(ip, port):
app = qim3d.gui.annotation_tool.Interface()
app.launch(server_name=ip, server_port=port)
def test_app_launch():
ip = "localhost"
port = 65432
proc = multiprocessing.Process(target=start_server, args=(ip, port))
proc.start()
......
......@@ -9,14 +9,15 @@ def test_starting_class():
assert app.title == "Isosurfaces for 3D visualization"
def test_app_launch():
ip = "0.0.0.0"
port = 65432
def start_server(ip, port):
app = qim3d.gui.iso3d.Interface()
app.launch(server_name=ip, server_port=port)
def test_app_launch():
ip = "localhost"
port = 65432
proc = multiprocessing.Process(target=start_server, args=(ip, port))
proc.start()
......
......@@ -6,7 +6,6 @@ import outputformat as ouf
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import socket
import os
import shutil
import requests
......
""" Provides a collection of visualization functions."""
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from matplotlib import cm
from matplotlib import colormaps
import torch
import numpy as np
from qim3d.io.logger import log
......@@ -56,7 +56,7 @@ def grid_overview(data, num_images=7, cmap_im="gray", cmap_segm="viridis", alpha
num_images = len(data)
# 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
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",
inputs,targets,preds = [items[:num_images] for items in in_targ_preds]
# 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
custom_cmap = LinearSegmentedColormap.from_list("CustomCmap", colors_segm)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment