mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-22 06:23:20 -07:00
Added labels to color transfer test
This commit is contained in:
parent
26f033402c
commit
36faee3aa7
2 changed files with 19 additions and 0 deletions
|
@ -23,6 +23,22 @@ class ColorTranfer(unittest.TestCase):
|
||||||
show_masks = False
|
show_masks = False
|
||||||
|
|
||||||
grid = []
|
grid = []
|
||||||
|
|
||||||
|
labels = []
|
||||||
|
fontFace = cv2.FONT_HERSHEY_SIMPLEX
|
||||||
|
fontScale = 1.5
|
||||||
|
thickness = 4
|
||||||
|
src_h, src_w, src_c = np.shape(src_img)
|
||||||
|
src_h //= 3
|
||||||
|
for text in ['src', 'dst', 'LCT', 'RCT', 'RCT-c', 'RCT-p', 'RCT-pc', 'mRTC', 'mRTC-c', 'mRTC-p', 'mRTC-pc']:
|
||||||
|
label = np.zeros((src_h, src_w, src_c))
|
||||||
|
size, baseline = cv2.getTextSize(text, fontFace, fontScale, thickness)
|
||||||
|
w, h = size
|
||||||
|
label = cv2.putText(label, text, ((src_w - w)//2, (src_h - h + baseline * 2)//2), fontFace, fontScale, (1, 1, 1), thickness=thickness)
|
||||||
|
labels.append(label)
|
||||||
|
labels = np.concatenate(labels, axis=1)
|
||||||
|
grid.append(labels)
|
||||||
|
|
||||||
for ct_sample in dst_samples:
|
for ct_sample in dst_samples:
|
||||||
print(src_sample.filename, ct_sample.filename)
|
print(src_sample.filename, ct_sample.filename)
|
||||||
ct_img = ct_sample.load_bgr()
|
ct_img = ct_sample.load_bgr()
|
||||||
|
@ -51,6 +67,8 @@ class ColorTranfer(unittest.TestCase):
|
||||||
grid.append(results)
|
grid.append(results)
|
||||||
|
|
||||||
cv2.namedWindow('test output', cv2.WINDOW_NORMAL)
|
cv2.namedWindow('test output', cv2.WINDOW_NORMAL)
|
||||||
|
for g in grid:
|
||||||
|
print(np.shape(g))
|
||||||
cv2.imshow('test output', np.concatenate(grid, axis=0))
|
cv2.imshow('test output', np.concatenate(grid, axis=0))
|
||||||
cv2.waitKey(0)
|
cv2.waitKey(0)
|
||||||
cv2.destroyAllWindows()
|
cv2.destroyAllWindows()
|
||||||
|
@ -67,6 +85,7 @@ class ColorTranfer(unittest.TestCase):
|
||||||
show_masks = True
|
show_masks = True
|
||||||
|
|
||||||
grid = []
|
grid = []
|
||||||
|
|
||||||
for ct_sample in dst_samples:
|
for ct_sample in dst_samples:
|
||||||
print(src_sample.filename, ct_sample.filename)
|
print(src_sample.filename, ct_sample.filename)
|
||||||
ct_img = ct_sample.load_bgr()
|
ct_img = ct_sample.load_bgr()
|
||||||
|
|
BIN
imagelib/test/test output_screenshot_18.08.2019.png
Normal file
BIN
imagelib/test/test output_screenshot_18.08.2019.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 KiB |
Loading…
Add table
Add a link
Reference in a new issue