Deep-Exemplar-based-Video-Colorization
Deep-Exemplar-based-Video-Colorization copied to clipboard
Wrong output resolution
Processing 4x3 video 912x720 outputs cropped and downscaled 16x9 768x432. Playing around "python test.py --image-size [image-size] " doesn't help My be I don't properly specify an arguments? So, what the the proper use of --image-size [image-size] in order to get 912x720? Greatly appreciate for suggesting.
@semel1 I had a similar issue, I ended up forking the repo and changing the default value in test.py
but then I started getting another error likely related to the size I specified being bigger than the input. I'm not sure why the argument didn't work but tbh I didn't spend much time looking into it. Would love to know the answer to this as well. I though it might have something to do with how the model was trained.
@semel1 did you ever make any progress on this? I've been busy with other work but will try to look into it this week.
anyone find out how to change the output resolution? @hrdunn what did you change in test.py?
Hi. I made a quick fix for this. Please note the order of the parameters, first height then width: --image_size [height,width]
Download the patch below and apply it to test.py this way patch test.py < patch.txt
I fixed mine using @juliokarl 's patch. If your os is windows like mine, then the patch command won't work.
You need to manually open the test.py with notepad and paste
if type(opt.image_size) is str: opt.image_size = eval(opt.image_size)
into the file, right after the following lines:
filenames.sort(key=lambda f: int("".join(filter(str.isdigit, f) or -1)))
# NOTE: resize frames to 216*384
Then, you need to replace this line:
parser.add_argument("--image_size", type=int, default=[216 * 2, 384 * 2], help="the image size, eg. [216,384]")
with this line:
parser.add_argument("--image_size", type=str, default=[216 * 2, 384 * 2], help="the image size, eg. [216,384]")
It's best to create a backup of test.py just in case.
When I change the output resolution with the patch and --image_size I always get this error Sizes of tensors must match except in dimension 1. Expected size 135 but got size 134 for tensor number 2 in the list.
It has been a long time since i wrote that patch. As a hint, try a different resolution if you get an error. The width/height has to be dividable by 16, maybe it was a different number. Hope that helps.
Yes, no problem, thanks for the quick reply it works but the vram is immediately busy when I go to 1088*1920. You should choose a lower resolution and then transfer the color information to black and white source frame. This is less computationally intensive and hardly distinguishable from the image quality.
The following function first scales the low-resolution color image to the size of the original image and projects only the color information onto the Y channel of the black and white image.