Skip to content
Snippets Groups Projects
Commit a1b7d7e1 authored by Drbohlav, Ondřej, Mgr., Ph.D.'s avatar Drbohlav, Ondřej, Mgr., Ph.D.
Browse files

ensuring gray conversion works with kornia 0.6.3

parent 67e6d14c
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ import matplotlib.pyplot as plt
def read_image(idx):
fname = os.path.join('data', '%03i.jpg' % idx)
img = cv2.imread(fname)
img = kornia.color.bgr_to_grayscale(kornia.image_to_tensor(img,False))/255.0
img = kornia.color.bgr_to_grayscale(kornia.image_to_tensor(img.astype(np.float32),False))/255.0
return img
def get_patches_subpix(img: torch.Tensor,
......
......@@ -17,7 +17,7 @@ translations = [ [0, 0],
def get_test_data(idx):
fname = os.path.join('test_data', 'toy_im_%01i.png' % idx)
img = cv2.imread(fname)
img = kornia.color.bgr_to_grayscale(kornia.image_to_tensor(img,False))/255.0
img = kornia.color.bgr_to_grayscale(kornia.image_to_tensor(img.astype(np.float32),False))/255.0
return img, translations[idx]
......
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