deepcolor
deepcolor copied to clipboard
I have a question about data process "main.imageblur()" +1
thank you for sharing!!!!!!!!!
I get a question while implementing the code and ask. Is it ok to use it without a deep copy?
test in python3
my test cord this
def imageblur(img, sampling=False):
if sampling:
cimg = cimg * 0.3 + np.ones_like(cimg) * 0.7 * 255
else:
for i in range(30):
randx = randint(0,205)
randy = randint(0,205)
cimg[randx:randx+50, randy:randy+50] = 255
return cv2.blur(cimg,(100,100))
img = get_img(path)
img_b = imageblur(img)
nvc = np.concatenate((img,img_b),axis=1)
cv2.imshow("TEST",nvc)
and result ...
my test cord_2_add deep copy this
def imageblur(img, sampling=False):
cimg = copy.deepcopy(img) #Add deep copy
if sampling:
cimg = cimg * 0.3 + np.ones_like(cimg) * 0.7 * 255
else:
for i in range(30):
randx = randint(0,205)
randy = randint(0,205)
cimg[randx:randx+50, randy:randy+50] = 255
return cv2.blur(cimg,(100,100))
img = get_img(path)
img_b = imageblur(img)
nvc = np.concatenate((img,img_b),axis=1)
cv2.imshow("TEST",nvc)
and result
And one more why expand edge image dims in placeholder set dim 1 I am curious as to whether it should be expanded
batch_edge = np.expand_dims(batch_edge, 3)
Thank you again for sharing. !!