Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to API changes in dependencies (cupy, skimage, cv2). #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion models/sgm_model/gen_sgm.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def get_guidance_flow(label_map1, label_map2, img1, img2,
color_patch1 = show_fill_map(label_map1)
color_patch2 = show_fill_map(label_map2)

flowObj = cv2.optflow.createOptFlow_DIS(cv2.optflow.DISOpticalFlow_PRESET_MEDIUM)
#flowObj = cv2.optflow.createOptFlow_DIS(cv2.optflow.DISOpticalFlow_PRESET_MEDIUM)
flowObj = cv2.DISOpticalFlow_create(cv2.DISOPTICAL_FLOW_PRESET_MEDIUM)
# flowObj.setUseMeanNormalization(False)
# flowObj.setUseSpatialPropagation(False)
flowObj.setVariationalRefinementIterations(25)
Expand Down
2 changes: 1 addition & 1 deletion models/sgm_model/linefiller/trappedball_fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def get_border_point(points, rect, max_height, max_width):
fill[(points[0] - border_rect[1], points[1] - border_rect[0])] = 255

# Get shape.
_, contours, _ = cv2.findContours(fill, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
contours, _ = cv2.findContours(fill, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
approx_shape = cv2.approxPolyDP(contours[0], 0.02 * cv2.arcLength(contours[0], True), True)

# Get border pixel.
Expand Down
2 changes: 1 addition & 1 deletion models/sgm_model/softsplat.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def cupy_kernel(strFunction, objVariables):
return strKernel
# end

@cupy.util.memoize(for_each_device=True)
@cupy._util.memoize(for_each_device=True)
def cupy_launch(strFunction, strKernel):
return cupy.cuda.compile_with_cache(strKernel).get_function(strFunction)
# end
Expand Down
2 changes: 1 addition & 1 deletion models/softsplat.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def cupy_kernel(strFunction, objVariables):
return strKernel
# end

@cupy.util.memoize(for_each_device=True)
@cupy._util.memoize(for_each_device=True)
def cupy_launch(strFunction, strKernel):
return cupy.cuda.compile_with_cache(strKernel).get_function(strFunction)
# end
Expand Down
3 changes: 2 additions & 1 deletion test_anime_sequence_one_by_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import cv2
from utils.vis_flow import flow_to_color
import json
from skimage.measure import compare_psnr, compare_ssim
from skimage.metrics import peak_signal_noise_ratio as compare_psnr
from skimage.metrics import structural_similarity as compare_ssim


def save_flow_to_img(flow, des):
Expand Down
2 changes: 1 addition & 1 deletion utils/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os.path as osp
import sys
from argparse import ArgumentParser
from collections import Iterable
from collections.abc import Iterable
from importlib import import_module
from easydict import EasyDict as edict

Expand Down
2 changes: 1 addition & 1 deletion utils/correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def cupy_kernel(strFunction, objectVariables):
return strKernel
# end

@cupy.util.memoize(for_each_device=True)
@cupy._util.memoize(for_each_device=True)
def cupy_launch(strFunction, strKernel):
return cupy.cuda.compile_with_cache(strKernel).get_function(strFunction)
# end
Expand Down