mirror of
https://github.com/k4yt3x/video2x.git
synced 2026-05-18 09:17:31 +08:00
added a file clearer
added a file clearer for finished downscaled images that take up space.
This commit is contained in:
@@ -19,6 +19,7 @@ from fractions import Fraction
|
||||
from tqdm import tqdm
|
||||
from waifu2x_caffe import Waifu2xCaffe
|
||||
from waifu2x_converter import Waifu2xConverter
|
||||
from clear_image import ClearImage
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
@@ -209,6 +210,11 @@ class Upscaler:
|
||||
progress_bar = threading.Thread(target=self._progress_bar, args=(thread_folders,))
|
||||
progress_bar.start()
|
||||
|
||||
#Create the clearer and start it
|
||||
Avalon.debug_info('Starting image clearer...')
|
||||
image_clear = ClearImage(self.extracted_frames,self.upscaled_frames,len(upscaler_threads))
|
||||
image_clear.start()
|
||||
|
||||
# start all threads
|
||||
for thread in upscaler_threads:
|
||||
thread.start()
|
||||
@@ -217,6 +223,10 @@ class Upscaler:
|
||||
for thread in upscaler_threads:
|
||||
thread.join()
|
||||
|
||||
#upscaling done... kill the clearer
|
||||
Avalon.debug_info('Stoping image clearer...')
|
||||
image_clear.stop()
|
||||
|
||||
self.progress_bar_exit_signal = True
|
||||
|
||||
def run(self):
|
||||
@@ -291,3 +301,5 @@ class Upscaler:
|
||||
# migrate audio tracks and subtitles
|
||||
Avalon.info('Migrating audio tracks and subtitles to upscaled video')
|
||||
fm.migrate_audio_tracks_subtitles(self.input_video, self.output_video, self.upscaled_frames)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user