Skip to content

Commit

Permalink
bumped year to 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
k4yt3x committed May 9, 2023
1 parent 66f4c17 commit b4570cc
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PDM
.pdm.toml
.pdm-python
__pypackages__/

# test videos
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Video2X
Copyright (c) 2018-2022 K4YT3X and contributors.
Copyright (c) 2018-2023 K4YT3X and contributors.

This product depends on FFmpeg, which is available under
the GNU Lesser General Public License 2.1. The source code can be found at
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Copyright of this clip belongs to 株式会社アニプレックス.
## License

This project is licensed under the [GNU Affero General Public License Version 3 (GNU AGPL v3)](https://www.gnu.org/licenses/agpl-3.0.txt)\
Copyright (c) 2018-2022 K4YT3X and contributors.
Copyright (c) 2018-2023 K4YT3X and contributors.

![AGPLv3](https://www.gnu.org/graphics/agplv3-155x51.png)

Expand Down
11 changes: 3 additions & 8 deletions video2x/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018-2022 K4YT3X and contributors.
Copyright (C) 2018-2023 K4YT3X and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -40,12 +40,7 @@
Contact:\ti@k4yt3x.com"""

# algorithms available for upscaling tasks
UPSCALING_ALGORITHMS = [
"waifu2x",
"srmd",
"realsr",
"realcugan",
]
UPSCALING_ALGORITHMS = ["waifu2x", "srmd", "realsr", "realcugan", "anime4k"]

# algorithms available for frame interpolation tasks
INTERPOLATION_ALGORITHMS = ["rife"]
Expand Down Expand Up @@ -194,7 +189,7 @@ def main() -> int:
# print package version and copyright notice
logger.opt(colors=True).info(f"<magenta>Video2X {__version__}</magenta>")
logger.opt(colors=True).info(
"<magenta>Copyright (C) 2018-2022 K4YT3X and contributors.</magenta>"
"<magenta>Copyright (C) 2018-2023 K4YT3X and contributors.</magenta>"
)

# initialize video2x object
Expand Down
7 changes: 1 addition & 6 deletions video2x/decoder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018-2022 K4YT3X and contributors.
Copyright (C) 2018-2023 K4YT3X and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -102,14 +102,12 @@ def __init__(
self.pipe_printer.start()

def __iter__(self):

# continue yielding while FFmpeg continues to produce output
# it is possible to use := for this block to be more concise
# but it is purposefully avoided to remain compatible with Python 3.7
buffer = self.decoder.stdout.read(3 * self.input_width * self.input_height)

while len(buffer) > 0:

# convert raw bytes into image object
frame = Image.frombytes(
"RGB", (self.input_width, self.input_height), buffer
Expand All @@ -128,7 +126,6 @@ def kill(self):
self.decoder.send_signal(signal.SIGKILL)

def join(self):

# close PIPEs to prevent process from getting stuck
self.decoder.stdout.close()
self.decoder.stderr.close()
Expand Down Expand Up @@ -156,9 +153,7 @@ def run(self):
self.running = True
previous_frame = None
for frame_index, frame in enumerate(self.decoder):

while True:

# check for the stop signal
if self.running is False:
self.decoder.join()
Expand Down
3 changes: 1 addition & 2 deletions video2x/encoder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018-2022 K4YT3X and contributors.
Copyright (C) 2018-2023 K4YT3X and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -57,7 +57,6 @@ def __init__(
copy_data: bool = False,
copy_attachments: bool = False,
) -> None:

# create FFmpeg input for the original input video
original = ffmpeg.input(input_path)

Expand Down
3 changes: 1 addition & 2 deletions video2x/interpolator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018-2022 K4YT3X and contributors.
Copyright (C) 2018-2023 K4YT3X and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -91,7 +91,6 @@ def run(self) -> None:
# if the difference is lower than threshold
# process the interpolation
if difference_ratio < difference_threshold:

# select a processor object with the required settings
# create a new object if none are available
processor_object = self.processor_objects.get(algorithm)
Expand Down
2 changes: 1 addition & 1 deletion video2x/pipe_printer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018-2022 K4YT3X and contributors.
Copyright (C) 2018-2023 K4YT3X and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down
2 changes: 1 addition & 1 deletion video2x/processor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018-2022 K4YT3X and contributors.
Copyright (C) 2018-2023 K4YT3X and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down

0 comments on commit b4570cc

Please sign in to comment.