added a file clearer

added a file clearer for finished downscaled images that take up space.
This commit is contained in:
BrianPetkovsek
2019-03-24 05:31:18 -04:00
parent 1364ed507a
commit 5e61268a7b
2 changed files with 66 additions and 0 deletions

View File

@@ -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)