Skip to content

Commit

Permalink
solve a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice committed Aug 10, 2020
1 parent 4e55d27 commit 6f8a092
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/adjust_brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def read_img(image_path):
# Calculates the average brightness in the specified irregular image
def calculate_average_brightness(img):
# Average value of three color channels
B = img[..., 0].mean()
R = img[..., 0].mean()
G = img[..., 1].mean()
R = img[..., 2].mean()
B = img[..., 2].mean()

brightness = 0.299 * R + 0.587 * G + 0.114 * B
return brightness, B, G, R
Expand Down
2 changes: 1 addition & 1 deletion video2anime.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def cvt2anime_video(video, output, checkpoint_dir, output_format='MP4V', img_siz
img = convert_image(frame, img_size)
fake_img = sess.run(test_generated, feed_dict={test_real: img})
fake_img = inverse_image(fake_img)
fake_img = cv2.cvtColor(adjust_brightness_from_src_to_dst(fake_img, frame), cv2.COLOR_BGR2RGB)
fake_img = adjust_brightness_from_src_to_dst(fake_img, cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
out.write(fake_img)
pbar.update(1)

Expand Down

0 comments on commit 6f8a092

Please sign in to comment.