Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
k4yt3x committed Jul 30, 2019
2 parents b0167e9 + 7476774 commit 685d894
Show file tree
Hide file tree
Showing 2 changed files with 382 additions and 7 deletions.
15 changes: 8 additions & 7 deletions bin/upscaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ def _progress_bar(self, extracted_frames_directories):
and the output directory. This is originally
suggested by @ArmandBernard.
"""

# get number of extracted frames
total_frames = 0
self.total_frames = 0
for directory in extracted_frames_directories:
total_frames += len([f for f in directory.iterdir() if str(f)[-4:] == f'.{self.image_format}'])
self.total_frames += len([f for f in directory.iterdir() if str(f)[-4:] == f'.{self.image_format}'])

with tqdm(total=total_frames, ascii=True, desc='Upscaling Progress') as progress_bar:
with tqdm(total=self.total_frames, ascii=True, desc='Upscaling Progress') as progress_bar:

# tqdm update method adds the value to the progress
# bar instead of setting the value. Therefore, a delta
Expand All @@ -122,12 +123,12 @@ def _progress_bar(self, extracted_frames_directories):
while not self.progress_bar_exit_signal:

try:
total_frames_upscaled = len([f for f in self.upscaled_frames.iterdir() if str(f)[-4:] == f'.{self.image_format}'])
delta = total_frames_upscaled - previous_cycle_frames
previous_cycle_frames = total_frames_upscaled
self.total_frames_upscaled = len([f for f in self.upscaled_frames.iterdir() if str(f)[-4:] == f'.{self.image_format}'])
delta = self.total_frames_upscaled - previous_cycle_frames
previous_cycle_frames = self.total_frames_upscaled

# if upscaling is finished
if total_frames_upscaled >= total_frames:
if self.total_frames_upscaled >= self.total_frames:
return

# adds the detla into the progress bar
Expand Down
Loading

0 comments on commit 685d894

Please sign in to comment.