-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.py
52 lines (40 loc) · 1.19 KB
/
show.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /usr/bin/env python3
from pickle import load
from skimage.io import imread
import matplotlib.pyplot as plt
import numpy as np
path = 'tests/01_'
gt = []
output = []
with open(path + 'test_img_check/gt/seams', 'rb') as current_input:
for i in range(8):
gt.append(load(current_input))
with open(path + 'test_img_check/output/output_seams', 'rb') as current_input:
for i in range(8):
output.append(load(current_input))
tests_type = [
"horizontal shrink",
"vertical shrink",
"horizontal expand",
"vertical expand",
"horizontal shrink with mask",
"vertical shrink with mask",
"horizontal expand with mask",
"vertical expand with mask",
]
img = imread(path + 'test_img_input/img.png')
width, height, _ = img.shape
for i in range(8):
print(tests_type[i], gt[i] == output[i])
_img = img.copy()
for idx, jdx in output[i]:
_img[idx, jdx] = [255, 0, 0]
for idx, jdx in gt[i]:
_img[idx, jdx] = [0, 255, 0]
if output[i] != gt[i]:
# for j in range(len(output)):
# if output[i][j] != gt[i][j]:
# print(output[i][j])
# print(gt[i][j])
plt.imshow(_img)
plt.show()