MCPcopy Index your code
hub / github.com/NVIDIA/FastPhotoStyle / overlay

Function overlay

process_stylization_ade20k_ssn.py:20–31  ·  view source on GitHub ↗
(img, pred_color, blend_factor=0.4)

Source from the content-addressed store, hash-verified

18
19
20def overlay(img, pred_color, blend_factor=0.4):
21 import cv2
22 edges = cv2.Canny(pred_color, 20, 40)
23 edges = cv2.dilate(edges, np.ones((5,5),np.uint8), iterations=1)
24 out = (1-blend_factor)*img + blend_factor * pred_color
25 edge_pixels = (edges==255)
26 new_color = [0,0,255]
27 for i in range(0,3):
28 timg = out[:,:,i]
29 timg[edge_pixels]=new_color[i]
30 out[:,:,i] = timg
31 return out
32
33
34def visualize_result(label_map):

Callers 1

stylizationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected