mirror of
				https://github.com/k4yt3x/video2x.git
				synced 2025-11-03 22:21:37 +01:00 
			
		
		
		
	fixed minor flake8 formatting issues
This commit is contained in:
		
							parent
							
								
									0fca5c8e9a
								
							
						
					
					
						commit
						fa3bd38217
					
				@ -148,7 +148,7 @@ class VideoDecoder(threading.Thread):
 | 
			
		||||
                self.exception = e
 | 
			
		||||
 | 
			
		||||
                # ignore queue closed
 | 
			
		||||
                if not "is closed" in str(e):
 | 
			
		||||
                if "is closed" not in str(e):
 | 
			
		||||
                    logger.exception(e)
 | 
			
		||||
                break
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -22,10 +22,6 @@ Date Created: May 27, 2021
 | 
			
		||||
Last Modified: February 28, 2022
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
# local imports
 | 
			
		||||
from rife_ncnn_vulkan_python.rife_ncnn_vulkan import Rife
 | 
			
		||||
 | 
			
		||||
# built-in imports
 | 
			
		||||
import multiprocessing
 | 
			
		||||
import multiprocessing.managers
 | 
			
		||||
import multiprocessing.sharedctypes
 | 
			
		||||
@ -33,10 +29,9 @@ import queue
 | 
			
		||||
import signal
 | 
			
		||||
import time
 | 
			
		||||
 | 
			
		||||
# third-party imports
 | 
			
		||||
from PIL import ImageChops, ImageStat
 | 
			
		||||
from loguru import logger
 | 
			
		||||
 | 
			
		||||
from PIL import ImageChops, ImageStat
 | 
			
		||||
from rife_ncnn_vulkan_python.rife_ncnn_vulkan import Rife
 | 
			
		||||
 | 
			
		||||
ALGORITHM_CLASSES = {"rife": Rife}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -22,12 +22,6 @@ Date Created: May 27, 2021
 | 
			
		||||
Last Modified: February 16, 2022
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
# local imports
 | 
			
		||||
from realsr_ncnn_vulkan_python.realsr_ncnn_vulkan import Realsr
 | 
			
		||||
from srmd_ncnn_vulkan_python.srmd_ncnn_vulkan import Srmd
 | 
			
		||||
from waifu2x_ncnn_vulkan_python.waifu2x_ncnn_vulkan import Waifu2x
 | 
			
		||||
 | 
			
		||||
# built-in imports
 | 
			
		||||
import math
 | 
			
		||||
import multiprocessing
 | 
			
		||||
import multiprocessing.managers
 | 
			
		||||
@ -36,9 +30,11 @@ import queue
 | 
			
		||||
import signal
 | 
			
		||||
import time
 | 
			
		||||
 | 
			
		||||
# third-party imports
 | 
			
		||||
from PIL import Image, ImageChops, ImageStat
 | 
			
		||||
from loguru import logger
 | 
			
		||||
from PIL import Image, ImageChops, ImageStat
 | 
			
		||||
from realsr_ncnn_vulkan_python.realsr_ncnn_vulkan import Realsr
 | 
			
		||||
from srmd_ncnn_vulkan_python.srmd_ncnn_vulkan import Srmd
 | 
			
		||||
from waifu2x_ncnn_vulkan_python.waifu2x_ncnn_vulkan import Waifu2x
 | 
			
		||||
 | 
			
		||||
# fixed scaling ratios supported by the algorithms
 | 
			
		||||
# that only support certain fixed scale ratios
 | 
			
		||||
@ -175,7 +171,8 @@ class Upscaler(multiprocessing.Process):
 | 
			
		||||
                        # process the image with the selected algorithm
 | 
			
		||||
                        image1 = processor_object.process(image1)
 | 
			
		||||
 | 
			
		||||
                    # downscale the image to the desired output size and save the image to disk
 | 
			
		||||
                    # downscale the image to the desired output size and
 | 
			
		||||
                    # save the image to disk
 | 
			
		||||
                    image1 = image1.resize((output_width, output_height), Image.LANCZOS)
 | 
			
		||||
                    self.processed_frames[frame_index] = image1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,7 @@ __      __  _       _                  ___   __   __
 | 
			
		||||
Name: Video2X
 | 
			
		||||
Creator: K4YT3X
 | 
			
		||||
Date Created: February 24, 2018
 | 
			
		||||
Last Modified: February 28, 2022
 | 
			
		||||
Last Modified: March 18, 2022
 | 
			
		||||
 | 
			
		||||
Editor: BrianPetkovsek
 | 
			
		||||
Last Modified: June 17, 2019
 | 
			
		||||
@ -39,14 +39,6 @@ Editor: 28598519a
 | 
			
		||||
Last Modified: March 23, 2020
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
# local imports
 | 
			
		||||
from . import __version__
 | 
			
		||||
from .decoder import VideoDecoder
 | 
			
		||||
from .encoder import VideoEncoder
 | 
			
		||||
from .interpolator import Interpolator
 | 
			
		||||
from .upscaler import Upscaler
 | 
			
		||||
 | 
			
		||||
# built-in imports
 | 
			
		||||
import argparse
 | 
			
		||||
import math
 | 
			
		||||
import multiprocessing
 | 
			
		||||
@ -55,7 +47,8 @@ import pathlib
 | 
			
		||||
import sys
 | 
			
		||||
import time
 | 
			
		||||
 | 
			
		||||
# third-party imports
 | 
			
		||||
import cv2
 | 
			
		||||
import ffmpeg
 | 
			
		||||
from loguru import logger
 | 
			
		||||
from rich import print
 | 
			
		||||
from rich.console import Console
 | 
			
		||||
@ -69,9 +62,12 @@ from rich.progress import (
 | 
			
		||||
    TimeRemainingColumn,
 | 
			
		||||
)
 | 
			
		||||
from rich.text import Text
 | 
			
		||||
import cv2
 | 
			
		||||
import ffmpeg
 | 
			
		||||
 | 
			
		||||
from . import __version__
 | 
			
		||||
from .decoder import VideoDecoder
 | 
			
		||||
from .encoder import VideoEncoder
 | 
			
		||||
from .interpolator import Interpolator
 | 
			
		||||
from .upscaler import Upscaler
 | 
			
		||||
 | 
			
		||||
LEGAL_INFO = """Video2X\t\t{}
 | 
			
		||||
Author:\t\tK4YT3X
 | 
			
		||||
@ -526,7 +522,7 @@ def main() -> int:
 | 
			
		||||
            logger.critical(f"Cannot find input file: {args.input}")
 | 
			
		||||
            return 1
 | 
			
		||||
        elif not args.input.is_file():
 | 
			
		||||
            logger.critical(f"Input path is not a file")
 | 
			
		||||
            logger.critical("Input path is not a file")
 | 
			
		||||
            return 1
 | 
			
		||||
 | 
			
		||||
        # set logger level
 | 
			
		||||
@ -570,7 +566,7 @@ def main() -> int:
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
    # don't print the traceback for manual terminations
 | 
			
		||||
    except KeyboardInterrupt as e:
 | 
			
		||||
    except KeyboardInterrupt:
 | 
			
		||||
        return 2
 | 
			
		||||
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user