Commit dc889d7b authored by Daniel Scheffler's avatar Daniel Scheffler

Moved skimage import to functional level to avoid static TLS import error.

Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent ea8efd7a
......@@ -27,7 +27,6 @@ from six import PY3
from shapely.wkb import loads
import numpy as np
from skimage.transform import rescale
try:
import gdal
......@@ -67,6 +66,7 @@ def raster2polygon(array, gt, prj, DN2extract=1, exact=True, maxfeatCount=None,
zoom_factor = 0.5
# downsample to half size, nearest neighbour
from skimage.transform import rescale # import here to avoid static TLS import error
array = rescale(array, zoom_factor, order=0, preserve_range=True, mode='edge').astype(np.bool)
# update pixel sizes within gt
......
......@@ -22,7 +22,6 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
import numpy as np
from skimage.measure import compare_ssim as ssim
__author__ = "Daniel Scheffler"
......@@ -37,6 +36,8 @@ def calc_ssim(image0, image1, dynamic_range=None, win_size=None, gaussian_weight
:param gaussian_weights:
:return:
"""
from skimage.measure import compare_ssim as ssim # import here to avoid static TLS import error
if image0.dtype != image1.dtype:
image0 = image0.astype(np.int16)
image1 = image1.astype(np.int16)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment