mirror of
https://github.com/k4yt3x/video2x.git
synced 2025-01-30 23:58:11 +00:00
patch for potential problem with upscaler initialization
This commit is contained in:
parent
7fd8228a1b
commit
f9432b0fe8
@ -36,7 +36,6 @@ class Upscaler:
|
|||||||
ArgumentError -- if argument is not valid
|
ArgumentError -- if argument is not valid
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, input_video, output_video, method, waifu2x_settings, ffmpeg_settings, waifu2x_driver='waifu2x_caffe', scale_width=False, scale_height=False, scale_ratio=False, model_dir=None, threads=5, video2x_cache_folder='{}\\video2x'.format(tempfile.gettempdir()), preserve_frames=False):
|
def __init__(self, input_video, output_video, method, waifu2x_settings, ffmpeg_settings, waifu2x_driver='waifu2x_caffe', scale_width=False, scale_height=False, scale_ratio=False, model_dir=None, threads=5, video2x_cache_folder='{}\\video2x'.format(tempfile.gettempdir()), preserve_frames=False):
|
||||||
# mandatory arguments
|
# mandatory arguments
|
||||||
self.input_video = input_video
|
self.input_video = input_video
|
||||||
@ -197,9 +196,9 @@ class Upscaler:
|
|||||||
for thread_info in thread_pool:
|
for thread_info in thread_pool:
|
||||||
# create thread
|
# create thread
|
||||||
if self.scale_ratio:
|
if self.scale_ratio:
|
||||||
thread = threading.Thread(target=w2.upscale, args=(thread_info[0], self.upscaled_frames, False, self.scale_width, self.scale_height))
|
|
||||||
else:
|
|
||||||
thread = threading.Thread(target=w2.upscale, args=(thread_info[0], self.upscaled_frames, self.scale_ratio, False, False))
|
thread = threading.Thread(target=w2.upscale, args=(thread_info[0], self.upscaled_frames, self.scale_ratio, False, False))
|
||||||
|
else:
|
||||||
|
thread = threading.Thread(target=w2.upscale, args=(thread_info[0], self.upscaled_frames, False, self.scale_width, self.scale_height))
|
||||||
thread.name = thread_info[1]
|
thread.name = thread_info[1]
|
||||||
|
|
||||||
# add threads into the pool
|
# add threads into the pool
|
||||||
|
Loading…
Reference in New Issue
Block a user