mirror of
https://github.com/k4yt3x/video2x.git
synced 2026-02-04 11:24:41 +08:00
Compare commits
173 Commits
4.6.1
...
5.0.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b67f373d1 | ||
|
|
7215ee1921 | ||
|
|
65c0d32a51 | ||
|
|
268460fd17 | ||
|
|
d72ecb332a | ||
|
|
8ba56e58c2 | ||
|
|
fa485b6cdd | ||
|
|
625b340f3d | ||
|
|
fa3bd38217 | ||
|
|
0fca5c8e9a | ||
|
|
237f6336ec | ||
|
|
083af60c6f | ||
|
|
f7756886e7 | ||
|
|
6e72df66fc | ||
|
|
2bfcb13976 | ||
|
|
49e0375eee | ||
|
|
4459f4d3be | ||
|
|
c0fe81bd2e | ||
|
|
8cb64d3b70 | ||
|
|
0b154a715c | ||
|
|
05031b2b5a | ||
|
|
2510c8fa28 | ||
|
|
f17d75539c | ||
|
|
82512ef10c | ||
|
|
ad479e53b8 | ||
|
|
a356bfeaff | ||
|
|
dee8e23485 | ||
|
|
1fa0821057 | ||
|
|
b5ecffba81 | ||
|
|
672c9b8652 | ||
|
|
9f73e75f17 | ||
|
|
ef1a8f3e41 | ||
|
|
04f409ef80 | ||
|
|
51c8693dce | ||
|
|
bb572e2468 | ||
|
|
c07fafc0e9 | ||
|
|
595b179d3c | ||
|
|
c865d494a1 | ||
|
|
f4acb2188d | ||
|
|
01d4006c75 | ||
|
|
a7f0f34751 | ||
|
|
b6b1bf9f0e | ||
|
|
5d7a53a2fc | ||
|
|
b32e0ec132 | ||
|
|
6378a36d91 | ||
|
|
0d0fd70a24 | ||
|
|
7c0e9c45d8 | ||
|
|
7b60041529 | ||
|
|
6ffd6282e0 | ||
|
|
c37e7f0d72 | ||
|
|
ca1e593874 | ||
|
|
bfb0f339e2 | ||
|
|
3690337092 | ||
|
|
6c129a1c7a | ||
|
|
2b539c15f7 | ||
|
|
53456cd442 | ||
|
|
e1f4cdd71d | ||
|
|
ab6d2e3c9e | ||
|
|
f69c95a608 | ||
|
|
c103e45076 | ||
|
|
240d722fda | ||
|
|
14f3cd1e16 | ||
|
|
f4cc178dcd | ||
|
|
ad825bd2ba | ||
|
|
151733c8f8 | ||
|
|
544a7081ed | ||
|
|
4b3bde1615 | ||
|
|
b38cef2de2 | ||
|
|
b27da8a61a | ||
|
|
5e4170b0b7 | ||
|
|
b3539d4aa8 | ||
|
|
d09efc4748 | ||
|
|
dc532ff184 | ||
|
|
1fbb2f22f3 | ||
|
|
339815f74c | ||
|
|
fa6dc88faa | ||
|
|
ce344caa72 | ||
|
|
d8aed8065b | ||
|
|
6b83734382 | ||
|
|
2b52d4aa45 | ||
|
|
a515886ad8 | ||
|
|
a7629db518 | ||
|
|
ba336e9c75 | ||
|
|
736771b1c8 | ||
|
|
f9f736bec1 | ||
|
|
535681f3cd | ||
|
|
f283a12a0b | ||
|
|
ac80de9399 | ||
|
|
7eabac2175 | ||
|
|
e870399af1 | ||
|
|
37d567f208 | ||
|
|
7b9e811c99 | ||
|
|
0d97a11015 | ||
|
|
079a2aa64b | ||
|
|
9cdddd2e41 | ||
|
|
26d82e1582 | ||
|
|
c4e73cfbc7 | ||
|
|
2fffeeadf1 | ||
|
|
25155b3029 | ||
|
|
26795c5561 | ||
|
|
5543382d03 | ||
|
|
dc51b8b04c | ||
|
|
cde02be32b | ||
|
|
9213e3e13a | ||
|
|
b41f1f7e6c | ||
|
|
7201c036d5 | ||
|
|
da532d8e13 | ||
|
|
f97ed080e1 | ||
|
|
d67f55c824 | ||
|
|
095d40b688 | ||
|
|
bd6690fed1 | ||
|
|
bfda833bcf | ||
|
|
09345703e6 | ||
|
|
64e4a41710 | ||
|
|
f7b8b2520a | ||
|
|
fad793b18e | ||
|
|
d09d05ae9b | ||
|
|
89ca3b09d9 | ||
|
|
4694c557ec | ||
|
|
33d96bcd4e | ||
|
|
eee43def3b | ||
|
|
f4be9cc596 | ||
|
|
cc89b0aac5 | ||
|
|
9e8e95803f | ||
|
|
df0861ff5c | ||
|
|
706aeab03f | ||
|
|
f850ca80f1 | ||
|
|
608bf1a2ec | ||
|
|
b1f7290c20 | ||
|
|
65d445c293 | ||
|
|
43dbb134b6 | ||
|
|
84b0684d64 | ||
|
|
29b4153b63 | ||
|
|
3f1821f1ac | ||
|
|
4f8bb1be1c | ||
|
|
c2f1e43656 | ||
|
|
914d5cdf87 | ||
|
|
de77c90dd1 | ||
|
|
458ce82644 | ||
|
|
1d145a8690 | ||
|
|
b37acfa31d | ||
|
|
a0522311e2 | ||
|
|
7de9cc699a | ||
|
|
685648957f | ||
|
|
c2260ca709 | ||
|
|
776475265e | ||
|
|
21928f9eb4 | ||
|
|
211f024e49 | ||
|
|
bfdb051705 | ||
|
|
d824cd6516 | ||
|
|
b4f46ad31e | ||
|
|
a8d7f7ecf2 | ||
|
|
2b84e497b5 | ||
|
|
9b408a6e62 | ||
|
|
ecf94490a7 | ||
|
|
881183ed0a | ||
|
|
9389511d2d | ||
|
|
16389fc8a6 | ||
|
|
c7013b2576 | ||
|
|
a82fcc778e | ||
|
|
6dbdf93ca4 | ||
|
|
64eb03ac08 | ||
|
|
227cf54a47 | ||
|
|
107d31e5dc | ||
|
|
04562dcaa1 | ||
|
|
7059852586 | ||
|
|
8b7e9f959b | ||
|
|
19bd05149d | ||
|
|
a3706a1a17 | ||
|
|
5a7c464dea | ||
|
|
6c1b49b5ed | ||
|
|
59860dcfc3 | ||
|
|
b38ce2c56d |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,6 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
github: k4yt3x
|
||||
patreon: k4yt3x
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
26
.github/ISSUE_TEMPLATE/bug-report.md
vendored
26
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -1,26 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Use this template if you believe you've encountered a bug.
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: K4YT3X
|
||||
|
||||
---
|
||||
|
||||
## Component Versions
|
||||
|
||||
Please at least fill in the release version and GUI or CLI version.
|
||||
|
||||
- **Video2X release version**:
|
||||
- **Upscaler version**:
|
||||
- **GUI version**:
|
||||
- **CLI version**:
|
||||
|
||||
## Symptom
|
||||
|
||||
In this section, briefly describe what's going on.
|
||||
|
||||
## Error Log or Screenshots
|
||||
|
||||
Please upload or paste the error log here. You may also include screenshots.
|
||||
**It is highly recommended to include your error log.**
|
||||
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,16 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Request a new feature to be added
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: K4YT3X
|
||||
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
Briefly describe the feature that you'd like Video2X to have.
|
||||
|
||||
## Sources
|
||||
|
||||
Paste links to descriptions of related documentations, websites and etc. here.
|
||||
41
.github/workflows/ci.yml
vendored
Normal file
41
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- dev/*
|
||||
pull_request: {}
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
ubuntu:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
python3-opencv python3-pil python3-tqdm python3-dev \
|
||||
libvulkan-dev glslang-dev glslang-tools swig
|
||||
pip install wheel
|
||||
- name: Build wheels
|
||||
run: |
|
||||
pip wheel -w /tmp/wheels \
|
||||
rife-ncnn-vulkan-python@git+https://github.com/media2x/rife-ncnn-vulkan-python.git .
|
||||
- name: Package artifacts
|
||||
run: |
|
||||
tar cJvf /tmp/video2x-nightly-wheels.txz /tmp/wheels/*
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: video2x-nightly-wheels
|
||||
path: /tmp/video2x-nightly-wheels.txz
|
||||
54
.github/workflows/codeql-analysis.yml
vendored
54
.github/workflows/codeql-analysis.yml
vendored
@@ -1,54 +0,0 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: '0 4 * * 5'
|
||||
|
||||
jobs:
|
||||
analyse:
|
||||
name: Analyse
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
# languages: go, javascript, csharp, python, cpp, java
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
69
.github/workflows/nightly.yml
vendored
69
.github/workflows/nightly.yml
vendored
@@ -1,69 +0,0 @@
|
||||
# Name: Video2X Nightly Build
|
||||
# Creator: K4YT3X
|
||||
# Date Created: May 12, 2020
|
||||
# Last Modified: May 28, 2020
|
||||
|
||||
name: Video2X Nightly Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: src
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
pip install -U pyinstaller pywin32
|
||||
pip install -U -r requirements.txt
|
||||
- name: Build Video2X CLI
|
||||
run: |
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="wrappers;wrappers" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x.py
|
||||
- name: Build Video2X GUI
|
||||
run: |
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--add-data="images;images" `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="video2x_gui.ui;." `
|
||||
--add-data="wrappers;wrappers" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x_gui.py
|
||||
- name: Build Video2X setup script
|
||||
run: |
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--additional-hooks-dir "pyinstaller\hooks" `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="pyinstaller\7z1900-extra;7z" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x_setup.py
|
||||
- name: Collect artifacts into folder
|
||||
run: |
|
||||
New-Item "video2x-nightly-win32-light\" -ItemType Directory
|
||||
Copy-Item "dist\video2x.exe" -Destination "video2x-nightly-win32-light\"
|
||||
Copy-Item "dist\video2x_gui.exe" -Destination "video2x-nightly-win32-light\"
|
||||
Copy-Item "dist\video2x_setup.exe" -Destination "video2x-nightly-win32-light\"
|
||||
Copy-Item "video2x.yaml" -Destination "video2x-nightly-win32-light\"
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: video2x-nightly-win32-light
|
||||
path: src/video2x-nightly-win32-light/
|
||||
78
.github/workflows/release.yml
vendored
Normal file
78
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
if: github.event.base_ref == 'refs/heads/master'
|
||||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tag: ${{ steps.get_tag.outputs.tag }}
|
||||
steps:
|
||||
- name: Get tag
|
||||
id: get_tag
|
||||
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
|
||||
|
||||
create-release:
|
||||
name: Create release
|
||||
needs:
|
||||
- setup
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
steps:
|
||||
- name: Create release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ needs.setup.outputs.tag }}
|
||||
release_name: Video2X ${{ needs.setup.outputs.tag }}
|
||||
draft: true
|
||||
prerelease: false
|
||||
|
||||
container:
|
||||
name: Build and upload container
|
||||
needs:
|
||||
- setup
|
||||
- create-release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- uses: mr-smithers-excellent/docker-build-push@v5
|
||||
name: Build & push the Docker image
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USER }}
|
||||
password: ${{ secrets.GHCR_TOKEN }}
|
||||
dockerfile: Dockerfile
|
||||
image: video2x
|
||||
tags: latest, ${{ needs.setup.outputs.tag }}
|
||||
|
||||
container-variants:
|
||||
name: Build and upload variants of the container
|
||||
needs:
|
||||
- setup
|
||||
- create-release
|
||||
strategy:
|
||||
matrix:
|
||||
version:
|
||||
- slim-alpine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- uses: mr-smithers-excellent/docker-build-push@v5
|
||||
name: Build & push the Docker image
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USER }}
|
||||
password: ${{ secrets.GHCR_TOKEN }}
|
||||
dockerfile: Dockerfile.${{ matrix.version }}
|
||||
image: video2x
|
||||
tags: ${{ needs.setup.outputs.tag }}-${{ matrix.version }}
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,8 +1,17 @@
|
||||
# QtCreator
|
||||
video2x_gui.pyproject.user
|
||||
# PDM
|
||||
.pdm.toml
|
||||
__pypackages__/
|
||||
|
||||
# PyCharm
|
||||
.idea/
|
||||
# test videos
|
||||
*.mp4
|
||||
*.mkv
|
||||
*.mov
|
||||
*.avi
|
||||
*.flv
|
||||
*.webm
|
||||
|
||||
# vim session file
|
||||
Session.vim
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
@@ -107,4 +116,4 @@ venv.bak/
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.mypy_cache/
|
||||
|
||||
61
Dockerfile
61
Dockerfile
@@ -1,31 +1,42 @@
|
||||
# Name: Video2X Dockerfile
|
||||
# Creator: Danielle Douglas
|
||||
# Date Created: Unknown
|
||||
# Last Modified: January 14, 2020
|
||||
# Creator: K4YT3X
|
||||
# Date Created: February 3, 2022
|
||||
# Last Modified: March 28, 2022
|
||||
|
||||
# Editor: Lhanjian
|
||||
# Last Modified: May 24, 2020
|
||||
# stage 1: build the python components into wheels
|
||||
FROM docker.io/nvidia/vulkan:1.2.133-450 AS builder
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Editor: K4YT3X
|
||||
# Last Modified: June 13, 2020
|
||||
|
||||
# using Ubuntu LTS 19.10
|
||||
# Ubuntu 20.x is incompatible with Nvidia libraries
|
||||
FROM ubuntu:19.10
|
||||
|
||||
# file mainainter labels
|
||||
LABEL maintainer="Danielle Douglas <ddouglas87@gmail.com>"
|
||||
LABEL maintainer="Lhanjian <lhjay1@foxmail.com>"
|
||||
LABEL maintainer="K4YT3X <k4yt3x@k4yt3x.com>"
|
||||
|
||||
# run installation
|
||||
COPY . /video2x
|
||||
WORKDIR /video2x
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y git-core \
|
||||
&& git clone --recurse-submodules --progress https://github.com/k4yt3x/video2x.git /tmp/video2x/video2x \
|
||||
&& bash -e /tmp/video2x/video2x/src/video2x_setup_ubuntu.sh /
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
python3.8 python3-pip python3-opencv python3-pil \
|
||||
python3.8-dev libvulkan-dev glslang-dev glslang-tools \
|
||||
build-essential swig \
|
||||
&& pip wheel -w /wheels wheel pdm-pep517 .
|
||||
|
||||
# stage 2: install wheels into the final image
|
||||
FROM docker.io/nvidia/vulkan:1.2.133-450
|
||||
LABEL maintainer="K4YT3X <i@k4yt3x.com>" \
|
||||
org.opencontainers.image.source="https://github.com/k4yt3x/video2x" \
|
||||
org.opencontainers.image.description="A lossless video/GIF/image upscaler"
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json\
|
||||
:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json\
|
||||
:/usr/share/vulkan/icd.d/intel_icd.x86_64.json
|
||||
|
||||
COPY --from=builder /var/lib/apt/lists* /var/lib/apt/lists/
|
||||
COPY --from=builder /wheels /wheels
|
||||
COPY . /video2x
|
||||
WORKDIR /video2x
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
python3-pip python3.8-dev \
|
||||
python3-opencv python3-pil \
|
||||
mesa-vulkan-drivers cuda-drivers ffmpeg \
|
||||
&& pip install --no-cache-dir --no-index -f /wheels . \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /wheels /video2x /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /host
|
||||
ENTRYPOINT ["python3.8", "/video2x/src/video2x.py"]
|
||||
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES all
|
||||
ENV DEBIAN_FRONTEND teletype
|
||||
ENTRYPOINT ["/usr/bin/python3.8", "-m", "video2x"]
|
||||
|
||||
34
Dockerfile.slim-alpine
Normal file
34
Dockerfile.slim-alpine
Normal file
@@ -0,0 +1,34 @@
|
||||
# Name: Video2X Dockerfile (Slim Alpine)
|
||||
# Creator: K4YT3X
|
||||
# Date Created: February 1, 2022
|
||||
# Last Modified: March 18, 2022
|
||||
|
||||
# stage: build python components into heels
|
||||
FROM docker.io/library/python:3.10.4-alpine3.15 AS builder
|
||||
COPY . /video2x
|
||||
WORKDIR /video2x
|
||||
RUN apk add --no-cache \
|
||||
cmake g++ gcc git ninja swig linux-headers \
|
||||
ffmpeg-dev glslang-dev jpeg-dev vulkan-loader-dev zlib-dev \
|
||||
&& pip install -U pip \
|
||||
&& CMAKE_ARGS="-DWITH_FFMPEG=YES" pip wheel -w /wheels opencv-python \
|
||||
&& pip wheel -w /wheels wheel pdm-pep517 .
|
||||
|
||||
# stage 2: install wheels into final image
|
||||
FROM docker.io/library/python:3.10.4-alpine3.15
|
||||
LABEL maintainer="K4YT3X <i@k4yt3x.com>" \
|
||||
org.opencontainers.image.source="https://github.com/k4yt3x/video2x" \
|
||||
org.opencontainers.image.description="A lossless video/GIF/image upscaler"
|
||||
|
||||
COPY --from=builder /wheels /wheels
|
||||
COPY . /video2x
|
||||
WORKDIR /video2x
|
||||
RUN apk add --no-cache --virtual .run-deps \
|
||||
ffmpeg libgomp libjpeg-turbo libstdc++ \
|
||||
vulkan-loader mesa-vulkan-ati \
|
||||
&& pip install --no-cache-dir -U pip \
|
||||
&& pip install --no-cache-dir --no-index -f /wheels . \
|
||||
&& rm -rf /wheels /video2x
|
||||
|
||||
WORKDIR /host
|
||||
ENTRYPOINT ["/usr/local/bin/python", "-m", "video2x"]
|
||||
147
LICENSE
147
LICENSE
@@ -1,23 +1,21 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
@@ -72,7 +60,7 @@ modification follow.
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
@@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
43
NOTICE
Normal file
43
NOTICE
Normal file
@@ -0,0 +1,43 @@
|
||||
Video2X
|
||||
Copyright (c) 2018-2022 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
|
||||
https://www.gnu.org/licenses/agpl-3.0.txt.
|
||||
|
||||
This product depends on waifu2x-ncnn-vulkan, which is available under
|
||||
the MIT License. The source code can be found at
|
||||
https://github.com/nihui/waifu2x-ncnn-vulkan.
|
||||
|
||||
This product depends on srmd-ncnn-vulkan, which is available under
|
||||
the MIT License. The source code can be found at
|
||||
https://github.com/nihui/srmd-ncnn-vulkan.
|
||||
|
||||
This product depends on realsr-ncnn-vulkan, which is available under
|
||||
the MIT License. The source code can be found at
|
||||
https://github.com/nihui/realsr-ncnn-vulkan.
|
||||
|
||||
This product depends on rife-ncnn-vulkan, which is available under
|
||||
the MIT License. The source code can be found at
|
||||
https://github.com/nihui/rife-ncnn-vulkan.
|
||||
|
||||
This product depends on ffmpeg-python, which is available under
|
||||
the Apache License Version 2.0. The source code can be found at
|
||||
https://github.com/kkroening/ffmpeg-python.
|
||||
|
||||
This product depends on Loguru, which is available under
|
||||
the MIT License. The source code can be found at
|
||||
https://github.com/Delgan/loguru.
|
||||
|
||||
This product depends on opencv-python, which is available under
|
||||
the MIT License. The source code can be found at
|
||||
https://github.com/opencv/opencv-python.
|
||||
|
||||
This product depends on Pillow, which is available under
|
||||
the Historical Permission Notice and Disclaimer. The source code
|
||||
can be found at
|
||||
https://github.com/python-pillow/Pillow.
|
||||
|
||||
This product depends on Rich, which is available under
|
||||
the MIT License. The source code can be found at
|
||||
https://github.com/Textualize/rich.
|
||||
330
README.md
330
README.md
@@ -1,312 +1,124 @@
|
||||
<p align="center">
|
||||
<img src="https://user-images.githubusercontent.com/21986859/81626588-ae5ab800-93eb-11ea-918f-ebe98c2de40a.png"/>
|
||||
<img src="https://user-images.githubusercontent.com/21986859/102733190-872a7880-4334-11eb-8e9e-0ca747f130b1.png"/>
|
||||
</br>
|
||||
<img src="https://img.shields.io/github/v/release/k4yt3x/video2x?style=flat-square"/>
|
||||
<img src="https://img.shields.io/github/workflow/status/k4yt3x/video2x/CI?label=CI&style=flat-square"/>
|
||||
<img src="https://img.shields.io/github/downloads/k4yt3x/video2x/total?style=flat-square"/>
|
||||
<img src="https://img.shields.io/github/license/k4yt3x/video2x?style=flat-square"/>
|
||||
<img src="https://img.shields.io/badge/dynamic/json?color=%23e85b46&label=Patreon&query=data.attributes.patron_count&suffix=%20patrons&url=https%3A%2F%2Fwww.patreon.com%2Fapi%2Fcampaigns%2F4507807&style=flat-square"/>
|
||||
</p>
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
## [💬 Telegram Discussion Group](https://t.me/video2x)
|
||||
|
||||
<!--# Video2X Lossless Video Enlarger-->
|
||||
Join our Telegram discussion group to ask any questions you have about Video2X, chat directly with the developers, or discuss about upscaling technologies and the future of Video2X in general.
|
||||
|
||||
### Official Discussion Group (Telegram): https://t.me/video2x
|
||||
## [🪟 Download Windows Releases](https://github.com/k4yt3x/video2x/releases/tag/4.8.1)
|
||||
|
||||
## [Download Stable/Beta Builds](https://github.com/k4yt3x/video2x/releases/latest) (Windows)
|
||||
The latest Windows update is built based on version 4.8.1. GUI is not available for 5.0.0 yet, but is already under development. Go to the [GUI](https://github.com/k4yt3x/video2x/wiki/GUI) page to see the basic usages of the GUI. Try the [mirror](https://files.k4yt3x.com/Projects/Video2X/latest) if you can't download releases directly from GitHub.
|
||||
|
||||
- **`Full`**: full package comes pre-configured with **all** dependencies like `FFmpeg` and `waifu2x-caffe`.
|
||||
- **`Light`**: ligt package comes with only Video2X binaries and a template configuration file. The user will either have to run the setup script or install and configure dependencies themselves.
|
||||
## [📔 Google Colab](https://colab.research.google.com/drive/1gWEwcA9y57EsxwOjmLNmNMXPsafw0kGo)
|
||||
|
||||
Go to the **[Quick Start](#quick-start)** section for usages.
|
||||
You can use Video2X on [Google Colab](https://colab.research.google.com/) **for free** if you don't have a powerful GPU of your own. You can borrow a powerful GPU (Tesla K80, T4, P4, or P100) on Google's server for free for a maximum of 12 hours per session. **Please use the free resource fairly** and do not create sessions back-to-back and run upscaling 24/7. This might result in you getting banned. You can get [Colab Pro/Pro+](https://colab.research.google.com/signup/pricing) if you'd like to use better GPUs and get longer runtimes. Usage instructions are embedded in the [Colab Notebook](https://colab.research.google.com/drive/1gWEwcA9y57EsxwOjmLNmNMXPsafw0kGo).
|
||||
|
||||
### [Download From Mirror](https://files.k4yt3x.com/Projects/Video2X/latest)
|
||||
## [🌙 Download Nightly Releases](https://github.com/k4yt3x/video2x/actions/workflows/ci.yml)
|
||||
|
||||
In case you're unable to download the releases directly from GitHub, you can try downloading from the mirror site hosted by the author. Only releases will be updated in this directory, not nightly builds.
|
||||
Nightly releases are automatically created by the GitHub Actions CI/CD pipelines. They usually contain more experimental features and bug fixes. However, they are much less stable to the stable releases. **You must log in to GitHub to download CI build artifacts.**
|
||||
|
||||
## [Download Nightly Builds](https://github.com/k4yt3x/video2x/actions) (Windows)
|
||||
## [📦 Container Image](https://github.com/k4yt3x/video2x/pkgs/container/video2x)
|
||||
|
||||
**You need to be logged into GitHub to be able to download GitHub Actions artifacts.**
|
||||
Video2X container images are available on the GitHub Container Registry for easy deployment on Linux and macOS. If you already have Docker/Podman installed, only one command is needed to start upscaling a video. For more information on how to use Video2X's Docker image, please refer to the [documentations](https://github.com/K4YT3X/video2x/wiki/Container).
|
||||
|
||||
Nightly builds are built automatically every time a new commit is pushed to the master branch. The lates nightly build is always up-to-date with the latest version of the code, but is less stable and may contain bugs. Nightly builds are handled by GitHub's integrated CI/CD tool, GitHub Actions.
|
||||
## [📖 Documentations](https://github.com/k4yt3x/video2x/wiki)
|
||||
|
||||
To download the latest nightly build, go to the [GitHub Actions](https://github.com/k4yt3x/video2x/actions) tab, enter the last run of workflow "Video2X Nightly Build, and download the artifacts generated from the run.
|
||||
|
||||
## [Docker Image](https://hub.docker.com/r/k4yt3x/video2x)
|
||||
|
||||
Video2X Docker images are available on Docker Hub for easy and rapid Video2X deployment on Linux and macOS. If you already have Docker installed, then only one command is needed to start upscaling a video. For more information on how to use Video2X's Docker image, please refer to the [documentations](https://github.com/K4YT3X/video2x/wiki/Docker).
|
||||
Video2X's documentations are hosted on this repository's [Wiki page](https://github.com/k4yt3x/video2x/wiki). It includes comprehensive explanations for how to use the [GUI](https://github.com/k4yt3x/video2x/wiki/GUI), the [CLI](https://github.com/k4yt3x/video2x/wiki/CLI), the [container image](https://github.com/K4YT3X/video2x/wiki/Container), the [library](https://github.com/k4yt3x/video2x/wiki/Library), and more. The Wiki is open to edits by the community, so you, yes you, can also correct errors or add new contents to the documentations.
|
||||
|
||||
## Introduction
|
||||
|
||||
Video2X is a video/GIF/image upscaling software based on Waifu2X, Anime4K, SRMD and RealSR written in Python 3. It upscales videos, GIFs and images, restoring details from low-resolution inputs. Video2X also accepts GIF input to video output and video input to GIF output.
|
||||
|
||||
Currently, Video2X supports the following drivers (implementations of algorithms).
|
||||
|
||||
- **Waifu2X Caffe**: Caffe implementation of waifu2x
|
||||
- **Waifu2X Converter CPP**: CPP implementation of waifu2x based on OpenCL and OpenCV
|
||||
- **Waifu2X NCNN Vulkan**: NCNN implementation of waifu2x based on Vulkan API
|
||||
- **SRMD NCNN Vulkan**: NCNN implementation of SRMD based on Vulkan API
|
||||
- **RealSR NCNN Vulkan**: NCNN implementation of RealSR based on Vulkan API
|
||||
- **Anime4KCPP**: CPP implementation of Anime4K
|
||||
Video2X is a video/GIF/image upscaling and frame interpolation software written in Python. It can use these following state-of-the-art algorithms to increase the resolution and frame rate of your video/GIF/image. More information about the algorithms that it supports can be found in [the documentations](https://github.com/k4yt3x/video2x/wiki/Algorithms).
|
||||
|
||||
### Video Upscaling
|
||||
|
||||
\
|
||||
*Upscale Comparison Demonstration*
|
||||
_Upscale demo: Spirited Away's movie trailer_
|
||||
|
||||
**You can watch the whole demo video on YouTube: https://youtu.be/mGEfasQl2Zo**
|
||||
|
||||
Clip is from trailer of animated movie "千と千尋の神隠し". Copyright belongs to "株式会社スタジオジブリ (STUDIO GHIBLI INC.)". Will delete immediately if use of clip is in violation of copyright.
|
||||
- **Spirited Away**: [YouTube](https://youtu.be/mGEfasQl2Zo) | [Bilibili](https://www.bilibili.com/video/BV1V5411471i/)
|
||||
- 360P to 4K
|
||||
- The [original video](https://www.youtube.com/watch?v=ByXuk9QqQkk)'s copyright belongs to 株式会社スタジオジブリ
|
||||
- **Bad Apple!!**: [YouTube](https://youtu.be/A81rW_FI3cw) | [Bilibili](https://www.bilibili.com/video/BV16K411K7ue)
|
||||
- 384P to 4K 120FPS
|
||||
- The [original video](https://www.nicovideo.jp/watch/sm8628149)'s copyright belongs to あにら
|
||||
- **The Pet Girl of Sakurasou**: [YouTube](https://youtu.be/M0vDI1HH2_Y) | [Bilibili](https://www.bilibili.com/video/BV14k4y167KP/)
|
||||
- 240P to 1080P 60FPS
|
||||
- The original video's copyright belongs to ASCII Media Works
|
||||
|
||||
### GIF Upscaling
|
||||
|
||||
This original input GIF is 160x120 in size. This image is downsized and accelerated to 20 FPS from its [original image](https://gfycat.com/craftyeasygoingankole-capoo-bug-cat).
|
||||
|
||||
\
|
||||
*Catfru original 160x120 GIF image*
|
||||
|
||||
Below is what it looks like after getting upscaled to 640x480 (4x) using Video2X.
|
||||
|
||||

|
||||
\
|
||||
*Catfru 4x upscaled GIF*
|
||||
_Catfru scaled up to 4x its original size using waifu2x [(original image)](https://gfycat.com/craftyeasygoingankole-capoo-bug-cat)_
|
||||
|
||||
### Image Upscaling
|
||||
|
||||
\
|
||||
*Image upscaling example*
|
||||
\
|
||||
_Image 8x upscaling demo ([original image](https://72915.tumblr.com/post/173793265673) by [nananicu](https://twitter.com/nananicu))_
|
||||
|
||||
[Original image](https://72915.tumblr.com/post/173793265673) from [nananicu@twitter](https://twitter.com/nananicu/status/994546266968281088), edited by K4YT3X.
|
||||
### Standard Test Clip
|
||||
|
||||
## All Demo Videos
|
||||
The following clip can be used to test if your setup works properly. This is also the standard clip used for running performance benchmarks.
|
||||
|
||||
Below is a list of all the demo videos available.
|
||||
The list is sorted from new to old.
|
||||
- [Standard Test Clip (240P)](https://files.k4yt3x.com/Resources/Videos/standard-test.mp4) 4.54 MiB
|
||||
- [waifu2x Upscaled Sample (1080P)](https://files.k4yt3x.com/Resources/Videos/standard-waifu2x.mp4) 4.54 MiB
|
||||
- [Original Ground Truth (1080P)](https://files.k4yt3x.com/Resources/Videos/standard-original.mp4) 22.2 MiB
|
||||
|
||||
- **Bad Apple!!**
|
||||
- YouTube: https://youtu.be/-RKLdCELgkQ
|
||||
- Bilibili: https://www.bilibili.com/video/BV1s5411s7xV/
|
||||
- **The Pet Girl of Sakurasou 240P to 1080P 60FPS**
|
||||
- Original name: さくら荘のペットな彼女
|
||||
- YouTube: https://youtu.be/M0vDI1HH2_Y
|
||||
- Bilibili: https://www.bilibili.com/video/BV14k4y167KP/
|
||||
- **Spirited Away (360P to 4K)**
|
||||
- Original name: 千と千尋の神隠し
|
||||
- YouTube: https://youtu.be/mGEfasQl2Zo
|
||||
- Bilibili: https://www.bilibili.com/video/BV1V5411471i/
|
||||
|
||||
---
|
||||
|
||||
## Screenshots
|
||||
|
||||
### Video2X GUI
|
||||
|
||||
\
|
||||
*Video2X GUI Screenshot*
|
||||
|
||||
### Video2X CLI
|
||||
|
||||
\
|
||||
*Video2X CLI Screenshot*
|
||||
|
||||
---
|
||||
|
||||
### Sample Videos
|
||||
|
||||
If you can't find a video clip to begin with, or if you want to see a before-after comparison, we have prepared some sample clips for you. The quick start guide down below will also be based on the name of the sample clips.
|
||||
|
||||
\
|
||||
*Sample Upscale Videos*
|
||||
|
||||
- [Sample Video (240P) 4.54MB](https://files.k4yt3x.com/Resources/Videos/sample_input.mp4)
|
||||
- [Sample Video Upscaled (1080P) 4.54MB](https://files.k4yt3x.com/Resources/Videos/sample_output.mp4)
|
||||
- [Sample Video Original (1080P) 22.2MB](https://files.k4yt3x.com/Resources/Videos/sample_original.mp4)
|
||||
|
||||
Clip is from anime "さくら荘のペットな彼女". Copyright belongs to "株式会社アニプレックス (Aniplex Inc.)". Will delete immediately if use of clip is in violation of copyright.
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Before running Video2X, you'll need to ensure you have installed the drivers' external dependencies such as GPU drivers.
|
||||
|
||||
- waifu2x-caffe
|
||||
- GPU mode: Nvidia graphics card driver
|
||||
- cuDNN mode: Nvidia CUDA and [cuDNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows)
|
||||
- Other Drivers
|
||||
- GPU driver if you want to use GPU for processing
|
||||
|
||||
### Running Video2X (GUI)
|
||||
|
||||
The easiest way to run Video2X is to use the full build. Extract the full release zip file and you'll get these files.
|
||||
|
||||
\
|
||||
*Video2X release files*
|
||||
|
||||
Simply double click on video2x_gui.exe to launch the GUI.
|
||||
|
||||
\
|
||||
*Video2X GUI main tab*
|
||||
|
||||
Then, drag the videos you wish to upscale into the window and select the appropriate output path.
|
||||
|
||||
\
|
||||
*Drag and drop file into Video2X GUI*
|
||||
|
||||
Tweak the settings if you want to, then hit the start button at the bottom and the upscale will start. Now you'll just have to wait for it to complete.
|
||||
|
||||
\
|
||||
*Video2X started processing input files*
|
||||
|
||||
### Running Video2X (CLI)
|
||||
|
||||
#### Basic Upscale Example
|
||||
|
||||
This example command below uses `waifu2x-caffe` to enlarge the video `sample-input.mp4` two double its original size.
|
||||
|
||||
```shell
|
||||
python video2x.py -i sample-input.mp4 -o sample-output.mp4 -r 2 -d waifu2x_caffe
|
||||
```
|
||||
|
||||
#### Advanced Upscale Example
|
||||
|
||||
If you would like to tweak engine-specific settings, either specify the corresponding argument after `--`, or edit the corresponding field in the configuration file `video2x.yaml`. **Command line arguments will overwrite default values in the config file.**
|
||||
|
||||
This example below adds enables TTA for `waifu2x-caffe`.
|
||||
|
||||
```shell
|
||||
python video2x.py -i sample-input.mp4 -o sample-output.mp4 -r 2 -d waifu2x_caffe -- --tta 1
|
||||
```
|
||||
|
||||
To see a help page for driver-specific settings, use `-d` to select the driver and append `-- --help` as demonstrated below. This will print all driver-specific settings and descriptions.
|
||||
|
||||
```shell
|
||||
python video2x.py -d waifu2x_caffe -- --help
|
||||
```
|
||||
|
||||
### Running Video2X (Docker)
|
||||
|
||||
Video2X can be deployed via Docker. The following command upscales the video `sample_input.mp4` two times with Waifu2X NCNN Vulkan and outputs the upscaled video to `sample_output.mp4`. For more details on Video2X Docker image usages, please refer to the [documentations](https://github.com/K4YT3X/video2x/wiki/Docker).
|
||||
|
||||
```shell
|
||||
docker run --rm -it --gpus all -v /dev/dri:/dev/dri -v $PWD:/host k4yt3x/video2x:4.6.0 -d waifu2x_ncnn_vulkan -r 2 -i sample_input.mp4 -o sample_output.mp4
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Documentations
|
||||
|
||||
### [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki)
|
||||
|
||||
You can find all detailed user-facing and developer-facing documentations in the [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki). It covers everything from step-by-step instructions for beginners, to the code structure of this program for advanced users and developers. If this README page doesn't answer all your questions, the wiki page is where you should head to.
|
||||
|
||||
### [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial)
|
||||
|
||||
For those who want a detailed walk-through of how to use Video2X, you can head to the [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial) wiki page. It includes almost every step you need to perform in order to enlarge your first video.
|
||||
|
||||
### [Run From Source Code](https://github.com/k4yt3x/video2x/wiki/Run-From-Source-Code)
|
||||
|
||||
This wiki page contains all instructions for how you can run Video2X directly from Python source code.
|
||||
|
||||
### [Drivers](https://github.com/k4yt3x/video2x/wiki/Drivers)
|
||||
|
||||
Go to the [Drivers](https://github.com/k4yt3x/video2x/wiki/Drivers) wiki page if you want to see a detailed description on the different types of drivers implemented by Video2X. This wiki page contains detailed difference between different drivers, and how to download and set each of them up for Video2X.
|
||||
|
||||
### [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A)
|
||||
|
||||
If you have any questions, first try visiting our [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A) page to see if your question is answered there. If not, open an issue and we will respond to your questions ASAP. Alternatively, you can also join our [Telegram discussion group](https://t.me/video2x) and ask your questions there.
|
||||
|
||||
### [History](https://github.com/k4yt3x/video2x/wiki/History)
|
||||
|
||||
Are you interested in how the idea of Video2X was born? Do you want to know the stories and histories behind Video2X's development? Come into this page.
|
||||
|
||||
---
|
||||
|
||||
# Full Usage
|
||||
|
||||
## Video2X Options
|
||||
|
||||
### -h, --help
|
||||
show this help message and exit
|
||||
|
||||
### -i INPUT, --input INPUT
|
||||
source video file/directory
|
||||
|
||||
### -o OUTPUT, --output OUTPUT
|
||||
output video file/directory
|
||||
|
||||
### -c CONFIG, --config CONFIG
|
||||
video2x config file path
|
||||
|
||||
### --log LOG
|
||||
log file path (default: program_directory\video2x_%Y-%m-%d_%H-%M-%S.log)
|
||||
|
||||
### --disable_logging
|
||||
disable logging (default: False)
|
||||
|
||||
### -v, --version
|
||||
display version, lawful information and exit
|
||||
|
||||
## Upscaling Options
|
||||
|
||||
### -d DRIVER, --driver DRIVER
|
||||
upscaling driver (default: waifu2x_caffe)
|
||||
|
||||
Available options are:
|
||||
|
||||
- waifu2x_caffe
|
||||
- waifu2x_converter_cpp
|
||||
- waifu2x_ncnn_vulkan
|
||||
- srmd_ncnn_vulkan
|
||||
- realsr_ncnn_vulkan
|
||||
- anime4kcpp
|
||||
|
||||
### -r RATIO, --ratio RATIO
|
||||
scaling ratio
|
||||
|
||||
### -p PROCESSES, --processes PROCESSES
|
||||
number of processes to use for upscaling (default: 1)
|
||||
|
||||
### --preserve_frames
|
||||
preserve extracted and upscaled frames (default: False)
|
||||
|
||||
---
|
||||
The original clip came from the anime "さくら荘のペットな彼女."\
|
||||
Copyright of this clip belongs to 株式会社アニプレックス.
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the GNU General Public License Version 3 (GNU GPL v3)
|
||||
https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
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.
|
||||
|
||||

|
||||

|
||||
|
||||
(C) 2018-2020 K4YT3X
|
||||
This project includes or depends on these following projects:
|
||||
|
||||
## Credits
|
||||
| Project | License |
|
||||
| ------------------------------------------------------------------- | --------------- |
|
||||
| [FFmpeg](https://www.ffmpeg.org/) | LGPLv2.1, GPLv2 |
|
||||
| [waifu2x-ncnn-vulkan](https://github.com/nihui/waifu2x-ncnn-vulkan) | MIT License |
|
||||
| [srmd-ncnn-vulkan](https://github.com/nihui/srmd-ncnn-vulkan) | MIT License |
|
||||
| [realsr-ncnn-vulkan](https://github.com/nihui/realsr-ncnn-vulkan) | MIT License |
|
||||
| [rife-ncnn-vulkan](https://github.com/nihui/rife-ncnn-vulkan) | MIT License |
|
||||
| [ffmpeg-python](https://github.com/kkroening/ffmpeg-python) | Apache-2.0 |
|
||||
| [Loguru](https://github.com/Delgan/loguru) | MIT License |
|
||||
| [opencv-python](https://github.com/opencv/opencv-python) | MIT License |
|
||||
| [Pillow](https://github.com/python-pillow/Pillow) | HPND License |
|
||||
| [Rich](https://github.com/Textualize/rich) | MIT License |
|
||||
|
||||
This project relies on the following software and projects.
|
||||
Legacy versions of this project includes or depends on these following projects:
|
||||
|
||||
- [FFmpeg](https://www.ffmpeg.org/)
|
||||
- [waifu2x-caffe](https://github.com/lltcggie/waifu2x-caffe)
|
||||
- [waifu2x-converter-cpp](https://github.com/DeadSix27/waifu2x-converter-cpp)
|
||||
- [waifu2x-ncnn-vulkan](https://github.com/nihui/waifu2x-ncnn-vulkan)
|
||||
- [srmd-ncnn-vulkan](https://github.com/nihui/srmd-ncnn-vulkan)
|
||||
- [realsr-ncnn-vulkan](https://github.com/nihui/realsr-ncnn-vulkan)
|
||||
- [Anime4K](https://github.com/bloc97/Anime4K)
|
||||
- [Anime4KCPP](https://github.com/TianZerL/Anime4KCPP)
|
||||
- [Gifski](https://github.com/ImageOptim/gifski)
|
||||
| Project | License |
|
||||
| --------------------------------------------------------------------------- | -------------------- |
|
||||
| [waifu2x-caffe](https://github.com/lltcggie/waifu2x-caffe) | MIT License |
|
||||
| [waifu2x-converter-cpp](https://github.com/DeadSix27/waifu2x-converter-cpp) | MIT License |
|
||||
| [Anime4K](https://github.com/bloc97/Anime4K) | MIT License |
|
||||
| [Anime4KCPP](https://github.com/TianZerL/Anime4KCPP) | MIT License |
|
||||
| [Gifski](https://github.com/ImageOptim/gifski) | AGPLv3 |
|
||||
| [tqdm](https://github.com/tqdm/tqdm) | MPLv2.0, MIT License |
|
||||
|
||||
More licensing information can be found in the [NOTICES](NOTICES) file.
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Appreciations given to the following personnel who have contributed significantly to the project (specifically the technical perspective).
|
||||
Appreciations given to the following personnel who have contributed significantly to the project.
|
||||
|
||||
- [@BrianPetkovsek](https://github.com/BrianPetkovsek)
|
||||
- [@sat3ll](https://github.com/sat3ll)
|
||||
- [@ddouglas87](https://github.com/ddouglas87)
|
||||
- [@lhanjian](https://github.com/lhanjian)
|
||||
- [@ArchieMeng](https://github.com/archiemeng)
|
||||
|
||||
## Related Projects
|
||||
## Similar Projects
|
||||
|
||||
- [Dandere2x](https://github.com/CardinalPanda/dandere2x): A lossy video upscaler also built around `waifu2x`, but with video compression techniques to shorten the time needed to process a video.
|
||||
- [Waifu2x-Extension-GUI](https://github.com/AaronFeng753/Waifu2x-Extension-GUI): A similar project that focuses more and only on building a better graphical user interface. It is built using C++ and Qt5, and currently only supports the Windows platform.
|
||||
|
||||
20
_config.yml
20
_config.yml
@@ -1,20 +0,0 @@
|
||||
# site settings
|
||||
locale: "en-US"
|
||||
title: "Video2X"
|
||||
title_separator: "-"
|
||||
subtitle: "Machine learning video/GIF/image upscaling"
|
||||
name: "K4YT3X"
|
||||
description: "An amazing website."
|
||||
url: "https://video2x.org"
|
||||
repository: "k4yt3x/video2x"
|
||||
|
||||
# set rendering style to be GitHub flavor
|
||||
kramdown:
|
||||
input: GFM
|
||||
|
||||
# use Minimal Mistakes theme
|
||||
remote_theme: mmistakes/minimal-mistakes
|
||||
|
||||
# plugin required for the Minimal Mistakes theme
|
||||
plugins:
|
||||
- jekyll-include-cache
|
||||
10
examples/container-run-interpolate-rife.sh
Executable file
10
examples/container-run-interpolate-rife.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
sudo podman run \
|
||||
-it --rm --gpus all -v /dev/dri:/dev/dri \
|
||||
-v $PWD/data:/host \
|
||||
ghcr.io/k4yt3x/video2x:5.0.0-beta4-cuda \
|
||||
-i input.mp4 -o output.mp4 \
|
||||
interpolate
|
||||
11
examples/container-run-upscale-waifu2x.sh
Executable file
11
examples/container-run-upscale-waifu2x.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
sudo podman run \
|
||||
-it --rm --gpus all -v /dev/dri:/dev/dri \
|
||||
-v $PWD/data:/host \
|
||||
ghcr.io/k4yt3x/video2x:5.0.0-beta4-cuda \
|
||||
-i input.mp4 -o output.mp4 \
|
||||
-p5 upscale \
|
||||
-h 720 -a waifu2x -n3
|
||||
21
examples/run_interpolate_rife.py
Executable file
21
examples/run_interpolate_rife.py
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# built-in imports
|
||||
import pathlib
|
||||
|
||||
# import video2x
|
||||
from video2x import Video2X
|
||||
|
||||
|
||||
# create video2x object
|
||||
video2x = Video2X()
|
||||
|
||||
# run upscale
|
||||
video2x.interpolate(
|
||||
pathlib.Path("input.mp4"), # input video path
|
||||
pathlib.Path("output.mp4"), # another
|
||||
3, # processes: number of parallel processors
|
||||
10, # threshold: adjacent frames with > n% diff won't be processed (100 == process all)
|
||||
"rife", # algorithm: the algorithm to use to process the video
|
||||
)
|
||||
24
examples/run_upscale_waifu2x.py
Executable file
24
examples/run_upscale_waifu2x.py
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# built-in imports
|
||||
import pathlib
|
||||
|
||||
# import video2x
|
||||
from video2x import Video2X
|
||||
|
||||
|
||||
# create video2x object
|
||||
video2x = Video2X()
|
||||
|
||||
# run upscale
|
||||
video2x.upscale(
|
||||
pathlib.Path("input.mp4"), # input video path
|
||||
pathlib.Path("output.mp4"), # another
|
||||
None, # width: width of output, None == auto
|
||||
720, # height: height of output, None == auto
|
||||
3, # noise: noise level, algorithm-dependent
|
||||
5, # processes: number of parallel processors
|
||||
0, # threshold: adjacent frames with < n% diff won't be processed (0 == process all)
|
||||
"waifu2x", # algorithm: the algorithm to use to process the video
|
||||
)
|
||||
30
licenses/LICENSE-Pillow
Normal file
30
licenses/LICENSE-Pillow
Normal file
@@ -0,0 +1,30 @@
|
||||
The Python Imaging Library (PIL) is
|
||||
|
||||
Copyright © 1997-2011 by Secret Labs AB
|
||||
Copyright © 1995-2011 by Fredrik Lundh
|
||||
|
||||
Pillow is the friendly PIL fork. It is
|
||||
|
||||
Copyright © 2010-2022 by Alex Clark and contributors
|
||||
|
||||
Like PIL, Pillow is licensed under the open source HPND License:
|
||||
|
||||
By obtaining, using, and/or copying this software and/or its associated
|
||||
documentation, you agree that you have read, understood, and will comply
|
||||
with the following terms and conditions:
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
associated documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appears in all copies, and that
|
||||
both that copyright notice and this permission notice appear in supporting
|
||||
documentation, and that the name of Secret Labs AB or the author not be
|
||||
used in advertising or publicity pertaining to distribution of the software
|
||||
without specific, written prior permission.
|
||||
|
||||
SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL,
|
||||
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
21
licenses/LICENSE-opencv-python
Normal file
21
licenses/LICENSE-opencv-python
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Olli-Pekka Heinisuo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
21
licenses/LICENSE-realsr-ncnn-vulkan
Normal file
21
licenses/LICENSE-realsr-ncnn-vulkan
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 nihui
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1743
licenses/LICENSE-rich
Normal file
1743
licenses/LICENSE-rich
Normal file
File diff suppressed because one or more lines are too long
21
licenses/LICENSE-rife-ncnn-vulkan
Normal file
21
licenses/LICENSE-rife-ncnn-vulkan
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 nihui
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
21
licenses/LICENSE-srmd-ncnn-vulkan
Normal file
21
licenses/LICENSE-srmd-ncnn-vulkan
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 nihui
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
21
licenses/LICENSE-waifu2x-ncnn-vulkan
Normal file
21
licenses/LICENSE-waifu2x-ncnn-vulkan
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 nihui
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
661
licenses/agpl-3.0.txt
Normal file
661
licenses/agpl-3.0.txt
Normal file
@@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
201
licenses/apache-2.0.txt
Normal file
201
licenses/apache-2.0.txt
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2017 Karl Kroening
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
21
licenses/mit.txt
Normal file
21
licenses/mit.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
533
pdm.lock
generated
Normal file
533
pdm.lock
generated
Normal file
@@ -0,0 +1,533 @@
|
||||
[[package]]
|
||||
name = "cmake"
|
||||
version = "3.22.3"
|
||||
summary = "CMake is an open-source, cross-platform family of tools designed to build, test and package software"
|
||||
|
||||
[[package]]
|
||||
name = "cmake-build-extension"
|
||||
version = "0.5.0"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Setuptools extension to build and package CMake projects."
|
||||
dependencies = [
|
||||
"GitPython",
|
||||
"cmake",
|
||||
"ninja",
|
||||
"setuptools-scm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.4"
|
||||
requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
summary = "Cross-platform colored terminal text."
|
||||
|
||||
[[package]]
|
||||
name = "commonmark"
|
||||
version = "0.9.1"
|
||||
summary = "Python parser for the CommonMark Markdown spec"
|
||||
|
||||
[[package]]
|
||||
name = "evdev"
|
||||
version = "1.4.0"
|
||||
summary = "Bindings to the Linux input handling subsystem"
|
||||
|
||||
[[package]]
|
||||
name = "ffmpeg-python"
|
||||
version = "0.2.0"
|
||||
summary = "Python bindings for FFmpeg - with complex filtering support"
|
||||
dependencies = [
|
||||
"future",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "future"
|
||||
version = "0.18.2"
|
||||
requires_python = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
summary = "Clean single-source support for Python 3 and 2"
|
||||
|
||||
[[package]]
|
||||
name = "gitdb"
|
||||
version = "4.0.9"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Git Object Database"
|
||||
dependencies = [
|
||||
"smmap<6,>=3.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gitpython"
|
||||
version = "3.1.27"
|
||||
requires_python = ">=3.7"
|
||||
summary = "GitPython is a python library used to interact with Git repositories"
|
||||
dependencies = [
|
||||
"gitdb<5,>=4.0.1",
|
||||
"typing-extensions>=3.7.4.3; python_version < \"3.8\"",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "loguru"
|
||||
version = "0.6.0"
|
||||
requires_python = ">=3.5"
|
||||
summary = "Python logging made (stupidly) simple"
|
||||
dependencies = [
|
||||
"colorama>=0.3.4; sys_platform == \"win32\"",
|
||||
"win32-setctime>=1.0.0; sys_platform == \"win32\"",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ninja"
|
||||
version = "1.10.2.3"
|
||||
summary = "Ninja is a small build system with a focus on speed"
|
||||
|
||||
[[package]]
|
||||
name = "numpy"
|
||||
version = "1.22.3"
|
||||
requires_python = ">=3.8"
|
||||
summary = "NumPy is the fundamental package for array computing with Python."
|
||||
|
||||
[[package]]
|
||||
name = "opencv-python"
|
||||
version = "4.5.5.64"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Wrapper package for OpenCV python bindings."
|
||||
dependencies = [
|
||||
"numpy>=1.14.5; python_version >= \"3.7\"",
|
||||
"numpy>=1.17.3; python_version >= \"3.8\"",
|
||||
"numpy>=1.19.3; python_version >= \"3.6\" and platform_system == \"Linux\" and platform_machine == \"aarch64\"",
|
||||
"numpy>=1.19.3; python_version >= \"3.9\"",
|
||||
"numpy>=1.21.2; python_version >= \"3.10\"",
|
||||
"numpy>=1.21.2; python_version >= \"3.6\" and platform_system == \"Darwin\" and platform_machine == \"arm64\"",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "21.3"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Core utilities for Python packages"
|
||||
dependencies = [
|
||||
"pyparsing!=3.0.5,>=2.0.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pillow"
|
||||
version = "9.0.1"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Python Imaging Library (Fork)"
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.11.2"
|
||||
requires_python = ">=3.5"
|
||||
summary = "Pygments is a syntax highlighting package written in Python."
|
||||
|
||||
[[package]]
|
||||
name = "pynput"
|
||||
version = "1.7.6"
|
||||
summary = "Monitor and control user input devices"
|
||||
dependencies = [
|
||||
"evdev>=1.3; \"linux\" in sys_platform",
|
||||
"pyobjc-framework-ApplicationServices>=8.0; sys_platform == \"darwin\"",
|
||||
"pyobjc-framework-Quartz>=8.0; sys_platform == \"darwin\"",
|
||||
"python-xlib>=0.17; \"linux\" in sys_platform",
|
||||
"six",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyobjc-core"
|
||||
version = "8.4.1"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Python<->ObjC Interoperability Module"
|
||||
|
||||
[[package]]
|
||||
name = "pyobjc-framework-applicationservices"
|
||||
version = "8.4.1"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Wrappers for the framework ApplicationServices on macOS"
|
||||
dependencies = [
|
||||
"pyobjc-core>=8.4.1",
|
||||
"pyobjc-framework-Cocoa>=8.4.1",
|
||||
"pyobjc-framework-Quartz>=8.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyobjc-framework-cocoa"
|
||||
version = "8.4.1"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Wrappers for the Cocoa frameworks on macOS"
|
||||
dependencies = [
|
||||
"pyobjc-core>=8.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyobjc-framework-quartz"
|
||||
version = "8.4.1"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Wrappers for the Quartz frameworks on macOS"
|
||||
dependencies = [
|
||||
"pyobjc-core>=8.4.1",
|
||||
"pyobjc-framework-Cocoa>=8.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyparsing"
|
||||
version = "3.0.7"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Python parsing module"
|
||||
|
||||
[[package]]
|
||||
name = "python-xlib"
|
||||
version = "0.31"
|
||||
summary = "Python X Library"
|
||||
dependencies = [
|
||||
"six>=1.10.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "realcugan-ncnn-vulkan-python"
|
||||
version = "1.0.0"
|
||||
requires_python = ">=3.6"
|
||||
summary = "A Python FFI of nihui/realcugan-ncnn-vulkan achieved with SWIG"
|
||||
dependencies = [
|
||||
"pillow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "realsr-ncnn-vulkan-python"
|
||||
version = "1.0.4"
|
||||
requires_python = ">=3.6"
|
||||
summary = "A Python FFI of nihui/realsr-ncnn-vulkan achieved with SWIG"
|
||||
dependencies = [
|
||||
"pillow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rich"
|
||||
version = "12.0.0"
|
||||
requires_python = ">=3.6.2,<4.0.0"
|
||||
summary = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
|
||||
dependencies = [
|
||||
"commonmark<0.10.0,>=0.9.0",
|
||||
"pygments<3.0.0,>=2.6.0",
|
||||
"typing-extensions<5.0,>=3.7.4; python_version < \"3.8\"",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rife-ncnn-vulkan-python"
|
||||
version = "1.1.2.post3"
|
||||
requires_python = ">=3.6"
|
||||
summary = "A Python FFI of nihui/rife-ncnn-vulkan achieved with SWIG"
|
||||
dependencies = [
|
||||
"pillow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "setuptools"
|
||||
version = "60.10.0"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Easily download, build, install, upgrade, and uninstall Python packages"
|
||||
|
||||
[[package]]
|
||||
name = "setuptools-scm"
|
||||
version = "6.4.2"
|
||||
requires_python = ">=3.6"
|
||||
summary = "the blessed package to manage your versions by scm tags"
|
||||
dependencies = [
|
||||
"packaging>=20.0",
|
||||
"setuptools",
|
||||
"tomli>=1.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.16.0"
|
||||
requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
summary = "Python 2 and 3 compatibility utilities"
|
||||
|
||||
[[package]]
|
||||
name = "smmap"
|
||||
version = "5.0.0"
|
||||
requires_python = ">=3.6"
|
||||
summary = "A pure Python implementation of a sliding window memory map manager"
|
||||
|
||||
[[package]]
|
||||
name = "srmd-ncnn-vulkan-python"
|
||||
version = "1.0.2"
|
||||
requires_python = ">=3.6"
|
||||
summary = "A Python FFI of nihui/srmd-ncnn-vulkan achieved with SWIG"
|
||||
dependencies = [
|
||||
"pillow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.0.1"
|
||||
requires_python = ">=3.7"
|
||||
summary = "A lil' TOML parser"
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.1.1"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Backported and Experimental Type Hints for Python 3.6+"
|
||||
|
||||
[[package]]
|
||||
name = "waifu2x-ncnn-vulkan-python"
|
||||
version = "1.0.1"
|
||||
requires_python = ">=3.6"
|
||||
summary = "A Python FFI of nihui/waifu2x-ncnn-vulkan achieved with SWIG"
|
||||
dependencies = [
|
||||
"cmake",
|
||||
"cmake-build-extension",
|
||||
"pillow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "win32-setctime"
|
||||
version = "1.1.0"
|
||||
requires_python = ">=3.5"
|
||||
summary = "A small Python utility to set file creation time on Windows"
|
||||
|
||||
[metadata]
|
||||
lock_version = "3.1"
|
||||
content_hash = "sha256:f72fb9417f87c737f6a94710af1039611dc2d723d056e2479172fc6b695cab7c"
|
||||
|
||||
[metadata.files]
|
||||
"cmake 3.22.3" = [
|
||||
{file = "cmake-3.22.3-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl", hash = "sha256:d387e4062541094d302c80b3beed08cfa4f2ef98454d04f34fd1071c595152d8"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9ff1a89c264a6645d5d222f73efe83ea47abc96d77ae96e3e4eb4580f6f396fc"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3adc8532f5029931e82c9ae6a07b5d866b216b422cedc72074155c80db6e27d7"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c46f0573b0455a234c397fff2f3679e18925eb3da32069cc41f1aab7cd968260"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86c68b283223375ff942bce5b9f2b286fa5ac94b02f848e52fcec2369a407b22"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:452e53346d52241fbebdb9487e88786221c92d4abfa59fb002dc928ada69399c"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fb5fbcb8b45c9f9823a1bffffe8eab673e463b8d36b258856035725e04baf446"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:e615d29c2c26faf7e3876c47bafbab0eefe29683e01bec3a14736e9694bdff73"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:1d6096da730d2d0c8352926b647d0d340fc2ea3a6497dd13cff1c999d68d9d7b"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-musllinux_1_1_i686.whl", hash = "sha256:d3be0f5256bfe76c81d2db30216c937a7f7cefd251fb63c1cb30c5e0a896bbad"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-musllinux_1_1_ppc64le.whl", hash = "sha256:d73961a801ea9e2fdda9afa3b9fc84539e368ecec30de1ef54045abfabce4ece"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-musllinux_1_1_s390x.whl", hash = "sha256:45e89f6ff37283ecff912c7fe65dc4bc6dfe2fb78b7747b95272dd7423a3847f"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:c776ad422f7ce3866497f132af4ba7240cb81d554ee5eb801fd5e2d8c7cd67d6"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-win32.whl", hash = "sha256:8d32168fb3153313408befc7b8b5593130bad7d5fe0b8df764bb723b8c710bfc"},
|
||||
{file = "cmake-3.22.3-py2.py3-none-win_amd64.whl", hash = "sha256:d8db320fb36560fcf2ca66481009bc1d1f8ed45fd756ce91e4dee97026a0e3a4"},
|
||||
{file = "cmake-3.22.3.tar.gz", hash = "sha256:6e1d1991775915dac047af851f2feec7eb35ab4b4610d3e7fd94d93bce8faf58"},
|
||||
]
|
||||
"cmake-build-extension 0.5.0" = [
|
||||
{file = "cmake_build_extension-0.5.0-py3-none-any.whl", hash = "sha256:b11b8c140ef0a7595576c8a8f807dbae30924e78f92cdecd5be8060087a84e88"},
|
||||
{file = "cmake-build-extension-0.5.0.tar.gz", hash = "sha256:75a8e866544976e213aad31799f6a9b68a5135cf37cc41af29c1706446d56155"},
|
||||
]
|
||||
"colorama 0.4.4" = [
|
||||
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
|
||||
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
|
||||
]
|
||||
"commonmark 0.9.1" = [
|
||||
{file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"},
|
||||
{file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"},
|
||||
]
|
||||
"evdev 1.4.0" = [
|
||||
{file = "evdev-1.4.0.tar.gz", hash = "sha256:8782740eb1a86b187334c07feb5127d3faa0b236e113206dfe3ae8f77fb1aaf1"},
|
||||
]
|
||||
"ffmpeg-python 0.2.0" = [
|
||||
{file = "ffmpeg_python-0.2.0-py3-none-any.whl", hash = "sha256:ac441a0404e053f8b6a1113a77c0f452f1cfc62f6344a769475ffdc0f56c23c5"},
|
||||
{file = "ffmpeg-python-0.2.0.tar.gz", hash = "sha256:65225db34627c578ef0e11c8b1eb528bb35e024752f6f10b78c011f6f64c4127"},
|
||||
]
|
||||
"future 0.18.2" = [
|
||||
{file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"},
|
||||
]
|
||||
"gitdb 4.0.9" = [
|
||||
{file = "gitdb-4.0.9-py3-none-any.whl", hash = "sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd"},
|
||||
{file = "gitdb-4.0.9.tar.gz", hash = "sha256:bac2fd45c0a1c9cf619e63a90d62bdc63892ef92387424b855792a6cabe789aa"},
|
||||
]
|
||||
"gitpython 3.1.27" = [
|
||||
{file = "GitPython-3.1.27-py3-none-any.whl", hash = "sha256:5b68b000463593e05ff2b261acff0ff0972df8ab1b70d3cdbd41b546c8b8fc3d"},
|
||||
{file = "GitPython-3.1.27.tar.gz", hash = "sha256:1c885ce809e8ba2d88a29befeb385fcea06338d3640712b59ca623c220bb5704"},
|
||||
]
|
||||
"loguru 0.6.0" = [
|
||||
{file = "loguru-0.6.0-py3-none-any.whl", hash = "sha256:4e2414d534a2ab57573365b3e6d0234dfb1d84b68b7f3b948e6fb743860a77c3"},
|
||||
{file = "loguru-0.6.0.tar.gz", hash = "sha256:066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c"},
|
||||
]
|
||||
"ninja 1.10.2.3" = [
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl", hash = "sha256:d5e0275d28997a750a4f445c00bdd357b35cc334c13cdff13edf30e544704fbd"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5ea785bf6a15727040835256577239fa3cf5da0d60e618c307aa5efc31a1f0ce"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29570a18d697fc84d361e7e6330f0021f34603ae0fcb0ef67ae781e9814aae8d"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:21a1d84d4c7df5881bfd86c25cce4cf7af44ba2b8b255c57bc1c434ec30a2dfc"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9ca8dbece144366d5f575ffc657af03eb11c58251268405bc8519d11cf42f113"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:279836285975e3519392c93c26e75755e8a8a7fafec9f4ecbb0293119ee0f9c6"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:cc8b31b5509a2129e4d12a35fc21238c157038022560aaf22e49ef0a77039086"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-musllinux_1_1_i686.whl", hash = "sha256:688167841b088b6802e006f911d911ffa925e078c73e8ef2f88286107d3204f8"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-musllinux_1_1_ppc64le.whl", hash = "sha256:840a0b042d43a8552c4004966e18271ec726e5996578f28345d9ce78e225b67e"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-musllinux_1_1_s390x.whl", hash = "sha256:84be6f9ec49f635dc40d4b871319a49fa49b8d55f1d9eae7cd50d8e57ddf7a85"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:6bd76a025f26b9ae507cf8b2b01bb25bb0031df54ed685d85fc559c411c86cf4"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-win32.whl", hash = "sha256:740d61fefb4ca13573704ee8fe89b973d40b8dc2a51aaa4e9e68367233743bb6"},
|
||||
{file = "ninja-1.10.2.3-py2.py3-none-win_amd64.whl", hash = "sha256:0560eea57199e41e86ac2c1af0108b63ae77c3ca4d05a9425a750e908135935a"},
|
||||
{file = "ninja-1.10.2.3.tar.gz", hash = "sha256:e1b86ad50d4e681a7dbdff05fc23bb52cb773edb90bc428efba33fa027738408"},
|
||||
]
|
||||
"numpy 1.22.3" = [
|
||||
{file = "numpy-1.22.3-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:92bfa69cfbdf7dfc3040978ad09a48091143cffb778ec3b03fa170c494118d75"},
|
||||
{file = "numpy-1.22.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8251ed96f38b47b4295b1ae51631de7ffa8260b5b087808ef09a39a9d66c97ab"},
|
||||
{file = "numpy-1.22.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48a3aecd3b997bf452a2dedb11f4e79bc5bfd21a1d4cc760e703c31d57c84b3e"},
|
||||
{file = "numpy-1.22.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a3bae1a2ed00e90b3ba5f7bd0a7c7999b55d609e0c54ceb2b076a25e345fa9f4"},
|
||||
{file = "numpy-1.22.3-cp310-cp310-win32.whl", hash = "sha256:f950f8845b480cffe522913d35567e29dd381b0dc7e4ce6a4a9f9156417d2430"},
|
||||
{file = "numpy-1.22.3-cp310-cp310-win_amd64.whl", hash = "sha256:08d9b008d0156c70dc392bb3ab3abb6e7a711383c3247b410b39962263576cd4"},
|
||||
{file = "numpy-1.22.3-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:201b4d0552831f7250a08d3b38de0d989d6f6e4658b709a02a73c524ccc6ffce"},
|
||||
{file = "numpy-1.22.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f8c1f39caad2c896bc0018f699882b345b2a63708008be29b1f355ebf6f933fe"},
|
||||
{file = "numpy-1.22.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:568dfd16224abddafb1cbcce2ff14f522abe037268514dd7e42c6776a1c3f8e5"},
|
||||
{file = "numpy-1.22.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ca688e1b9b95d80250bca34b11a05e389b1420d00e87a0d12dc45f131f704a1"},
|
||||
{file = "numpy-1.22.3-cp38-cp38-win32.whl", hash = "sha256:e7927a589df200c5e23c57970bafbd0cd322459aa7b1ff73b7c2e84d6e3eae62"},
|
||||
{file = "numpy-1.22.3-cp38-cp38-win_amd64.whl", hash = "sha256:07a8c89a04997625236c5ecb7afe35a02af3896c8aa01890a849913a2309c676"},
|
||||
{file = "numpy-1.22.3-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:2c10a93606e0b4b95c9b04b77dc349b398fdfbda382d2a39ba5a822f669a0123"},
|
||||
{file = "numpy-1.22.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fade0d4f4d292b6f39951b6836d7a3c7ef5b2347f3c420cd9820a1d90d794802"},
|
||||
{file = "numpy-1.22.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bfb1bb598e8229c2d5d48db1860bcf4311337864ea3efdbe1171fb0c5da515d"},
|
||||
{file = "numpy-1.22.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97098b95aa4e418529099c26558eeb8486e66bd1e53a6b606d684d0c3616b168"},
|
||||
{file = "numpy-1.22.3-cp39-cp39-win32.whl", hash = "sha256:fdf3c08bce27132395d3c3ba1503cac12e17282358cb4bddc25cc46b0aca07aa"},
|
||||
{file = "numpy-1.22.3-cp39-cp39-win_amd64.whl", hash = "sha256:639b54cdf6aa4f82fe37ebf70401bbb74b8508fddcf4797f9fe59615b8c5813a"},
|
||||
{file = "numpy-1.22.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c34ea7e9d13a70bf2ab64a2532fe149a9aced424cd05a2c4ba662fd989e3e45f"},
|
||||
{file = "numpy-1.22.3.zip", hash = "sha256:dbc7601a3b7472d559dc7b933b18b4b66f9aa7452c120e87dfb33d02008c8a18"},
|
||||
]
|
||||
"opencv-python 4.5.5.64" = [
|
||||
{file = "opencv_python-4.5.5.64-cp36-abi3-macosx_10_15_x86_64.whl", hash = "sha256:a512a0c59b6fec0fac3844b2f47d6ecb1a9d18d235e6c5491ce8dbbe0663eae8"},
|
||||
{file = "opencv_python-4.5.5.64-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca6138b6903910e384067d001763d40f97656875487381aed32993b076f44375"},
|
||||
{file = "opencv_python-4.5.5.64-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b293ced62f4360d9f11cf72ae7e9df95320ff7bf5b834d87546f844e838c0c35"},
|
||||
{file = "opencv_python-4.5.5.64-cp36-abi3-win32.whl", hash = "sha256:6247e584813c00c3b9ed69a795da40d2c153dc923d0182e957e1c2f00a554ac2"},
|
||||
{file = "opencv_python-4.5.5.64-cp36-abi3-win_amd64.whl", hash = "sha256:408d5332550287aa797fd06bef47b2dfed163c6787668cc82ef9123a9484b56a"},
|
||||
{file = "opencv_python-4.5.5.64-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:7787bb017ae93d5f9bb1b817ac8e13e45dd193743cb648498fcab21d00cf20a3"},
|
||||
{file = "opencv-python-4.5.5.64.tar.gz", hash = "sha256:f65de0446a330c3b773cd04ba10345d8ce1b15dcac3f49770204e37602d0b3f7"},
|
||||
]
|
||||
"packaging 21.3" = [
|
||||
{file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"},
|
||||
{file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"},
|
||||
]
|
||||
"pillow 9.0.1" = [
|
||||
{file = "Pillow-9.0.1-1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a5d24e1d674dd9d72c66ad3ea9131322819ff86250b30dc5821cbafcfa0b96b4"},
|
||||
{file = "Pillow-9.0.1-1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2632d0f846b7c7600edf53c48f8f9f1e13e62f66a6dbc15191029d950bfed976"},
|
||||
{file = "Pillow-9.0.1-1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b9618823bd237c0d2575283f2939655f54d51b4527ec3972907a927acbcc5bfc"},
|
||||
{file = "Pillow-9.0.1-cp310-cp310-macosx_10_10_universal2.whl", hash = "sha256:9bfdb82cdfeccec50aad441afc332faf8606dfa5e8efd18a6692b5d6e79f00fd"},
|
||||
{file = "Pillow-9.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5100b45a4638e3c00e4d2320d3193bdabb2d75e79793af7c3eb139e4f569f16f"},
|
||||
{file = "Pillow-9.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:528a2a692c65dd5cafc130de286030af251d2ee0483a5bf50c9348aefe834e8a"},
|
||||
{file = "Pillow-9.0.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f29d831e2151e0b7b39981756d201f7108d3d215896212ffe2e992d06bfe049"},
|
||||
{file = "Pillow-9.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:855c583f268edde09474b081e3ddcd5cf3b20c12f26e0d434e1386cc5d318e7a"},
|
||||
{file = "Pillow-9.0.1-cp310-cp310-win32.whl", hash = "sha256:d9d7942b624b04b895cb95af03a23407f17646815495ce4547f0e60e0b06f58e"},
|
||||
{file = "Pillow-9.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:81c4b81611e3a3cb30e59b0cf05b888c675f97e3adb2c8672c3154047980726b"},
|
||||
{file = "Pillow-9.0.1-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:413ce0bbf9fc6278b2d63309dfeefe452835e1c78398efb431bab0672fe9274e"},
|
||||
{file = "Pillow-9.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:80fe64a6deb6fcfdf7b8386f2cf216d329be6f2781f7d90304351811fb591360"},
|
||||
{file = "Pillow-9.0.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cef9c85ccbe9bee00909758936ea841ef12035296c748aaceee535969e27d31b"},
|
||||
{file = "Pillow-9.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1d19397351f73a88904ad1aee421e800fe4bbcd1aeee6435fb62d0a05ccd1030"},
|
||||
{file = "Pillow-9.0.1-cp37-cp37m-win32.whl", hash = "sha256:d21237d0cd37acded35154e29aec853e945950321dd2ffd1a7d86fe686814669"},
|
||||
{file = "Pillow-9.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:ede5af4a2702444a832a800b8eb7f0a7a1c0eed55b644642e049c98d589e5092"},
|
||||
{file = "Pillow-9.0.1-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:b5b3f092fe345c03bca1e0b687dfbb39364b21ebb8ba90e3fa707374b7915204"},
|
||||
{file = "Pillow-9.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:335ace1a22325395c4ea88e00ba3dc89ca029bd66bd5a3c382d53e44f0ccd77e"},
|
||||
{file = "Pillow-9.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db6d9fac65bd08cea7f3540b899977c6dee9edad959fa4eaf305940d9cbd861c"},
|
||||
{file = "Pillow-9.0.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f154d173286a5d1863637a7dcd8c3437bb557520b01bddb0be0258dcb72696b5"},
|
||||
{file = "Pillow-9.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14d4b1341ac07ae07eb2cc682f459bec932a380c3b122f5540432d8977e64eae"},
|
||||
{file = "Pillow-9.0.1-cp38-cp38-win32.whl", hash = "sha256:effb7749713d5317478bb3acb3f81d9d7c7f86726d41c1facca068a04cf5bb4c"},
|
||||
{file = "Pillow-9.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:7f7609a718b177bf171ac93cea9fd2ddc0e03e84d8fa4e887bdfc39671d46b00"},
|
||||
{file = "Pillow-9.0.1-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:80ca33961ced9c63358056bd08403ff866512038883e74f3a4bf88ad3eb66838"},
|
||||
{file = "Pillow-9.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1c3c33ac69cf059bbb9d1a71eeaba76781b450bc307e2291f8a4764d779a6b28"},
|
||||
{file = "Pillow-9.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:12875d118f21cf35604176872447cdb57b07126750a33748bac15e77f90f1f9c"},
|
||||
{file = "Pillow-9.0.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:514ceac913076feefbeaf89771fd6febde78b0c4c1b23aaeab082c41c694e81b"},
|
||||
{file = "Pillow-9.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3c5c79ab7dfce6d88f1ba639b77e77a17ea33a01b07b99840d6ed08031cb2a7"},
|
||||
{file = "Pillow-9.0.1-cp39-cp39-win32.whl", hash = "sha256:718856856ba31f14f13ba885ff13874be7fefc53984d2832458f12c38205f7f7"},
|
||||
{file = "Pillow-9.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:f25ed6e28ddf50de7e7ea99d7a976d6a9c415f03adcaac9c41ff6ff41b6d86ac"},
|
||||
{file = "Pillow-9.0.1-pp37-pypy37_pp73-macosx_10_10_x86_64.whl", hash = "sha256:011233e0c42a4a7836498e98c1acf5e744c96a67dd5032a6f666cc1fb97eab97"},
|
||||
{file = "Pillow-9.0.1-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:253e8a302a96df6927310a9d44e6103055e8fb96a6822f8b7f514bb7ef77de56"},
|
||||
{file = "Pillow-9.0.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6295f6763749b89c994fcb6d8a7f7ce03c3992e695f89f00b741b4580b199b7e"},
|
||||
{file = "Pillow-9.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:a9f44cd7e162ac6191491d7249cceb02b8116b0f7e847ee33f739d7cb1ea1f70"},
|
||||
{file = "Pillow-9.0.1.tar.gz", hash = "sha256:6c8bc8238a7dfdaf7a75f5ec5a663f4173f8c367e5a39f87e720495e1eed75fa"},
|
||||
]
|
||||
"pygments 2.11.2" = [
|
||||
{file = "Pygments-2.11.2-py3-none-any.whl", hash = "sha256:44238f1b60a76d78fc8ca0528ee429702aae011c265fe6a8dd8b63049ae41c65"},
|
||||
{file = "Pygments-2.11.2.tar.gz", hash = "sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"},
|
||||
]
|
||||
"pynput 1.7.6" = [
|
||||
{file = "pynput-1.7.6-py2.py3-none-any.whl", hash = "sha256:19861b2a0c430d646489852f89500e0c9332e295f2c020e7c2775e7046aa2e2f"},
|
||||
{file = "pynput-1.7.6.tar.gz", hash = "sha256:3a5726546da54116b687785d38b1db56997ce1d28e53e8d22fc656d8b92e533c"},
|
||||
]
|
||||
"pyobjc-core 8.4.1" = [
|
||||
{file = "pyobjc_core-8.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:9a89cac910fbd64728fe7ec0c7a3a7cf20959bc1d7e2f41db4d7800556e47745"},
|
||||
{file = "pyobjc_core-8.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:2cf1d4348cb99fcba04fa38199a46e35263b2fe7bb66e6dfbd4f19bc2602998d"},
|
||||
{file = "pyobjc_core-8.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a130324b25c0f5f4cfe30b6a28b8e70865d6e1eee158caababb603906ef431d2"},
|
||||
{file = "pyobjc_core-8.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c31195d1a8f00da99abf79643f902d09c709dbbe9c9b6feb6b585303c57d720c"},
|
||||
{file = "pyobjc_core-8.4.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:e7fd2aefb53a96a8f688c8bb36c6ebd5446250a7251bfa6b688a045e05afc60b"},
|
||||
{file = "pyobjc_core-8.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b3191173ce268e23c84d84f036fc94c3a8749a6726fc7fe73baf27dbac14f7d0"},
|
||||
{file = "pyobjc-core-8.4.1.tar.gz", hash = "sha256:df98669e957adb33566d9ef46773a5ac876a81afe8849c282d6a80448e35dd74"},
|
||||
]
|
||||
"pyobjc-framework-applicationservices 8.4.1" = [
|
||||
{file = "pyobjc_framework_ApplicationServices-8.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:362d178c624a617fc60c3a35397550193d82da9a59272b215cf1dc6fb68c011c"},
|
||||
{file = "pyobjc_framework_ApplicationServices-8.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:41f0f6be6d343f91de92cab053be4a983e3936b364ca267a94c6e06bc34ff7fe"},
|
||||
{file = "pyobjc_framework_ApplicationServices-8.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:73287b758a70a037b6e74a60036f4adb1677407dfeaddee94102074d92539e6e"},
|
||||
{file = "pyobjc_framework_ApplicationServices-8.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:287b541b66c5c931a11dde90d7be69ddd2e5c3624c2e980e679f5242ec3ee0da"},
|
||||
{file = "pyobjc_framework_ApplicationServices-8.4.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:780fbe2e3b02237f79e2f5780094dd95b7308ecdb265c062b78a507b9564eb4d"},
|
||||
{file = "pyobjc_framework_ApplicationServices-8.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:092c4835e73e5dab1f3c498511b28b2e96503671fc7c1bc25f732c5e687b7214"},
|
||||
{file = "pyobjc-framework-ApplicationServices-8.4.1.tar.gz", hash = "sha256:b058466266412d2bf24b0303785c91538961367f26db616bf2f9f45c498a83a3"},
|
||||
]
|
||||
"pyobjc-framework-cocoa 8.4.1" = [
|
||||
{file = "pyobjc_framework_Cocoa-8.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cfbe038a0108ae1b45f8f7067af70af5811b8352d2dc3d86a7bcb4484ff5d56e"},
|
||||
{file = "pyobjc_framework_Cocoa-8.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:118225562064d991bafb41d0913899d6b3d723984d1888cb7181e4dba63b22c2"},
|
||||
{file = "pyobjc_framework_Cocoa-8.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d117a1eb24fd317e9f63792ac6a8703ed899de5d42e8a861c7bf885625668c31"},
|
||||
{file = "pyobjc_framework_Cocoa-8.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3af8577acbd6b980d3b9270ec99bc0164f66ef8397351a72fcdee527f23c1a34"},
|
||||
{file = "pyobjc_framework_Cocoa-8.4.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:91fdc964acb4dee4d37ae81fb603d48397739dbbfcc1eadbe0cdafaa8144b6e6"},
|
||||
{file = "pyobjc_framework_Cocoa-8.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:197dd28668e786b55d7d4139afd85c285f780564ebbccc166e84a24be31de34f"},
|
||||
{file = "pyobjc-framework-Cocoa-8.4.1.tar.gz", hash = "sha256:dc596bac0f5d424f67944e95b2d0d7c94a07c4166359d7b4a4d4ae4f8e112822"},
|
||||
]
|
||||
"pyobjc-framework-quartz 8.4.1" = [
|
||||
{file = "pyobjc_framework_Quartz-8.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a82d9eab3b2a6fca46602465f731815026d06e4fd0ba65b5b5211f1a0472b861"},
|
||||
{file = "pyobjc_framework_Quartz-8.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:1bd0a506385141b81330464b6e2537a7056cdca56deb98222b6926a04f72a3e6"},
|
||||
{file = "pyobjc_framework_Quartz-8.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:64cc616386b7a387dce53d3adb8c12a8461c2720861ab36aeeb53768cd0ba7e4"},
|
||||
{file = "pyobjc_framework_Quartz-8.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a2dff998c4d1286998390f58a3131b99bdc9dbf5c3d881562b33f168098bbe2e"},
|
||||
{file = "pyobjc_framework_Quartz-8.4.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:a98c58e1b265d5b413f5ecc6ec186b9e305fb6e37909d8b4b97fd681176f5f1c"},
|
||||
{file = "pyobjc_framework_Quartz-8.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:39f55426ef883cbe12a53969f90886f71e2a94513c98cf3730efdf404cdc5c83"},
|
||||
{file = "pyobjc-framework-Quartz-8.4.1.tar.gz", hash = "sha256:f8acebf0b526f0687e79ea6946e8f2528ced4ef02d0ed3fbf7116124b2749e52"},
|
||||
]
|
||||
"pyparsing 3.0.7" = [
|
||||
{file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"},
|
||||
{file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"},
|
||||
]
|
||||
"python-xlib 0.31" = [
|
||||
{file = "python_xlib-0.31-py2.py3-none-any.whl", hash = "sha256:1ec6ce0de73d9e6592ead666779a5732b384e5b8fb1f1886bd0a81cafa477759"},
|
||||
{file = "python-xlib-0.31.tar.gz", hash = "sha256:74d83a081f532bc07f6d7afcd6416ec38403d68f68b9b9dc9e1f28fbf2d799e9"},
|
||||
]
|
||||
"realcugan-ncnn-vulkan-python 1.0.0" = [
|
||||
{file = "realcugan-ncnn-vulkan-python-1.0.0.tar.gz", hash = "sha256:f72764ffe0a0c53b13cdbe1ae328ff9b0eb5582b9d5d15a0ca0c0ac254d17410"},
|
||||
]
|
||||
"realsr-ncnn-vulkan-python 1.0.4" = [
|
||||
{file = "realsr-ncnn-vulkan-python-1.0.4.tar.gz", hash = "sha256:bbfd9fc067cfea6ab28e8074f1d6aadcc7f927f166d90fab9dcc46380b7ef02d"},
|
||||
]
|
||||
"rich 12.0.0" = [
|
||||
{file = "rich-12.0.0-py3-none-any.whl", hash = "sha256:fdcd2f8d416e152bcf35c659987038d1ae5a7bd336e821ca7551858a4c7e38a9"},
|
||||
{file = "rich-12.0.0.tar.gz", hash = "sha256:14bfd0507edc633e021b02c45cbf7ca22e33b513817627b8de3412f047a3e798"},
|
||||
]
|
||||
"rife-ncnn-vulkan-python 1.1.2.post3" = [
|
||||
{file = "rife-ncnn-vulkan-python-1.1.2.post3.tar.gz", hash = "sha256:df66d1f83bc6beacac33b0e384ee352b45fa39931b9e1ff8247b396d4d7a486d"},
|
||||
]
|
||||
"setuptools 60.10.0" = [
|
||||
{file = "setuptools-60.10.0-py3-none-any.whl", hash = "sha256:782ef48d58982ddb49920c11a0c5c9c0b02e7d7d1c2ad0aa44e1a1e133051c96"},
|
||||
{file = "setuptools-60.10.0.tar.gz", hash = "sha256:6599055eeb23bfef457d5605d33a4d68804266e6cb430b0fb12417c5efeae36c"},
|
||||
]
|
||||
"setuptools-scm 6.4.2" = [
|
||||
{file = "setuptools_scm-6.4.2-py3-none-any.whl", hash = "sha256:acea13255093849de7ccb11af9e1fb8bde7067783450cee9ef7a93139bddf6d4"},
|
||||
{file = "setuptools_scm-6.4.2.tar.gz", hash = "sha256:6833ac65c6ed9711a4d5d2266f8024cfa07c533a0e55f4c12f6eff280a5a9e30"},
|
||||
]
|
||||
"six 1.16.0" = [
|
||||
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
|
||||
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
|
||||
]
|
||||
"smmap 5.0.0" = [
|
||||
{file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"},
|
||||
{file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"},
|
||||
]
|
||||
"srmd-ncnn-vulkan-python 1.0.2" = [
|
||||
{file = "srmd-ncnn-vulkan-python-1.0.2.tar.gz", hash = "sha256:3c7f71cbba2b6310c4b14c2b11dae7737582ac004893f8c9cc3f7c305c7bbe49"},
|
||||
]
|
||||
"tomli 2.0.1" = [
|
||||
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
|
||||
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
|
||||
]
|
||||
"typing-extensions 4.1.1" = [
|
||||
{file = "typing_extensions-4.1.1-py3-none-any.whl", hash = "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"},
|
||||
{file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"},
|
||||
]
|
||||
"waifu2x-ncnn-vulkan-python 1.0.1" = [
|
||||
{file = "waifu2x-ncnn-vulkan-python-1.0.1.tar.gz", hash = "sha256:18dbdd00141fc427a5ef8996f0a0197f1d6f3086a7c60bb88934e1d2a3004801"},
|
||||
]
|
||||
"win32-setctime 1.1.0" = [
|
||||
{file = "win32_setctime-1.1.0-py3-none-any.whl", hash = "sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad"},
|
||||
{file = "win32_setctime-1.1.0.tar.gz", hash = "sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2"},
|
||||
]
|
||||
56
pyproject.toml
Normal file
56
pyproject.toml
Normal file
@@ -0,0 +1,56 @@
|
||||
[project]
|
||||
name = "video2x"
|
||||
description = "A video/image upscaling and frame interpolation framework"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.7"
|
||||
license = { text = "AGPL-3.0-or-later" }
|
||||
keywords = [
|
||||
"super-resolution",
|
||||
"upscaling",
|
||||
"neural-network",
|
||||
"machine-learning",
|
||||
]
|
||||
authors = [{ name = "K4YT3X", email = "i@k4yt3x.com" }]
|
||||
classifiers = [
|
||||
"Environment :: Console",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Topic :: Multimedia :: Video",
|
||||
"Topic :: Scientific/Engineering :: Image Processing",
|
||||
]
|
||||
dependencies = [
|
||||
"ffmpeg-python>=0.2.0",
|
||||
"loguru>=0.6.0",
|
||||
"opencv-python>=4.5.5.64",
|
||||
"pillow>=9.0.1",
|
||||
"rich>=12.0.0",
|
||||
"waifu2x-ncnn-vulkan-python>=1.0.2rc3",
|
||||
"srmd-ncnn-vulkan-python>=1.0.2",
|
||||
"realsr-ncnn-vulkan-python>=1.0.4",
|
||||
"rife-ncnn-vulkan-python>=1.1.2.post3",
|
||||
"realcugan-ncnn-vulkan-python>=1.0.0",
|
||||
"pynput>=1.7.6",
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/k4yt3x/video2x/"
|
||||
documentation = "https://github.com/k4yt3x/video2x/wiki"
|
||||
repository = "https://github.com/k4yt3x/video2x.git"
|
||||
changelog = "https://github.com/k4yt3x/video2x/releases"
|
||||
|
||||
[project.scripts]
|
||||
video2x = "video2x:main"
|
||||
|
||||
[tool.pdm]
|
||||
version = { from = "video2x/__init__.py" }
|
||||
|
||||
[build-system]
|
||||
requires = ["pdm-pep517"]
|
||||
build-backend = "pdm.pep517.api"
|
||||
19
scripts/run-interactive-container.sh
Executable file
19
scripts/run-interactive-container.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# mount the current (video2x repo root) directory into a container
|
||||
# with drivers installed so the code can be debugged in the container
|
||||
# this one launches an interactive shell instead of Python
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
sudo podman run -it --rm \
|
||||
--gpus all -v /dev/dri:/dev/dri \
|
||||
-v $PWD:/host \
|
||||
-m 15g \
|
||||
--cpus 0.9 \
|
||||
-v $HOME/projects/media2x/video2x:/video2x \
|
||||
-e PYTHONPATH=/video2x \
|
||||
-e PYTHONDONTWRITEBYTECODE=1 \
|
||||
--entrypoint=/bin/bash \
|
||||
ghcr.io/k4yt3x/video2x:5.0.0-beta4-cuda
|
||||
|
||||
# alias upscale='python3 -m video2x -i /host/input-large.mp4 -o /host/output-large.mp4 -p3 upscale -h 1440 -d waifu2x -n3'
|
||||
19
scripts/run-source-in-container.sh
Executable file
19
scripts/run-source-in-container.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# mount the current (video2x repo root) directory into a container
|
||||
# with drivers installed so the code can be debugged in the container
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
sudo podman run -it --rm \
|
||||
--gpus all -v /dev/dri:/dev/dri \
|
||||
-v $PWD:/host \
|
||||
-m 15g \
|
||||
--cpus 0.9 \
|
||||
-v $HOME/projects/media2x/video2x:/video2x \
|
||||
-e PYTHONPATH=/video2x \
|
||||
-e PYTHONDONTWRITEBYTECODE=1 \
|
||||
ghcr.io/k4yt3x/video2x:5.0.0-beta4-cuda \
|
||||
-i data/input.mp4 -o data/output.mp4 \
|
||||
-p3 \
|
||||
upscale \
|
||||
-h 1440 -a waifu2x -n3
|
||||
@@ -1,21 +0,0 @@
|
||||
# Directory Listing
|
||||
|
||||
- [**images**](images): image assets such as executable icons
|
||||
- [**locale**](locale): language locale files (.po, .mo)
|
||||
- [**pyinstaller**](pyinstaller): PyInstaller-specific files
|
||||
- [**wrappers**](wrappers): binary Python wrappers/bindings
|
||||
- [**bilogger.py**](bilogger.py): bidirectional logger
|
||||
- [**build.ps1**](build.ps1): release building script
|
||||
- [**exceptions.py**](exceptions.py): custom exceptions
|
||||
- [**image_cleaner.py**](image_cleaner.py): upscaled images cleaner
|
||||
- [**progress_monitor.py**](progress_monitor.py): upscaling progress monitor
|
||||
- [**requirements.txt**](requirements.txt): Python requirements for pip
|
||||
- [**upscaler.py**](upscaler.py): main upscaler class
|
||||
- [**video2x.pot**](video2x.pot): project i18n POT translation file
|
||||
- [**video2x.py**](video2x.py): command line interface
|
||||
- [**video2x.yaml**](video2x.yaml): configuration file
|
||||
- [**video2x_gui.py**](video2x_gui.py): graphical user interface
|
||||
- [**video2x_gui.pyproject**](video2x_gui.pyproject): QtCreator project file
|
||||
- [**video2x_gui.ui**](video2x_gui.ui): GUI UI file (defines GUI layout)
|
||||
- [**video2x_setup.py**](video2x_setup.py): automatic setup script for Windows
|
||||
- [**video2x_setup_ubuntu.sh**](video2x_setup_ubuntu.sh): automatic setup script for Ubuntu
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Creator: Video2X Bidirectional Logger
|
||||
Author: K4YT3X
|
||||
Date Created: June 4, 2020
|
||||
Last Modified: July 17, 2020
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import _io
|
||||
import pathlib
|
||||
|
||||
|
||||
class BiLogger(object):
|
||||
""" A bidirectional logger that both prints the output
|
||||
and log all output to file.
|
||||
|
||||
Original code from: https://stackoverflow.com/a/14906787
|
||||
"""
|
||||
|
||||
def __init__(self, terminal: _io.TextIOWrapper, logfile: pathlib.Path):
|
||||
""" initialize BiLogger
|
||||
|
||||
Args:
|
||||
terminal (_io.TextIOWrapper): original terminal IO wrapper
|
||||
logfile (pathlib.Path): target log file path object
|
||||
"""
|
||||
self.terminal = terminal
|
||||
self.log = logfile.open(mode='a+', encoding='utf-8')
|
||||
|
||||
def write(self, message: str):
|
||||
""" write message to original terminal output and log file
|
||||
|
||||
Args:
|
||||
message (str): message to write
|
||||
"""
|
||||
self.terminal.write(message)
|
||||
self.terminal.flush()
|
||||
self.log.write(message)
|
||||
self.log.flush()
|
||||
|
||||
def flush(self):
|
||||
""" flush logger (for compability only)
|
||||
"""
|
||||
pass
|
||||
@@ -1,96 +0,0 @@
|
||||
<#
|
||||
Name: Video2X Build Script
|
||||
Creator: K4YT3X
|
||||
Date Created: May 6, 2020
|
||||
Last Modified: May 13, 2020
|
||||
|
||||
Description: A PowerShell script that will build Video2X
|
||||
executable (PE) releases automatically using PyInstaller.
|
||||
This script is currently only tuned for K4YT3X's environment.
|
||||
|
||||
To start a PowerShell session with execution policy bypass
|
||||
powershell -ExecutionPolicy Bypass
|
||||
#>
|
||||
|
||||
if ($args.count -ne 1){
|
||||
Write-Host -ForegroundColor White "Usage:`n .\build.ps1 VIDEO2X_VERSION"
|
||||
Exit
|
||||
}
|
||||
|
||||
# version number
|
||||
$SCRIPT_VERSION = "1.0.1"
|
||||
$VIDEO2X_VERSION = $args[0]
|
||||
|
||||
Write-Host -ForegroundColor White "Video2X Building Script Version $($SCRIPT_VERSION)
|
||||
Starting to build Video2X release packages
|
||||
Building Video2X release $($VIDEO2X_VERSION)"
|
||||
|
||||
# build Video2X CLI
|
||||
Write-Host -ForegroundColor White "`nBuilding Video2X CLI"
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="wrappers;wrappers" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x.py
|
||||
|
||||
# build Video2X GUI
|
||||
Write-Host -ForegroundColor White "`nBuilding Video2X GUI"
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--add-data="images;images" `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="video2x_gui.ui;." `
|
||||
--add-data="wrappers;wrappers" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x_gui.py
|
||||
|
||||
# build setup script
|
||||
Write-Host -ForegroundColor White "`nBuilding Video2X setup script"
|
||||
pyinstaller --noconfirm --log-level=WARN `
|
||||
--onefile `
|
||||
--additional-hooks-dir "pyinstaller\hooks" `
|
||||
--add-data="locale;locale" `
|
||||
--add-data="pyinstaller\7z1900-extra;7z" `
|
||||
--icon="images\video2x.ico" `
|
||||
video2x_setup.py
|
||||
|
||||
# remove old builds if found
|
||||
if (Test-Path "$($VIDEO2X_VERSION)" -PathType any) {
|
||||
Remove-Item -path "$($VIDEO2X_VERSION)" -recurse
|
||||
}
|
||||
|
||||
# create build directory
|
||||
New-Item "$($VIDEO2X_VERSION)" -ItemType Directory
|
||||
|
||||
# copy files into corresponding builds
|
||||
# full edition
|
||||
Write-Host -ForegroundColor White "`nCreating full package"
|
||||
New-Item "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-full" -ItemType Directory
|
||||
Copy-Item "dist\video2x.exe" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-full\"
|
||||
Copy-Item "dist\video2x_gui.exe" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-full\"
|
||||
Copy-Item -Path "$env:LOCALAPPDATA\video2x" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-full\dependencies" -Recurse
|
||||
|
||||
# overwrite paths to relative paths
|
||||
(Get-Content "video2x.yaml").replace("%LOCALAPPDATA%\video2x", "dependencies") | Set-Content "video2x.yaml.relative"
|
||||
Move-Item "video2x.yaml.relative" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-full\video2x.yaml"
|
||||
|
||||
# light edition
|
||||
Write-Host -ForegroundColor White "`nCreating light package"
|
||||
New-Item "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-light" -ItemType Directory
|
||||
Copy-Item "dist\video2x.exe" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-light\"
|
||||
Copy-Item "dist\video2x_gui.exe" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-light\"
|
||||
Copy-Item "dist\video2x_setup.exe" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-light\"
|
||||
Copy-Item "video2x.yaml" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-light\"
|
||||
Copy-Item "requirements.txt" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2X_VERSION)-win32-light\"
|
||||
|
||||
# clean up temporary files
|
||||
Write-Host -ForegroundColor White "`nDeleting temporary files"
|
||||
$pathsToRemove = "__pycache__", "build", "dist", "*.spec"
|
||||
|
||||
foreach ($path in $pathsToRemove){
|
||||
Write-Host "Removing path: $($path)"
|
||||
Remove-Item -path $path -recurse
|
||||
}
|
||||
|
||||
Write-Host -ForegroundColor White "`nBuild script finished"
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Video2X Exceptions
|
||||
Dev: K4YT3X
|
||||
Date Created: December 13, 2018
|
||||
Last Modified: July 27, 2019
|
||||
"""
|
||||
|
||||
|
||||
class ArgumentError(Exception):
|
||||
def __init__(self, message):
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
class StreamNotFoundError(Exception):
|
||||
def __init__(self, message):
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
class UnrecognizedDriverError(Exception):
|
||||
def __init__(self, message):
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
class UnsupportedPixelError(Exception):
|
||||
def __init__(self, message):
|
||||
super().__init__(message)
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Video2X Image Cleaner
|
||||
Author: BrianPetkovsek
|
||||
Date Created: March 24, 2019
|
||||
Last Modified: July 27, 2019
|
||||
|
||||
Editor: K4YT3X
|
||||
Last Modified: March 23, 2020
|
||||
|
||||
Editor: 28598519a
|
||||
Last Modified: March 23, 2020
|
||||
|
||||
Description: This class is to remove the extracted frames
|
||||
that have already been upscaled.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
class ImageCleaner(threading.Thread):
|
||||
""" Video2X Image Cleaner
|
||||
|
||||
This class creates an object that keeps track of extracted
|
||||
frames that has already been upscaled and are not needed
|
||||
anymore. It then deletes them to save disk space.
|
||||
|
||||
Extends:
|
||||
threading.Thread
|
||||
"""
|
||||
|
||||
def __init__(self, input_directory, output_directory, threads):
|
||||
threading.Thread.__init__(self)
|
||||
self.input_directory = input_directory
|
||||
self.output_directory = output_directory
|
||||
self.threads = threads
|
||||
self.running = False
|
||||
|
||||
def run(self):
|
||||
""" Run image cleaner
|
||||
"""
|
||||
self.running = True
|
||||
|
||||
while self.running:
|
||||
self.remove_upscaled_frames()
|
||||
time.sleep(1)
|
||||
|
||||
def stop(self):
|
||||
""" Stop the image cleaner
|
||||
"""
|
||||
self.running = False
|
||||
self.join()
|
||||
|
||||
def remove_upscaled_frames(self):
|
||||
""" remove frames that have already been upscaled
|
||||
|
||||
This method compares the files in the extracted frames
|
||||
directory with the upscaled frames directory, and removes
|
||||
the frames that has already been upscaled.
|
||||
"""
|
||||
|
||||
# list all images in the extracted frames
|
||||
output_frames = [f.name for f in self.output_directory.iterdir() if f.is_file()]
|
||||
|
||||
# compare and remove frames downscaled images that finished being upscaled
|
||||
# within each thread's extracted frames directory
|
||||
for thread_id in range(self.threads):
|
||||
dir_path = self.input_directory / str(thread_id)
|
||||
|
||||
# for each file within all the directories
|
||||
for file in dir_path.iterdir():
|
||||
# if file also exists in the output directory, then the file
|
||||
# has already been processed, thus not needed anymore
|
||||
if file.is_file() and file.name in output_frames:
|
||||
file.unlink()
|
||||
output_frames.remove(file.name)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 110 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB |
Binary file not shown.
Binary file not shown.
@@ -1,347 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: 2020-05-22 17:51-0400\n"
|
||||
"PO-Revision-Date: 2020-05-22 17:54-0400\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#: progress_monitor.py:42
|
||||
msgid "Upscaling Progress"
|
||||
msgstr "放大进度"
|
||||
|
||||
#: upscaler.py:110
|
||||
msgid "Specified or default cache directory is a file/link"
|
||||
msgstr "指定或默认的缓存目录是文件/链接"
|
||||
|
||||
#: upscaler.py:116
|
||||
msgid "Creating cache directory {}"
|
||||
msgstr "创建缓存目录 {}"
|
||||
|
||||
#: upscaler.py:119
|
||||
msgid "Unable to create {}"
|
||||
msgstr "无法创建 {}"
|
||||
|
||||
#: upscaler.py:124
|
||||
msgid "Extracted frames are being saved to: {}"
|
||||
msgstr "提取的帧将被保存到:{}"
|
||||
|
||||
#: upscaler.py:126
|
||||
msgid "Upscaled frames are being saved to: {}"
|
||||
msgstr "已放大的帧将被保存到:{}"
|
||||
|
||||
#: upscaler.py:136
|
||||
msgid "Cleaning up cache directory: {}"
|
||||
msgstr "清理缓存目录:{}"
|
||||
|
||||
#: upscaler.py:141
|
||||
msgid "Unable to delete: {}"
|
||||
msgstr "无法删除:{}"
|
||||
|
||||
#: upscaler.py:147 upscaler.py:162 upscaler.py:173
|
||||
msgid "Input and output path type mismatch"
|
||||
msgstr "输入和输出路径类型不匹配"
|
||||
|
||||
#: upscaler.py:148
|
||||
msgid "Input is multiple files but output is not directory"
|
||||
msgstr "输入是多个文件,但输出不是目录"
|
||||
|
||||
#: upscaler.py:152
|
||||
msgid "Input path {} is neither a file nor a directory"
|
||||
msgstr "输入路径 {} 既不是文件也不是目录"
|
||||
|
||||
#: upscaler.py:156 upscaler.py:178
|
||||
msgid "Input directory and output directory cannot be the same"
|
||||
msgstr "输入目录和输出目录不能相同"
|
||||
|
||||
#: upscaler.py:163
|
||||
msgid "Input is single file but output is directory"
|
||||
msgstr "所选的输入路径是单个文件,但输出路径是目录"
|
||||
|
||||
#: upscaler.py:166
|
||||
msgid "No suffix found in output file path"
|
||||
msgstr "在输出文件路径中未找到后缀"
|
||||
|
||||
#: upscaler.py:167
|
||||
msgid "Suffix must be specified"
|
||||
msgstr "必须指定文件后缀"
|
||||
|
||||
#: upscaler.py:174
|
||||
msgid "Input is directory but output is existing single file"
|
||||
msgstr "输入是目录,但输出是现有的单个文件"
|
||||
|
||||
#: upscaler.py:183
|
||||
msgid "Input path is neither a file nor a directory"
|
||||
msgstr "输入路径既不是文件也不是目录"
|
||||
|
||||
#: upscaler.py:192
|
||||
msgid "FFmpeg or FFprobe cannot be found under the specified path"
|
||||
msgstr "在指定的路径下找不到 FFmpeg 或 FFprobe"
|
||||
|
||||
#: upscaler.py:193 upscaler.py:203
|
||||
msgid "Please check the configuration file settings"
|
||||
msgstr "请检查配置文件设置"
|
||||
|
||||
#: upscaler.py:202
|
||||
msgid "Specified driver executable directory doesn't exist"
|
||||
msgstr "指定驱动的可执行文件不存在"
|
||||
|
||||
#: upscaler.py:229
|
||||
msgid "Failed to parse driver argument: {}"
|
||||
msgstr "解析驱动程序参数失败:{}"
|
||||
|
||||
#: upscaler.py:261
|
||||
msgid "Unrecognized driver: {}"
|
||||
msgstr "无法识别的驱动名称:{}"
|
||||
|
||||
#: upscaler.py:301
|
||||
msgid "Starting progress monitor"
|
||||
msgstr "启动进度监视器"
|
||||
|
||||
#: upscaler.py:306
|
||||
msgid "Starting upscaled image cleaner"
|
||||
msgstr "启动已放大图像清理程序"
|
||||
|
||||
#: upscaler.py:315 upscaler.py:332
|
||||
msgid "Killing progress monitor"
|
||||
msgstr "终结进度监视器"
|
||||
|
||||
#: upscaler.py:318 upscaler.py:335
|
||||
msgid "Killing upscaled image cleaner"
|
||||
msgstr "终结已放大图像清理程序"
|
||||
|
||||
#: upscaler.py:339
|
||||
msgid "Terminating all processes"
|
||||
msgstr "正在终止所有进程"
|
||||
|
||||
#: upscaler.py:346
|
||||
msgid "Main process waiting for subprocesses to exit"
|
||||
msgstr "主进程开始等待子进程结束"
|
||||
|
||||
#: upscaler.py:365 upscaler.py:369
|
||||
msgid "Subprocess {} exited with code {}"
|
||||
msgstr "子进程 {} 结束,返回码 {}"
|
||||
|
||||
#: upscaler.py:375
|
||||
msgid "Stop signal received"
|
||||
msgstr "收到停止信号"
|
||||
|
||||
#: upscaler.py:380
|
||||
msgid "Subprocess execution ran into an error"
|
||||
msgstr "子进程执行遇到错误"
|
||||
|
||||
#: upscaler.py:410
|
||||
msgid "Loading files into processing queue"
|
||||
msgstr "正在将文件添加到处理队列中"
|
||||
|
||||
#: upscaler.py:415
|
||||
msgid "Loading files from multiple paths"
|
||||
msgstr "正在从多个路径中导入文件"
|
||||
|
||||
#: upscaler.py:416 upscaler.py:435 upscaler.py:442
|
||||
msgid "Input path(s): {}"
|
||||
msgstr "输入路径:{}"
|
||||
|
||||
#: upscaler.py:434
|
||||
msgid "Loading single file"
|
||||
msgstr "正在导入单个文件"
|
||||
|
||||
#: upscaler.py:441
|
||||
msgid "Loading files from directory"
|
||||
msgstr "正在从文件夹中导入文件"
|
||||
|
||||
#: upscaler.py:455
|
||||
msgid "Loaded files into processing queue"
|
||||
msgstr "文件已添加到处理队列"
|
||||
|
||||
#: upscaler.py:458
|
||||
msgid "Input file: {}"
|
||||
msgstr "输入文件:{}"
|
||||
|
||||
#: upscaler.py:485
|
||||
msgid "Starting to upscale image"
|
||||
msgstr "开始放大图像"
|
||||
|
||||
#: upscaler.py:488 upscaler.py:550
|
||||
msgid "Upscaling completed"
|
||||
msgstr "放大完成"
|
||||
|
||||
#: upscaler.py:502
|
||||
msgid "Reading video information"
|
||||
msgstr "读取视频信息"
|
||||
|
||||
#: upscaler.py:516
|
||||
msgid "Aborting: No video stream found"
|
||||
msgstr "程序中止:文件中未找到视频流"
|
||||
|
||||
#: upscaler.py:521
|
||||
msgid "Framerate: {}"
|
||||
msgstr "帧率:{}"
|
||||
|
||||
#: upscaler.py:538
|
||||
msgid "Unsupported pixel format: {}"
|
||||
msgstr "不支持的像素格式:{}"
|
||||
|
||||
#: upscaler.py:548
|
||||
msgid "Starting to upscale extracted frames"
|
||||
msgstr "开始对提取的帧进行放大"
|
||||
|
||||
#: upscaler.py:555
|
||||
msgid "File {} ({}) neither an image nor a video"
|
||||
msgstr "文件 {} ({}) 既不是图片也不是视频"
|
||||
|
||||
#: upscaler.py:556
|
||||
msgid "Skipping this file"
|
||||
msgstr "将跳过此文件"
|
||||
|
||||
#: upscaler.py:566
|
||||
msgid "Converting extracted frames into GIF image"
|
||||
msgstr "正在将提取的帧转换为 GIF"
|
||||
|
||||
#: upscaler.py:570 upscaler.py:579
|
||||
msgid "Conversion completed"
|
||||
msgstr "转换已完成"
|
||||
|
||||
#: upscaler.py:575
|
||||
msgid "Converting extracted frames into video"
|
||||
msgstr "正在将提取的帧转换为视频"
|
||||
|
||||
#: upscaler.py:583
|
||||
msgid "Migrating audio, subtitles and other streams to upscaled video"
|
||||
msgstr "正在将音频、字幕和其他流迁移到放大后的视频"
|
||||
|
||||
#: upscaler.py:593
|
||||
msgid "Failed to migrate streams"
|
||||
msgstr "迁移流失败"
|
||||
|
||||
#: upscaler.py:594
|
||||
msgid "Trying to output video without additional streams"
|
||||
msgstr "正在尝试输出不含其他流的视频"
|
||||
|
||||
#: upscaler.py:610
|
||||
msgid "Output video file exists"
|
||||
msgstr "输出目标文件已存在"
|
||||
|
||||
#: upscaler.py:614
|
||||
msgid "Created temporary directory to contain file"
|
||||
msgstr "为文件创建了临时目录"
|
||||
|
||||
#: upscaler.py:617
|
||||
msgid "Writing intermediate file to: {}"
|
||||
msgstr "正在将中间视频文件写入至:{}"
|
||||
|
||||
#: video2x.py:85
|
||||
msgid ""
|
||||
"Video2X CLI Version: {}\n"
|
||||
"Upscaler Version: {}\n"
|
||||
"Author: K4YT3X\n"
|
||||
"License: GNU GPL v3\n"
|
||||
"Github Page: https://github.com/k4yt3x/video2x\n"
|
||||
"Contact: k4yt3x@k4yt3x.com"
|
||||
msgstr ""
|
||||
"Video2X 版本: {}\n"
|
||||
"放大组件版本:{}\n"
|
||||
"作者: K4YT3X\n"
|
||||
"开源许可: GNU GPL v3\n"
|
||||
"GitHub 主页:https://github.com/k4yt3x/video2x\n"
|
||||
"联系方式:k4yt3x@k4yt3x.com"
|
||||
|
||||
#: video2x.py:108
|
||||
msgid "Video2X Options"
|
||||
msgstr "Video2X 选项"
|
||||
|
||||
#: video2x.py:109
|
||||
msgid "show this help message and exit"
|
||||
msgstr "显示此帮助消息并退出"
|
||||
|
||||
#: video2x.py:110
|
||||
msgid "source video file/directory"
|
||||
msgstr "源视频文件/目录"
|
||||
|
||||
#: video2x.py:111
|
||||
msgid "output video file/directory"
|
||||
msgstr "输出视频文件/目录"
|
||||
|
||||
#: video2x.py:112
|
||||
msgid "video2x config file path"
|
||||
msgstr "video2x 配置文件路径"
|
||||
|
||||
#: video2x.py:114
|
||||
msgid "display version, lawful information and exit"
|
||||
msgstr "显示版本和法律信息并退出"
|
||||
|
||||
#: video2x.py:117
|
||||
msgid "Upscaling Options"
|
||||
msgstr "视频放大选项"
|
||||
|
||||
#: video2x.py:118
|
||||
msgid "upscaling driver"
|
||||
msgstr "视频放大驱动"
|
||||
|
||||
#: video2x.py:119
|
||||
msgid "scaling ratio"
|
||||
msgstr "缩放比"
|
||||
|
||||
#: video2x.py:120
|
||||
msgid "number of processes to use for upscaling"
|
||||
msgstr "并发进程数"
|
||||
|
||||
#: video2x.py:121
|
||||
msgid "preserve extracted and upscaled frames"
|
||||
msgstr "保留提取的和放大的帧"
|
||||
|
||||
#: video2x.py:161
|
||||
msgid "This file cannot be imported"
|
||||
msgstr "此文件无法被当作模块导入"
|
||||
|
||||
#: video2x.py:236
|
||||
msgid "Program completed, taking {} seconds"
|
||||
msgstr "程序执行完毕,总计花费 {} 秒"
|
||||
|
||||
#: video2x.py:239
|
||||
msgid "An exception has occurred"
|
||||
msgstr "发生了异常"
|
||||
|
||||
#~ msgid "Anime4KCPP doesn't yet support GIF processing"
|
||||
#~ msgstr "Anime4KCPP 尚不支持GIF处理"
|
||||
|
||||
#~ msgid "Starting to upscale video with Anime4KCPP"
|
||||
#~ msgstr "开始用 Anime4KCPP 放大视频"
|
||||
|
||||
#~ msgid "output video width"
|
||||
#~ msgstr "输出视频宽度"
|
||||
|
||||
#~ msgid "output video height"
|
||||
#~ msgstr "输出视频高度"
|
||||
|
||||
#~ msgid "You must specify input video file/directory path"
|
||||
#~ msgstr "您必须指定输入视频文件/目录路径"
|
||||
|
||||
#~ msgid "You must specify output video file/directory path"
|
||||
#~ msgstr "您必须指定输出视频文件/目录路径"
|
||||
|
||||
#~ msgid "Selected driver accepts only scaling ratio"
|
||||
#~ msgstr "所选驱动程序仅接受缩放比率"
|
||||
|
||||
#~ msgid "Scaling ratio must be 1 or 2 for waifu2x_ncnn_vulkan"
|
||||
#~ msgstr "waifu2x_ncnn_vulkan 的缩放比必须为 1 或 2"
|
||||
|
||||
#~ msgid "Scaling ratio must be one of 2, 3 or 4 for srmd_ncnn_vulkan"
|
||||
#~ msgstr "srmd_ncnn_vulkan 的缩放比必须为 2、3 或 4"
|
||||
|
||||
#~ msgid "You can only specify either scaling ratio or output width and height"
|
||||
#~ msgstr "您只能指定缩放比或输出宽度和高度两者之一"
|
||||
|
||||
#~ msgid "You must specify both width and height"
|
||||
#~ msgstr "您必须同时指定宽度和高度"
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Video2X Upscale Progress Monitor
|
||||
Author: K4YT3X
|
||||
Date Created: May 7, 2020
|
||||
Last Modified: June 7, 2020
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import contextlib
|
||||
import threading
|
||||
import time
|
||||
|
||||
# third-party imports
|
||||
from tqdm import tqdm
|
||||
|
||||
|
||||
class ProgressMonitor(threading.Thread):
|
||||
""" progress monitor
|
||||
|
||||
This class provides progress monitoring functionalities
|
||||
by keeping track of the amount of frames in the input
|
||||
directory and the output directory. This is originally
|
||||
suggested by @ArmandBernard.
|
||||
"""
|
||||
|
||||
def __init__(self, upscaler, extracted_frames_directories):
|
||||
threading.Thread.__init__(self)
|
||||
self.upscaler = upscaler
|
||||
self.extracted_frames_directories = extracted_frames_directories
|
||||
self.running = False
|
||||
|
||||
def run(self):
|
||||
self.running = True
|
||||
|
||||
# get number of extracted frames
|
||||
self.upscaler.total_frames = 0
|
||||
for directory in self.extracted_frames_directories:
|
||||
self.upscaler.total_frames += len([f for f in directory.iterdir() if str(f).lower().endswith(self.upscaler.extracted_frame_format.lower())])
|
||||
|
||||
with tqdm(total=self.upscaler.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
|
||||
# needs to be calculated.
|
||||
previous_cycle_frames = 0
|
||||
while self.running:
|
||||
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
upscaled_frames = [f for f in self.upscaler.upscaled_frames.iterdir() if str(f).lower().endswith(self.upscaler.extracted_frame_format.lower())]
|
||||
if len(upscaled_frames) >= 1:
|
||||
self.upscaler.last_frame_upscaled = sorted(upscaled_frames)[-1]
|
||||
self.upscaler.total_frames_upscaled = len(upscaled_frames)
|
||||
|
||||
# update progress bar
|
||||
delta = self.upscaler.total_frames_upscaled - previous_cycle_frames
|
||||
previous_cycle_frames = self.upscaler.total_frames_upscaled
|
||||
progress_bar.update(delta)
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
def stop(self):
|
||||
self.running = False
|
||||
self.join()
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,85 +0,0 @@
|
||||
.Language=English,English
|
||||
.PluginContents=7-Zip Plugin
|
||||
|
||||
@Contents
|
||||
$^#7-Zip Plugin 19.00#
|
||||
$^#Copyright (c) 1999-2019 Igor Pavlov#
|
||||
This FAR module performs transparent #archive# processing.
|
||||
Files in the archive are handled in the same manner as if they
|
||||
were in a folder.
|
||||
|
||||
~Extracting from the archive~@Extract@
|
||||
|
||||
~Add files to the archive~@Update@
|
||||
|
||||
~7-Zip Plugin configuration~@Config@
|
||||
|
||||
|
||||
Web site: #www.7-zip.org#
|
||||
|
||||
@Extract
|
||||
$ #Extracting from the archive#
|
||||
|
||||
In this dialog you may enter extracting mode.
|
||||
|
||||
Path mode
|
||||
|
||||
#Full pathnames# Extract files with full pathnames.
|
||||
|
||||
#Current pathnames# Extract files with all relative paths.
|
||||
|
||||
#No pathnames# Extract files without folder paths.
|
||||
|
||||
|
||||
Overwrite mode
|
||||
|
||||
#Ask before overwrite# Ask before overwriting existing files.
|
||||
|
||||
#Overwrite without prompt# Overwrite existing files without prompt.
|
||||
|
||||
#Skip existing files# Skip extracting of existing files.
|
||||
|
||||
|
||||
Files
|
||||
|
||||
#Selected files# Extract only selected files.
|
||||
|
||||
#All files# Extract all files from archive.
|
||||
|
||||
@Update
|
||||
$ #Add files to the archive#
|
||||
|
||||
This dialog allows you to specify options for process of updating archive.
|
||||
|
||||
|
||||
Compression method
|
||||
|
||||
#Store# Files will be copied to archive without compression.
|
||||
|
||||
#Normal# Files will be compressed.
|
||||
|
||||
#Maximum# Files will be compressed with method that gives
|
||||
maximum compression ratio.
|
||||
|
||||
|
||||
Update mode
|
||||
|
||||
#Add and replace files# Add all specified files to the archive.
|
||||
|
||||
#Update and add files# Update older files in the archive and add
|
||||
files that are new to the archive.
|
||||
|
||||
#Freshen existing files# Update specified files in the archive that
|
||||
are older than the selected disk files.
|
||||
|
||||
#Synchronize files# Replace specified files only if
|
||||
added files are newer. Always add those
|
||||
files, which are not present in the
|
||||
archive. Delete from archive those files,
|
||||
which are not present on the disk.
|
||||
|
||||
@Config
|
||||
$ #7-Zip Plugin configuration#
|
||||
In this dialog you may change following parameters:
|
||||
|
||||
#Plugin is used by default# Plugin is used by default.
|
||||
@@ -1,211 +0,0 @@
|
||||
.Language=English,English
|
||||
|
||||
"Ok"
|
||||
"&Cancel"
|
||||
|
||||
"Warning"
|
||||
"Error"
|
||||
|
||||
"Format"
|
||||
|
||||
"Properties"
|
||||
|
||||
"Yes"
|
||||
"No"
|
||||
|
||||
"Get password"
|
||||
"Enter password"
|
||||
|
||||
"Extract"
|
||||
"&Extract to"
|
||||
|
||||
"Path mode"
|
||||
"&Full pathnames"
|
||||
"C&urrent pathnames"
|
||||
"&No pathnames"
|
||||
|
||||
"Overwrite mode"
|
||||
"As&k before overwrite"
|
||||
"&Overwrite without prompt"
|
||||
"Sk&ip existing files"
|
||||
"A&uto rename"
|
||||
"A&uto rename existing files"
|
||||
|
||||
"Extract"
|
||||
"&Selected files"
|
||||
"A&ll files"
|
||||
|
||||
"&Password"
|
||||
|
||||
"Extr&act"
|
||||
"&Cancel"
|
||||
|
||||
"Can not open output file '%s'."
|
||||
|
||||
"Unsupported compression method for '%s'."
|
||||
"CRC failed in '%s'."
|
||||
"Data error in '%s'."
|
||||
"CRC failed in encrypted file '%s'. Wrong password?"
|
||||
"Data error in encrypted file '%s'. Wrong password?"
|
||||
|
||||
"Confirm File Replace"
|
||||
"Destination folder already contains processed file."
|
||||
"Would you like to replace the existing file"
|
||||
"with this one"
|
||||
|
||||
"bytes"
|
||||
"modified on"
|
||||
|
||||
|
||||
"&Yes"
|
||||
"Yes to &All"
|
||||
"&No"
|
||||
"No to A&ll"
|
||||
"A&uto rename"
|
||||
"&Cancel"
|
||||
|
||||
|
||||
"Update operations are not supported for this archive."
|
||||
|
||||
|
||||
"Delete from archive"
|
||||
"Delete \"%.40s\" from the archive"
|
||||
"Delete selected files from the archive"
|
||||
"Delete %d files from the archive"
|
||||
"Delete"
|
||||
"Cancel"
|
||||
|
||||
"Add files to archive"
|
||||
|
||||
"Add to %s a&rchive:"
|
||||
|
||||
"Compression method"
|
||||
"&Store"
|
||||
"Fas&test"
|
||||
"&Fast"
|
||||
"&Normal"
|
||||
"&Maximum"
|
||||
"&Ultra"
|
||||
|
||||
"Update mode"
|
||||
"A&dd and replace files"
|
||||
"&Update and add files"
|
||||
"&Freshen existing files"
|
||||
"S&ynchronize files"
|
||||
|
||||
"&Add"
|
||||
"Se&lect archiver"
|
||||
|
||||
"Select archive format"
|
||||
|
||||
"Wait"
|
||||
"Reading the archive"
|
||||
"Extracting from the archive"
|
||||
"Deleting from the archive"
|
||||
"Updating the archive"
|
||||
|
||||
"Move operation is not supported"
|
||||
|
||||
"7-Zip"
|
||||
"7-Zip (add to archive)"
|
||||
|
||||
"7-Zip"
|
||||
|
||||
"Plugin is used by default"
|
||||
|
||||
"0"
|
||||
"1"
|
||||
"2"
|
||||
"Path"
|
||||
"Name"
|
||||
"Extension"
|
||||
"Is Folder"
|
||||
"Size"
|
||||
"Packed Size"
|
||||
"Attributes"
|
||||
"Created"
|
||||
"Accessed"
|
||||
"Modified"
|
||||
"Solid"
|
||||
"Commented"
|
||||
"Encrypted"
|
||||
"Splited Before"
|
||||
"Splited After"
|
||||
"Dictionary Size"
|
||||
"CRC"
|
||||
"Type"
|
||||
"Anti"
|
||||
"Method"
|
||||
"Host OS"
|
||||
"File System"
|
||||
"User"
|
||||
"Group"
|
||||
"Block"
|
||||
"Comment"
|
||||
"Position"
|
||||
"Path Prefix"
|
||||
"Folders"
|
||||
"Files"
|
||||
"Version"
|
||||
"Volume"
|
||||
"Multivolume"
|
||||
"Offset"
|
||||
"Links"
|
||||
"Blocks"
|
||||
"Volumes"
|
||||
"Time Type"
|
||||
"64-bit"
|
||||
"Big-endian"
|
||||
"CPU"
|
||||
"Physical Size"
|
||||
"Headers Size"
|
||||
"Checksum"
|
||||
"Characteristics"
|
||||
"Virtual Address"
|
||||
"ID"
|
||||
"Short Name"
|
||||
"Creator Application"
|
||||
"Sector Size"
|
||||
"Mode"
|
||||
"Symbolic Link"
|
||||
"Error"
|
||||
"Total Size"
|
||||
"Free Space"
|
||||
"Cluster Size"
|
||||
"Label"
|
||||
"Local Name"
|
||||
"Provider"
|
||||
"NT Security"
|
||||
"Alternate Stream"
|
||||
"Aux"
|
||||
"Deleted"
|
||||
"Tree"
|
||||
"SHA-1"
|
||||
"SHA-256"
|
||||
"Error Type"
|
||||
"Errors"
|
||||
"Errors"
|
||||
"Warnings"
|
||||
"Warning"
|
||||
"Streams"
|
||||
"Alternate Streams"
|
||||
"Alternate Streams Size"
|
||||
"Virtual Size"
|
||||
"Unpack Size"
|
||||
"Total Physical Size"
|
||||
"Volume Index"
|
||||
"SubType"
|
||||
"Short Comment"
|
||||
"Code Page"
|
||||
"Is not archive type"
|
||||
"Physical Size can't be detected"
|
||||
"Zeros Tail Is Allowed"
|
||||
"Tail Size"
|
||||
"Embedded Stub Size"
|
||||
"Link"
|
||||
"Hard Link"
|
||||
"iNode"
|
||||
"Stream ID"
|
||||
"Read-only"
|
||||
"Out Name"
|
||||
"Copy Link"
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,84 +0,0 @@
|
||||
.Language=Russian,Russian (<28><><EFBFBD>᪨<EFBFBD>)
|
||||
.PluginContents=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7-Zip
|
||||
|
||||
@Contents
|
||||
$^#7-Zip Plugin 19.00#
|
||||
$^#Copyright (c) 1999-2019 Igor Pavlov#
|
||||
<20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FAR <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD><EFBFBD><EFBFBD> <20> #<23><>娢<EFBFBD><E5A8A2><EFBFBD>#. <20><><EFBFBD> <20><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD>
|
||||
䠩<EFBFBD><EFBFBD> <20> <20><>娢<EFBFBD><E5A8A2> <20><> <20>⫨<EFBFBD><E2ABA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 䠩<><E4A0A9><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
|
||||
~<7E><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><> <20><>娢<EFBFBD>~@Extract@
|
||||
|
||||
~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20> <20><>娢<EFBFBD>~@Update@
|
||||
|
||||
~<7E><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> <20><>娢<EFBFBD><E5A8A2><EFBFBD>~@Config@
|
||||
|
||||
|
||||
Web site: #www.7-zip.org#
|
||||
|
||||
@Extract
|
||||
$ #<23><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><> <20><>娢<EFBFBD>#
|
||||
<20> <20>⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
०<EFBFBD><EFBFBD> <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
<20><><EFBFBD><EFBFBD>
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD>묨 <20><><EFBFBD>ﬨ.
|
||||
|
||||
#<23>⭮<EFBFBD><E2ADAE>⥫<EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>⭮<EFBFBD><E2ADAE>⥫<EFBFBD><E2A5AB>묨 <20><><EFBFBD>ﬨ.
|
||||
|
||||
#<23><><EFBFBD> <20><>⥩# <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>⥩.
|
||||
|
||||
|
||||
<20><>१<EFBFBD><E0A5A7><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#<23><><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD> <20><>
|
||||
<20><>१<EFBFBD><E0A5A7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饣<EFBFBD> 䠩<><E4A0A9>.
|
||||
|
||||
#<23><><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騩 䠩<>
|
||||
<20><><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD>.
|
||||
|
||||
#<23>ய<EFBFBD>᪠<EFBFBD><E1AAA0># <20>ய<EFBFBD>᪠<EFBFBD><E1AAA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 䠩<><E4A0A9>.
|
||||
|
||||
|
||||
<20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#<23><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⮫쪮 <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><> <20><>娢<EFBFBD>.
|
||||
|
||||
#<23><><EFBFBD> 䠩<><E4A0A9># <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> 䠩<><E4A0A9> <20><> <20><>娢<EFBFBD>.
|
||||
|
||||
@Update
|
||||
$ #<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20> <20><>娢<EFBFBD>#
|
||||
|
||||
<20> <20>⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<><E0A5A6> 㯠<><E3AFA0><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
|
||||
<20><>⮤ ᦠ<><E1A6A0><EFBFBD>:
|
||||
|
||||
#<23><><EFBFBD> ᦠ<><E1A6A0><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <><E1AAAE><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD> ᦠ<><E1A6A0><EFBFBD>.
|
||||
|
||||
#<23><>ଠ<EFBFBD>쭮<EFBFBD> ᦠ⨥# <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᦠ<><E1A6A0>.
|
||||
|
||||
#<23><><EFBFBD>ᨬ<EFBFBD><E1A8AC>쭮<EFBFBD> ᦠ⨥# <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᦠ<><E1A6A0> <20> <20><><EFBFBD>ᨬ<EFBFBD><E1A8AC>쭮<EFBFBD>
|
||||
<20>⥯<EFBFBD><E2A5AF><EFBFBD><EFBFBD> ᦠ<><E1A6A0><EFBFBD>.
|
||||
|
||||
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9> <20> <20><>娢.
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ॢ訥 䠩<><E4A0A9> <20> <20><>娢<EFBFBD> <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><>娢<EFBFBD>.
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ॢ訥 䠩<><E4A0A9> <20> <20><>娢<EFBFBD>.
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><E0AEAD><EFBFBD><EFBFBD><E0AEA2><EFBFBD># <20><><EFBFBD><EFBFBD><EFBFBD><E0AEAD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD> <20><>娢<EFBFBD>
|
||||
<20> <20><><EFBFBD>࠭<EFBFBD>묨 䠩<><E4A0A9><EFBFBD><EFBFBD>.
|
||||
|
||||
|
||||
@Config
|
||||
$ #<23><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7-Zip#
|
||||
<20> <20>⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5><EFBFBD>騥 <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD>:
|
||||
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD># <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>
|
||||
@@ -1,211 +0,0 @@
|
||||
.Language=Russian,Russian (<28><><EFBFBD>᪨<EFBFBD>)
|
||||
|
||||
"<22>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22>।<EFBFBD><E0A5A4>०<EFBFBD><E0A5A6><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
|
||||
"<22><>ଠ<EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>⢠"
|
||||
|
||||
"<22><>"
|
||||
"<22><><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD> <20><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>"
|
||||
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><>&<26><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
"<22>&⭮<><E2ADAE>⥫<EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
"&<26><><EFBFBD> <20><>⥩"
|
||||
|
||||
"<22><>१<EFBFBD><E0A5A7><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26><><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD>"
|
||||
"<22>&<26><> <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD>"
|
||||
"<22>ய&<26>᪠<EFBFBD><E1AAA0>"
|
||||
"<22><>२<EFBFBD><E0A5A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⮬."
|
||||
"<22><>२<EFBFBD>. <20><>⮬. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
|
||||
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>&<26><>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9>"
|
||||
"<22><><EFBFBD> &䠩<><E4A0A9>"
|
||||
|
||||
"&<26><><EFBFBD>"
|
||||
|
||||
"<22>&<26>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"&<26>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> '%s'."
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⮤ ᦠ<><E1A6A0><EFBFBD> <20><><EFBFBD> 䠩<><E4A0A9> '%s'."
|
||||
"<22>訡<EFBFBD><E8A8A1> CRC <20> '%s'."
|
||||
"<22>訡<EFBFBD><E8A8A1> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> '%s'."
|
||||
"<22>訡<EFBFBD><E8A8A1> CRC <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> '%s'. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>?"
|
||||
"<22>訡<EFBFBD><E8A8A1> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> '%s'. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>?"
|
||||
|
||||
"<22><><EFBFBD>⢥न<E2A2A5><E0A4A8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD> 㦥 ᮤ<>ন<EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> 䠩<>."
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騩 䠩<>"
|
||||
"<><E1ABA5><EFBFBD>騬 䠩<><E4A0A9><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
|
||||
"&<26><>"
|
||||
"<22><> <20><><EFBFBD> &<26><><EFBFBD><EFBFBD>"
|
||||
"&<26><><EFBFBD>"
|
||||
"<22><><EFBFBD> <20><><EFBFBD> <20>&<26><><EFBFBD>"
|
||||
"<22><>२<EFBFBD><E0A5A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨"
|
||||
"&<26>⬥<EFBFBD><E2ACA5><EFBFBD><EFBFBD>"
|
||||
|
||||
|
||||
"<22><><EFBFBD> <20>⮣<EFBFBD> <20><>娢<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
|
||||
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \"%.40s\" <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> 䠩<><E4A0A9> <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d 䠩<><E4A0A9><EFBFBD> <20><> <20><>娢<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>⬥<EFBFBD><E2ACA5>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20> <20><>娢<EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> %s &<26><>娢<EFBFBD>"
|
||||
|
||||
"<22><>⮤ ᦠ<><E1A6A0><EFBFBD>"
|
||||
"<22><><EFBFBD> ᦠ<><E1A6A0><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭮<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ଠ<EFBFBD><E0ACA0><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>ᨬ<EFBFBD><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><E0AEAD><EFBFBD><EFBFBD><E0AEA2><EFBFBD>"
|
||||
|
||||
"&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>&<26>娢<EFBFBD><E5A8A2><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22>롮<EFBFBD> <20><>娢<EFBFBD><E5A8A2><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD><E0ACA0>"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>⥭<EFBFBD><E2A5AD> <20><>娢<EFBFBD>"
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
"<22><>६<EFBFBD>饭<EFBFBD><E9A5AD> 䠩<><E4A0A9><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
"7-Zip"
|
||||
"7-Zip (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>娢)"
|
||||
|
||||
"7-Zip configuration"
|
||||
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>"
|
||||
|
||||
"0"
|
||||
"1"
|
||||
"2"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ਡ<EFBFBD><E0A8A1><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢭<EFBFBD><EBA2AD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"CRC"
|
||||
"<22><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><>⮤"
|
||||
"<22><><EFBFBD>⥬<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD>"
|
||||
"<22><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD>"
|
||||
"<22><>㯯<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>⮬<EFBFBD><E2AEAC><EFBFBD>"
|
||||
"<22><><EFBFBD>饭<EFBFBD><E9A5AD>"
|
||||
"<22><>뫮<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"Time Type"
|
||||
"64-bit"
|
||||
"Big-endian"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>. <20>㬬<EFBFBD>"
|
||||
"<22><>ࠪ<EFBFBD><E0A0AA><EFBFBD><EFBFBD><EFBFBD>⨪<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD>㠫<EFBFBD><E3A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"ID"
|
||||
"<22><><EFBFBD><EFBFBD>⪮<EFBFBD> <20><><EFBFBD>"
|
||||
"<22>ணࠬ<E0AEA3><E0A0AC>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<><E1A5AA><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><>뫪<EFBFBD>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>⪠"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>쭮<EFBFBD> <20><><EFBFBD>"
|
||||
"<22><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"NT <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᭮<EFBFBD><E1ADAE><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>ୠ⨢<E0ADA0><E2A8A2><EFBFBD> <20><>⮪"
|
||||
"Aux"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ॢ<EFBFBD>"
|
||||
"SHA-1"
|
||||
"SHA-256"
|
||||
"<22><><EFBFBD> <20>訡<EFBFBD><E8A8A1>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
"<22>訡<EFBFBD><E8A8A1>"
|
||||
"<22>।<EFBFBD><E0A5A4>०<EFBFBD><E0A5A6><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22>।<EFBFBD><E0A5A4>०<EFBFBD><E0A5A6><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>⮪<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD>ୠ⨢<E0ADA0><E2A8A2><EFBFBD> <20><>⮪<EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ୠ⨢<E0ADA0><E2A8A2><EFBFBD> <20><>⮪<EFBFBD><E2AEAA>"
|
||||
"<22><><EFBFBD><EFBFBD>㠫<EFBFBD><E3A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>騩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD>⨯"
|
||||
"<22><><EFBFBD><EFBFBD>⪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>"
|
||||
"Is not archive type"
|
||||
"Physical Size can't be detected"
|
||||
"Zeros Tail Is Allowed"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⪠"
|
||||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0AEA5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
"<22><>뫪<EFBFBD>"
|
||||
"<22><><EFBFBD>⪠<EFBFBD> <20><>뫪<EFBFBD>"
|
||||
"iNode"
|
||||
"ID <20><>⮪<EFBFBD>"
|
||||
"<22><><EFBFBD>쪮 <20><><EFBFBD> <20>⥭<EFBFBD><E2A5AD>"
|
||||
"Out Name"
|
||||
"Copy Link"
|
||||
@@ -1,67 +0,0 @@
|
||||
; 7z supporting for MutiArc in Far
|
||||
; Append the following strings to file
|
||||
; ..\Program Files\Far\Plugins\MultiArc\Formats\Custom.ini
|
||||
|
||||
[7z]
|
||||
TypeName=7z
|
||||
ID=37 7A BC AF 27 1C
|
||||
IDPos=
|
||||
IDOnly=1
|
||||
Extension=7z
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
Delete=7z d {-p%%P} -r0 -ms=off -scsDOS -i@%%LQMN -- %%A
|
||||
Add=7z a {-p%%P} -r0 -t7z {%%S} -scsDOS -i@%%LQMN -- %%A
|
||||
AddRecurse=7z a {-p%%P} -r0 -t7z {%%S} -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
[rpm]
|
||||
TypeName=rpm
|
||||
ID=ED AB EE DB
|
||||
IDPos=
|
||||
IDOnly=1
|
||||
Extension=rpm
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
[cpio]
|
||||
TypeName=cpio
|
||||
ID=
|
||||
IDPos=
|
||||
IDOnly=0
|
||||
Extension=cpio
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
[deb]
|
||||
TypeName=deb
|
||||
ID=
|
||||
IDPos=
|
||||
IDOnly=0
|
||||
Extension=deb
|
||||
List=7z l -- %%AQ
|
||||
Start="^-----"
|
||||
End="^-----"
|
||||
Format0="yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
|
||||
Extract=7z x {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
ExtractWithoutPath=7z e {-p%%P} -r0 -y -scsDOS -i@%%LQMN -- %%A
|
||||
Test=7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A
|
||||
AllFilesMask="*"
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
REGEDIT4
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\ZIP]
|
||||
"Extract"="7z x {-p%%P} -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e {-p%%P} -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t {-p%%P} -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d {-p%%P} -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a {-p%%P} -r0 -tzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a {-p%%P} -r0 -tzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\TAR]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a -r0 -y -ttar {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a -r0 -y -ttar {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\GZIP]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a -r0 -tgzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a -r0 -tgzip {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\BZIP]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"Delete"="7z d -r0 {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Add"="7z a -r0 -tbzip2 {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AddRecurse"="7z a -r0 -tbzip2 {-w%%W} {%%S} -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\ARJ]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\CAB]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\LZH]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\RAR]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\Z(Unix)]
|
||||
"Extract"="7z x -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"ExtractWithoutPath"="7z e -r0 -y {-w%%W} -scsDOS -i@%%LQMN -- %%A"
|
||||
"Test"="7z t -r0 -scsDOS -i@%%LQMN -- %%A"
|
||||
"AllFilesMask"="*"
|
||||
@@ -1,67 +0,0 @@
|
||||
7-Zip Plugin for FAR Manager
|
||||
----------------------------
|
||||
|
||||
FAR Manager is a file manager working in text mode.
|
||||
You can download "FAR Manager" from site:
|
||||
http://www.farmanager.com
|
||||
|
||||
Files:
|
||||
|
||||
far7z.txt - This file
|
||||
far7z.reg - Regisrty file for MultiArc Plugin
|
||||
7zToFar.ini - Supporting 7z for MultiArc Plugin
|
||||
7-ZipFar.dll - 7-Zip Plugin for FAR Manager
|
||||
7-ZipEng.hlf - Help file in English for FAR Manager
|
||||
7-ZipRus.hlf - Help file in Russian for FAR Manager
|
||||
7-ZipEng.lng - Plugin message strings in English for FAR Manager
|
||||
7-ZipRus.lng - Plugin message strings in Russian for FAR Manager
|
||||
|
||||
There are two ways to use 7-Zip with FAR Manager:
|
||||
|
||||
1) Via 7-Zip FAR Plugin (it's recommended way).
|
||||
2) Via standard MultiArc Plugin.
|
||||
|
||||
|
||||
7-Zip FAR Plugin
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
7-Zip FAR Plugin is first level plugin for FAR Manager, like MultiArc plugin.
|
||||
It very fast extracts and updates files in archive, since it doesn't use
|
||||
external programs. It supports all formats supported by 7-Zip:
|
||||
7z, ZIP, RAR, CAB, ARJ, GZIP, BZIP2, Z, TAR, CPIO, RPM and DEB.
|
||||
|
||||
To install 7-Zip FAR Plugin:
|
||||
1) Create "7-Zip" folder in ...\Program Files\Far\Plugins folder.
|
||||
2) Copy all files from "FAR" folder of this package to created folder.
|
||||
3) Install 7-Zip, or copy 7z.dll from 7-Zip to Program Files\Far\Plugins\7-Zip\
|
||||
4) Restart FAR.
|
||||
|
||||
You can open archives with one of the following ways:
|
||||
* Pressing Enter.
|
||||
* Pressing Ctrl-PgDown.
|
||||
* Pressing F11 and selecting 7-Zip item.
|
||||
|
||||
|
||||
You can create new archives with 7-Zip by pressing F11 and
|
||||
selecting 7-Zip (add to archive) item.
|
||||
|
||||
If you think that some operations with archives is better to do with MultiArc Plugin,
|
||||
you can disable 7-Zip plugin via Options / Pligin configuration / 7-Zip. In such mode
|
||||
opening archives by pressing Enter and Ctrl-PgDown will start MultiArc Plugin. And
|
||||
if you want to open archive with 7-Zip, press F11 and select 7-Zip item.
|
||||
|
||||
|
||||
Using command line 7-Zip via MultiArc Plugin
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you want to use 7-Zip via MultiArc Plugin, you must
|
||||
register file far7z.reg.
|
||||
|
||||
If you want to use 7z archives via MultiArc Plugin, you must
|
||||
append contents of file Far\7zToFar.ini to file
|
||||
..\Program Files\Far\Plugins\MultiArc\Formats\Custom.ini.
|
||||
|
||||
|
||||
If you want to cancel using 7-Zip by MultiArc, just remove lines that contain
|
||||
7-Zip (7z) program name from HKEY_LOCAL_MACHINE\SOFTWARE\Far\Plugins\MultiArc\ZIP
|
||||
registry key.
|
||||
@@ -1,31 +0,0 @@
|
||||
7-Zip Extra
|
||||
~~~~~~~~~~~
|
||||
License for use and distribution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Copyright (C) 1999-2019 Igor Pavlov.
|
||||
|
||||
7-Zip Extra files are under the GNU LGPL license.
|
||||
|
||||
|
||||
Notes:
|
||||
You can use 7-Zip Extra on any computer, including a computer in a commercial
|
||||
organization. You don't need to register or pay for 7-Zip.
|
||||
|
||||
|
||||
GNU LGPL information
|
||||
--------------------
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You can receive a copy of the GNU Lesser General Public License from
|
||||
http://www.gnu.org/
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
7-Zip Extra history
|
||||
-------------------
|
||||
|
||||
This file contains only information about changes related to that package exclusively.
|
||||
The full history of changes is listed in history.txt in main 7-Zip program.
|
||||
|
||||
|
||||
19.00 2019-02-21
|
||||
-------------------------
|
||||
- Encryption strength for 7z archives was increased:
|
||||
the size of random initialization vector was increased from 64-bit to 128-bit,
|
||||
and the pseudo-random number generator was improved.
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
18.06 2018-12-30
|
||||
-------------------------
|
||||
- The speed for LZMA/LZMA2 compressing was increased by 3-10%,
|
||||
and there are minor changes in compression ratio.
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
18.05 2018-04-30
|
||||
-------------------------
|
||||
- The speed for LZMA/LZMA2 compressing was increased
|
||||
by 8% for fastest/fast compression levels and
|
||||
by 3% for normal/maximum compression levels.
|
||||
|
||||
|
||||
18.03 beta 2018-03-04
|
||||
-------------------------
|
||||
- The speed for single-thread LZMA/LZMA2 decoding
|
||||
was increased by 30% in x64 version and by 3% in x86 version.
|
||||
- 7-Zip now can use multi-threading for 7z/LZMA2 decoding,
|
||||
if there are multiple independent data chunks in LZMA2 stream.
|
||||
|
||||
|
||||
9.35 beta 2014-12-07
|
||||
------------------------------
|
||||
- SFX modules were moved to LZMA SDK package.
|
||||
|
||||
|
||||
9.34 alpha 2014-06-22
|
||||
------------------------------
|
||||
- Minimum supported system now is Windows 2000 for EXE and DLL files.
|
||||
- all EXE and DLL files use msvcrt.dll.
|
||||
- 7zr.exe now support AES encryption.
|
||||
|
||||
|
||||
9.18 2010-11-02
|
||||
------------------------------
|
||||
- New small SFX module for installers.
|
||||
|
||||
|
||||
9.17 2010-10-04
|
||||
------------------------------
|
||||
- New 7-Zip plugin for FAR Manager x64.
|
||||
|
||||
|
||||
9.10 2009-12-30
|
||||
------------------------------
|
||||
- 7-Zip for installers now supports LZMA2.
|
||||
|
||||
|
||||
9.09 2009-12-12
|
||||
------------------------------
|
||||
- LZMA2 compression method support.
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
4.65 2009-02-03
|
||||
------------------------------
|
||||
- Some bugs were fixed.
|
||||
|
||||
|
||||
4.38 beta 2006-04-13
|
||||
------------------------------
|
||||
- SFX for installers now supports new properties in config file:
|
||||
Progress, Directory, ExecuteFile, ExecuteParameters.
|
||||
|
||||
|
||||
4.34 beta 2006-02-27
|
||||
------------------------------
|
||||
- ISetProperties::SetProperties:
|
||||
it's possible to specify desirable number of CPU threads:
|
||||
PROPVARIANT: name=L"mt", vt = VT_UI4, ulVal = NumberOfThreads
|
||||
If "mt" is not defined, 7za.dll will check number of processors in system to set
|
||||
number of desirable threads.
|
||||
Now 7za.dll can use:
|
||||
2 threads for LZMA compressing
|
||||
N threads for BZip2 compressing
|
||||
4 threads for BZip2 decompressing
|
||||
Other codecs use only one thread.
|
||||
Note: 7za.dll can use additional "small" threads with low CPU load.
|
||||
- It's possible to call ISetProperties::SetProperties to specify "mt" property for decoder.
|
||||
|
||||
|
||||
4.33 beta 2006-02-05
|
||||
------------------------------
|
||||
- Compressing speed and Memory requirements were increased.
|
||||
Default dictionary size was increased: Fastest: 64 KB, Fast: 1 MB,
|
||||
Normal: 4 MB, Max: 16 MB, Ultra: 64 MB.
|
||||
- 7z/LZMA now can use only these match finders: HC4, BT2, BT3, BT4
|
||||
|
||||
|
||||
4.27 2005-09-21
|
||||
------------------------------
|
||||
- Some GUIDs/interfaces were changed.
|
||||
IStream.h:
|
||||
ISequentialInStream::Read now works as old ReadPart
|
||||
ISequentialOutStream::Write now works as old WritePart
|
||||
@@ -1,124 +0,0 @@
|
||||
7-Zip Extra 19.00
|
||||
-----------------
|
||||
|
||||
7-Zip Extra is package of extra modules of 7-Zip.
|
||||
|
||||
7-Zip Copyright (C) 1999-2019 Igor Pavlov.
|
||||
|
||||
7-Zip is free software. Read License.txt for more information about license.
|
||||
|
||||
Source code of binaries can be found at:
|
||||
http://www.7-zip.org/
|
||||
|
||||
This package contains the following files:
|
||||
|
||||
7za.exe - standalone console version of 7-Zip with reduced formats support.
|
||||
7za.dll - library for working with 7z archives
|
||||
7zxa.dll - library for extracting from 7z archives
|
||||
License.txt - license information
|
||||
readme.txt - this file
|
||||
|
||||
Far\ - plugin for Far Manager
|
||||
x64\ - binaries for x64
|
||||
|
||||
|
||||
All 32-bit binaries can work in:
|
||||
Windows 2000 / 2003 / 2008 / XP / Vista / 7 / 8 / 10
|
||||
and in any Windows x64 version with WoW64 support.
|
||||
All x64 binaries can work in any Windows x64 version.
|
||||
|
||||
All binaries use msvcrt.dll.
|
||||
|
||||
7za.exe
|
||||
-------
|
||||
|
||||
7za.exe - is a standalone console version of 7-Zip with reduced formats support.
|
||||
|
||||
Extra: 7za.exe : support for only some formats of 7-Zip.
|
||||
7-Zip: 7z.exe with 7z.dll : support for all formats of 7-Zip.
|
||||
|
||||
7za.exe and 7z.exe from 7-Zip have same command line interface.
|
||||
7za.exe doesn't use external DLL files.
|
||||
|
||||
You can read Help File (7-zip.chm) from 7-Zip package for description
|
||||
of all commands and switches for 7za.exe and 7z.exe.
|
||||
|
||||
7za.exe features:
|
||||
|
||||
- High compression ratio in 7z format
|
||||
- Supported formats:
|
||||
- Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR
|
||||
- Unpacking only: Z, lzma, CAB.
|
||||
- Highest compression ratio for ZIP and GZIP formats.
|
||||
- Fast compression and decompression
|
||||
- Strong AES-256 encryption in 7z and ZIP formats.
|
||||
|
||||
Note: LZMA SDK contains 7zr.exe - more reduced version of 7za.exe.
|
||||
But you can use 7zr.exe as "public domain" code.
|
||||
|
||||
|
||||
|
||||
DLL files
|
||||
---------
|
||||
|
||||
7za.dll and 7zxa.dll are reduced versions of 7z.dll from 7-Zip.
|
||||
7za.dll and 7zxa.dll support only 7z format.
|
||||
Note: 7z.dll is main DLL file that works with all archive types in 7-Zip.
|
||||
|
||||
7za.dll and 7zxa.dll support the following decoding methods:
|
||||
- LZMA, LZMA2, PPMD, BCJ, BCJ2, COPY, 7zAES, BZip2, Deflate.
|
||||
|
||||
7za.dll also supports 7z encoding with the following encoding methods:
|
||||
- LZMA, LZMA2, PPMD, BCJ, BCJ2, COPY, 7zAES.
|
||||
|
||||
7za.dll and 7zxa.dll work via COM interfaces.
|
||||
But these DLLs don't use standard COM interfaces for objects creating.
|
||||
|
||||
Look also example code that calls DLL functions (in source code of 7-Zip):
|
||||
|
||||
7zip\UI\Client7z
|
||||
|
||||
Another example of binary that uses these interface is 7-Zip itself.
|
||||
The following binaries from 7-Zip use 7z.dll:
|
||||
- 7z.exe (console version)
|
||||
- 7zG.exe (GUI version)
|
||||
- 7zFM.exe (7-Zip File Manager)
|
||||
|
||||
Note: The source code of LZMA SDK also contains the code for similar DLLs
|
||||
(DLLs without BZip2, Deflate support). And these files from LZMA SDK can be
|
||||
used as "public domain" code. If you use LZMA SDK files, you don't need to
|
||||
follow GNU LGPL rules, if you want to change the code.
|
||||
|
||||
|
||||
|
||||
|
||||
License FAQ
|
||||
-----------
|
||||
|
||||
Can I use the EXE or DLL files from 7-Zip in a commercial application?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Yes, but you are required to specify in documentation for your application:
|
||||
(1) that you used parts of the 7-Zip program,
|
||||
(2) that 7-Zip is licensed under the GNU LGPL license and
|
||||
(3) you must give a link to www.7-zip.org, where the source code can be found.
|
||||
|
||||
|
||||
Can I use the source code of 7-Zip in a commercial application?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Since 7-Zip is licensed under the GNU LGPL you must follow the rules of that license.
|
||||
In brief, it means that any LGPL'ed code must remain licensed under the LGPL.
|
||||
For instance, you can change the code from 7-Zip or write a wrapper for some
|
||||
code from 7-Zip and compile it into a DLL; but, the source code of that DLL
|
||||
(including your modifications / additions / wrapper) must be licensed under
|
||||
the LGPL or GPL.
|
||||
Any other code in your application can be licensed as you wish. This scheme allows
|
||||
users and developers to change LGPL'ed code and recompile that DLL. That is the
|
||||
idea of free software. Read more here: http://www.gnu.org/.
|
||||
|
||||
|
||||
|
||||
Note: You can look also LZMA SDK, which is available under a more liberal license.
|
||||
|
||||
|
||||
---
|
||||
End of document
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,80 +0,0 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# Copyright (c) 2013-2017, PyInstaller Development Team.
|
||||
#
|
||||
# Distributed under the terms of the GNU General Public License with exception
|
||||
# for distributing bootloader.
|
||||
#
|
||||
# The full license is in the file COPYING.txt, distributed with this software.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
"""
|
||||
Name: PyInstaller patoolib Hook
|
||||
Original solution: https://github.com/pyinstaller/pyinstaller/issues/3013
|
||||
|
||||
PyInstaller cannot find libraries imported by patoolib,
|
||||
since it uses importlib to import these modules.
|
||||
"""
|
||||
|
||||
hiddenimports = [
|
||||
"patoolib.programs",
|
||||
"patoolib.programs.ar",
|
||||
"patoolib.programs.arc",
|
||||
"patoolib.programs.archmage",
|
||||
"patoolib.programs.bsdcpio",
|
||||
"patoolib.programs.bsdtar",
|
||||
"patoolib.programs.bzip2",
|
||||
"patoolib.programs.cabextract",
|
||||
"patoolib.programs.chmlib",
|
||||
"patoolib.programs.clzip",
|
||||
"patoolib.programs.compress",
|
||||
"patoolib.programs.cpio",
|
||||
"patoolib.programs.dpkg",
|
||||
"patoolib.programs.flac",
|
||||
"patoolib.programs.genisoimage",
|
||||
"patoolib.programs.gzip",
|
||||
"patoolib.programs.isoinfo",
|
||||
"patoolib.programs.lbzip2",
|
||||
"patoolib.programs.lcab",
|
||||
"patoolib.programs.lha",
|
||||
"patoolib.programs.lhasa",
|
||||
"patoolib.programs.lrzip",
|
||||
"patoolib.programs.lzip",
|
||||
"patoolib.programs.lzma",
|
||||
"patoolib.programs.lzop",
|
||||
"patoolib.programs.mac",
|
||||
"patoolib.programs.nomarch",
|
||||
"patoolib.programs.p7azip",
|
||||
"patoolib.programs.p7rzip",
|
||||
"patoolib.programs.p7zip",
|
||||
"patoolib.programs.pbzip2",
|
||||
"patoolib.programs.pdlzip",
|
||||
"patoolib.programs.pigz",
|
||||
"patoolib.programs.plzip",
|
||||
"patoolib.programs.py_bz2",
|
||||
"patoolib.programs.py_echo",
|
||||
"patoolib.programs.py_gzip",
|
||||
"patoolib.programs.py_lzma",
|
||||
"patoolib.programs.py_tarfile",
|
||||
"patoolib.programs.py_zipfile",
|
||||
"patoolib.programs.rar",
|
||||
"patoolib.programs.rpm",
|
||||
"patoolib.programs.rpm2cpio",
|
||||
"patoolib.programs.rzip",
|
||||
"patoolib.programs.shar",
|
||||
"patoolib.programs.shorten",
|
||||
"patoolib.programs.star",
|
||||
"patoolib.programs.tar",
|
||||
"patoolib.programs.unace",
|
||||
"patoolib.programs.unadf",
|
||||
"patoolib.programs.unalz",
|
||||
"patoolib.programs.uncompress",
|
||||
"patoolib.programs.unrar",
|
||||
"patoolib.programs.unshar",
|
||||
"patoolib.programs.unzip",
|
||||
"patoolib.programs.xdms",
|
||||
"patoolib.programs.xz",
|
||||
"patoolib.programs.zip",
|
||||
"patoolib.programs.zoo",
|
||||
"patoolib.programs.zopfli",
|
||||
"patoolib.programs.zpaq",
|
||||
]
|
||||
@@ -1,9 +0,0 @@
|
||||
avalon_framework
|
||||
colorama
|
||||
patool
|
||||
pyqt5
|
||||
python-magic; platform_system != "Windows"
|
||||
python-magic-bin; platform_system == "Windows"
|
||||
pyyaml
|
||||
requests
|
||||
tqdm
|
||||
672
src/upscaler.py
672
src/upscaler.py
@@ -1,672 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Video2X Upscaler
|
||||
Author: K4YT3X
|
||||
Date Created: December 10, 2018
|
||||
Last Modified: June 29, 2020
|
||||
|
||||
Description: This file contains the Upscaler class. Each
|
||||
instance of the Upscaler class is an upscaler on an image or
|
||||
a folder.
|
||||
"""
|
||||
|
||||
# local imports
|
||||
from exceptions import *
|
||||
from image_cleaner import ImageCleaner
|
||||
from progress_monitor import ProgressMonitor
|
||||
from wrappers.ffmpeg import Ffmpeg
|
||||
from wrappers.gifski import Gifski
|
||||
|
||||
# built-in imports
|
||||
from fractions import Fraction
|
||||
import contextlib
|
||||
import copy
|
||||
import gettext
|
||||
import importlib
|
||||
import locale
|
||||
import mimetypes
|
||||
import pathlib
|
||||
import queue
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
import traceback
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
import magic
|
||||
|
||||
# internationalization constants
|
||||
DOMAIN = 'video2x'
|
||||
LOCALE_DIRECTORY = pathlib.Path(__file__).parent.absolute() / 'locale'
|
||||
|
||||
# getting default locale settings
|
||||
default_locale, encoding = locale.getdefaultlocale()
|
||||
language = gettext.translation(DOMAIN, LOCALE_DIRECTORY, [default_locale], fallback=True)
|
||||
language.install()
|
||||
_ = language.gettext
|
||||
|
||||
# version information
|
||||
UPSCALER_VERSION = '4.2.2'
|
||||
|
||||
# these names are consistent for
|
||||
# - driver selection in command line
|
||||
# - driver wrapper file names
|
||||
# - config file keys
|
||||
AVAILABLE_DRIVERS = ['waifu2x_caffe',
|
||||
'waifu2x_converter_cpp',
|
||||
'waifu2x_ncnn_vulkan',
|
||||
'srmd_ncnn_vulkan',
|
||||
'realsr_ncnn_vulkan',
|
||||
'anime4kcpp']
|
||||
|
||||
|
||||
class Upscaler:
|
||||
""" An instance of this class is a upscaler that will
|
||||
upscale all images in the given directory.
|
||||
|
||||
Raises:
|
||||
Exception -- all exceptions
|
||||
ArgumentError -- if argument is not valid
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
input_path: pathlib.Path or list,
|
||||
output_path: pathlib.Path,
|
||||
driver_settings: dict,
|
||||
ffmpeg_settings: dict,
|
||||
gifski_settings: dict,
|
||||
driver: str = 'waifu2x_caffe',
|
||||
scale_ratio: float = None,
|
||||
processes: int = 1,
|
||||
video2x_cache_directory: pathlib.Path = pathlib.Path(tempfile.gettempdir()) / 'video2x',
|
||||
extracted_frame_format: str = 'png',
|
||||
output_file_name_format_string: str = '{original_file_name}_output{extension}',
|
||||
image_output_extension: str = '.png',
|
||||
video_output_extension: str = '.mp4',
|
||||
preserve_frames: bool = False
|
||||
):
|
||||
|
||||
# required parameters
|
||||
self.input = input_path
|
||||
self.output = output_path
|
||||
self.driver_settings = driver_settings
|
||||
self.ffmpeg_settings = ffmpeg_settings
|
||||
self.gifski_settings = gifski_settings
|
||||
|
||||
# optional parameters
|
||||
self.driver = driver
|
||||
self.scale_ratio = scale_ratio
|
||||
self.processes = processes
|
||||
self.video2x_cache_directory = video2x_cache_directory
|
||||
self.extracted_frame_format = extracted_frame_format
|
||||
self.output_file_name_format_string = output_file_name_format_string
|
||||
self.image_output_extension = image_output_extension
|
||||
self.video_output_extension = video_output_extension
|
||||
self.preserve_frames = preserve_frames
|
||||
|
||||
# other internal members and signals
|
||||
self.running = False
|
||||
self.total_frames_upscaled = 0
|
||||
self.total_frames = 0
|
||||
self.total_files = 0
|
||||
self.total_processed = 0
|
||||
self.current_input_file = pathlib.Path()
|
||||
self.last_frame_upscaled = pathlib.Path()
|
||||
|
||||
def create_temp_directories(self):
|
||||
"""create temporary directories
|
||||
"""
|
||||
|
||||
# if cache directory unspecified, use %TEMP%\video2x
|
||||
if self.video2x_cache_directory is None:
|
||||
self.video2x_cache_directory = pathlib.Path(tempfile.gettempdir()) / 'video2x'
|
||||
|
||||
# if specified cache path exists and isn't a directory
|
||||
if self.video2x_cache_directory.exists() and not self.video2x_cache_directory.is_dir():
|
||||
Avalon.error(_('Specified or default cache directory is a file/link'))
|
||||
raise FileExistsError('Specified or default cache directory is a file/link')
|
||||
|
||||
# if cache directory doesn't exist, try creating it
|
||||
if not self.video2x_cache_directory.exists():
|
||||
try:
|
||||
Avalon.debug_info(_('Creating cache directory {}').format(self.video2x_cache_directory))
|
||||
self.video2x_cache_directory.mkdir(parents=True, exist_ok=True)
|
||||
except Exception as exception:
|
||||
Avalon.error(_('Unable to create {}').format(self.video2x_cache_directory))
|
||||
raise exception
|
||||
|
||||
# create temp directories for extracted frames and upscaled frames
|
||||
self.extracted_frames = pathlib.Path(tempfile.mkdtemp(dir=self.video2x_cache_directory))
|
||||
Avalon.debug_info(_('Extracted frames are being saved to: {}').format(self.extracted_frames))
|
||||
self.upscaled_frames = pathlib.Path(tempfile.mkdtemp(dir=self.video2x_cache_directory))
|
||||
Avalon.debug_info(_('Upscaled frames are being saved to: {}').format(self.upscaled_frames))
|
||||
|
||||
def cleanup_temp_directories(self):
|
||||
"""delete temp directories when done
|
||||
"""
|
||||
if not self.preserve_frames:
|
||||
for directory in [self.extracted_frames, self.upscaled_frames, self.video2x_cache_directory]:
|
||||
try:
|
||||
# avalon framework cannot be used if python is shutting down
|
||||
# therefore, plain print is used
|
||||
print(_('Cleaning up cache directory: {}').format(directory))
|
||||
shutil.rmtree(directory)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except OSError:
|
||||
print(_('Unable to delete: {}').format(directory))
|
||||
traceback.print_exc()
|
||||
|
||||
def _check_arguments(self):
|
||||
if isinstance(self.input, list):
|
||||
if self.output.exists() and not self.output.is_dir():
|
||||
Avalon.error(_('Input and output path type mismatch'))
|
||||
Avalon.error(_('Input is multiple files but output is not directory'))
|
||||
raise ArgumentError('input output path type mismatch')
|
||||
for input_path in self.input:
|
||||
if not input_path.is_file() and not input_path.is_dir():
|
||||
Avalon.error(_('Input path {} is neither a file nor a directory').format(input_path))
|
||||
raise FileNotFoundError(f'{input_path} is neither file nor directory')
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
if input_path.samefile(self.output):
|
||||
Avalon.error(_('Input directory and output directory cannot be the same'))
|
||||
raise FileExistsError('input directory and output directory are the same')
|
||||
|
||||
# if input is a file
|
||||
elif self.input.is_file():
|
||||
if self.output.is_dir():
|
||||
Avalon.error(_('Input and output path type mismatch'))
|
||||
Avalon.error(_('Input is single file but output is directory'))
|
||||
raise ArgumentError('input output path type mismatch')
|
||||
if self.output.suffix == '':
|
||||
Avalon.error(_('No suffix found in output file path'))
|
||||
Avalon.error(_('Suffix must be specified'))
|
||||
raise ArgumentError('no output file suffix specified')
|
||||
|
||||
# if input is a directory
|
||||
elif self.input.is_dir():
|
||||
if self.output.is_file():
|
||||
Avalon.error(_('Input and output path type mismatch'))
|
||||
Avalon.error(_('Input is directory but output is existing single file'))
|
||||
raise ArgumentError('input output path type mismatch')
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
if self.input.samefile(self.output):
|
||||
Avalon.error(_('Input directory and output directory cannot be the same'))
|
||||
raise FileExistsError('input directory and output directory are the same')
|
||||
|
||||
# if input is neither
|
||||
else:
|
||||
Avalon.error(_('Input path is neither a file nor a directory'))
|
||||
raise FileNotFoundError(f'{self.input} is neither file nor directory')
|
||||
|
||||
# check FFmpeg settings
|
||||
ffmpeg_path = pathlib.Path(self.ffmpeg_settings['ffmpeg_path'])
|
||||
if not ((pathlib.Path(ffmpeg_path / 'ffmpeg.exe').is_file() and
|
||||
pathlib.Path(ffmpeg_path / 'ffprobe.exe').is_file()) or
|
||||
(pathlib.Path(ffmpeg_path / 'ffmpeg').is_file() and
|
||||
pathlib.Path(ffmpeg_path / 'ffprobe').is_file())):
|
||||
Avalon.error(_('FFmpeg or FFprobe cannot be found under the specified path'))
|
||||
Avalon.error(_('Please check the configuration file settings'))
|
||||
raise FileNotFoundError(self.ffmpeg_settings['ffmpeg_path'])
|
||||
|
||||
# check if driver settings
|
||||
driver_settings = copy.deepcopy(self.driver_settings)
|
||||
driver_path = driver_settings.pop('path')
|
||||
|
||||
# check if driver path exists
|
||||
if not (pathlib.Path(driver_path).is_file() or pathlib.Path(f'{driver_path}.exe').is_file()):
|
||||
Avalon.error(_('Specified driver executable directory doesn\'t exist'))
|
||||
Avalon.error(_('Please check the configuration file settings'))
|
||||
raise FileNotFoundError(driver_path)
|
||||
|
||||
# parse driver arguments using driver's parser
|
||||
# the parser will throw AttributeError if argument doesn't satisfy constraints
|
||||
try:
|
||||
driver_arguments = []
|
||||
for key in driver_settings.keys():
|
||||
|
||||
value = driver_settings[key]
|
||||
|
||||
if value is None or value is False:
|
||||
continue
|
||||
|
||||
else:
|
||||
if len(key) == 1:
|
||||
driver_arguments.append(f'-{key}')
|
||||
else:
|
||||
driver_arguments.append(f'--{key}')
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
driver_arguments.append(str(value))
|
||||
|
||||
DriverWrapperMain = getattr(importlib.import_module(f'wrappers.{self.driver}'), 'WrapperMain')
|
||||
DriverWrapperMain.parse_arguments(driver_arguments)
|
||||
except AttributeError as e:
|
||||
Avalon.error(_('Failed to parse driver argument: {}').format(e.args[0]))
|
||||
raise e
|
||||
|
||||
# waifu2x-caffe scale_ratio, scale_width and scale_height check
|
||||
if self.driver == 'waifu2x_caffe':
|
||||
if (driver_settings['scale_width'] != 0 and driver_settings['scale_height'] == 0 or
|
||||
driver_settings['scale_width'] == 0 and driver_settings['scale_height'] != 0):
|
||||
Avalon.error(_('Only one of scale_width and scale_height is specified for waifu2x-caffe'))
|
||||
raise AttributeError('only one of scale_width and scale_height is specified for waifu2x-caffe')
|
||||
|
||||
# if scale_width and scale_height are specified, ensure scale_ratio is None
|
||||
elif self.driver_settings['scale_width'] != 0 and self.driver_settings['scale_height'] != 0:
|
||||
self.driver_settings['scale_ratio'] = None
|
||||
|
||||
# if scale_width and scale_height not specified
|
||||
# ensure they are None, not 0
|
||||
else:
|
||||
self.driver_settings['scale_width'] = None
|
||||
self.driver_settings['scale_height'] = None
|
||||
|
||||
def _upscale_frames(self):
|
||||
""" Upscale video frames with waifu2x-caffe
|
||||
|
||||
This function upscales all the frames extracted
|
||||
by ffmpeg using the waifu2x-caffe binary.
|
||||
|
||||
Arguments:
|
||||
w2 {Waifu2x Object} -- initialized waifu2x object
|
||||
"""
|
||||
|
||||
# initialize waifu2x driver
|
||||
if self.driver not in AVAILABLE_DRIVERS:
|
||||
raise UnrecognizedDriverError(_('Unrecognized driver: {}').format(self.driver))
|
||||
|
||||
# list all images in the extracted frames
|
||||
frames = [(self.extracted_frames / f) for f in self.extracted_frames.iterdir() if f.is_file]
|
||||
|
||||
# if we have less images than processes,
|
||||
# create only the processes necessary
|
||||
if len(frames) < self.processes:
|
||||
self.processes = len(frames)
|
||||
|
||||
# create a directory for each process and append directory
|
||||
# name into a list
|
||||
process_directories = []
|
||||
for process_id in range(self.processes):
|
||||
process_directory = self.extracted_frames / str(process_id)
|
||||
process_directories.append(process_directory)
|
||||
|
||||
# delete old directories and create new directories
|
||||
if process_directory.is_dir():
|
||||
shutil.rmtree(process_directory)
|
||||
process_directory.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# waifu2x-converter-cpp will perform multi-threading within its own process
|
||||
if self.driver in ['waifu2x_converter_cpp', 'waifu2x_ncnn_vulkan', 'srmd_ncnn_vulkan', 'realsr_ncnn_vulkan', 'anime4kcpp']:
|
||||
process_directories = [self.extracted_frames]
|
||||
|
||||
else:
|
||||
# evenly distribute images into each directory
|
||||
# until there is none left in the directory
|
||||
for image in frames:
|
||||
# move image
|
||||
image.rename(process_directories[0] / image.name)
|
||||
# rotate list
|
||||
process_directories = process_directories[-1:] + process_directories[:-1]
|
||||
|
||||
# create driver processes and start them
|
||||
for process_directory in process_directories:
|
||||
self.process_pool.append(self.driver_object.upscale(process_directory, self.upscaled_frames))
|
||||
|
||||
# start progress bar in a different thread
|
||||
Avalon.debug_info(_('Starting progress monitor'))
|
||||
self.progress_monitor = ProgressMonitor(self, process_directories)
|
||||
self.progress_monitor.start()
|
||||
|
||||
# create the clearer and start it
|
||||
Avalon.debug_info(_('Starting upscaled image cleaner'))
|
||||
self.image_cleaner = ImageCleaner(self.extracted_frames, self.upscaled_frames, len(self.process_pool))
|
||||
self.image_cleaner.start()
|
||||
|
||||
# wait for all process to exit
|
||||
try:
|
||||
self._wait()
|
||||
except (Exception, KeyboardInterrupt, SystemExit) as e:
|
||||
# cleanup
|
||||
Avalon.debug_info(_('Killing progress monitor'))
|
||||
self.progress_monitor.stop()
|
||||
|
||||
Avalon.debug_info(_('Killing upscaled image cleaner'))
|
||||
self.image_cleaner.stop()
|
||||
raise e
|
||||
|
||||
# if the driver is waifu2x-converter-cpp
|
||||
# images need to be renamed to be recognizable for FFmpeg
|
||||
if self.driver == 'waifu2x_converter_cpp':
|
||||
for image in [f for f in self.upscaled_frames.iterdir() if f.is_file()]:
|
||||
renamed = re.sub(f'_\\[.*\\]\\[x(\\d+(\\.\\d+)?)\\]\\.{self.extracted_frame_format}',
|
||||
f'.{self.extracted_frame_format}',
|
||||
str(image.name))
|
||||
(self.upscaled_frames / image).rename(self.upscaled_frames / renamed)
|
||||
|
||||
# upscaling done, kill helper threads
|
||||
Avalon.debug_info(_('Killing progress monitor'))
|
||||
self.progress_monitor.stop()
|
||||
|
||||
Avalon.debug_info(_('Killing upscaled image cleaner'))
|
||||
self.image_cleaner.stop()
|
||||
|
||||
def _terminate_subprocesses(self):
|
||||
Avalon.warning(_('Terminating all processes'))
|
||||
for process in self.process_pool:
|
||||
process.terminate()
|
||||
|
||||
def _wait(self):
|
||||
""" wait for subprocesses in process pool to complete
|
||||
"""
|
||||
Avalon.debug_info(_('Main process waiting for subprocesses to exit'))
|
||||
|
||||
try:
|
||||
# while process pool not empty
|
||||
while self.process_pool:
|
||||
|
||||
# if stop signal received, terminate all processes
|
||||
if self.running is False:
|
||||
raise SystemExit
|
||||
|
||||
for process in self.process_pool:
|
||||
process_status = process.poll()
|
||||
|
||||
# if process finished
|
||||
if process_status is None:
|
||||
continue
|
||||
|
||||
# if return code is not 0
|
||||
elif process_status != 0:
|
||||
Avalon.error(_('Subprocess {} exited with code {}').format(process.pid, process_status))
|
||||
raise subprocess.CalledProcessError(process_status, process.args)
|
||||
|
||||
else:
|
||||
Avalon.debug_info(_('Subprocess {} exited with code {}').format(process.pid, process_status))
|
||||
self.process_pool.remove(process)
|
||||
|
||||
time.sleep(0.1)
|
||||
|
||||
except (KeyboardInterrupt, SystemExit) as e:
|
||||
Avalon.warning(_('Stop signal received'))
|
||||
self._terminate_subprocesses()
|
||||
raise e
|
||||
|
||||
except (Exception, subprocess.CalledProcessError) as e:
|
||||
Avalon.error(_('Subprocess execution ran into an error'))
|
||||
self._terminate_subprocesses()
|
||||
raise e
|
||||
|
||||
def run(self):
|
||||
""" Main controller for Video2X
|
||||
|
||||
This function controls the flow of video conversion
|
||||
and handles all necessary functions.
|
||||
"""
|
||||
|
||||
# external stop signal when called in a thread
|
||||
self.running = True
|
||||
|
||||
# define process pool to contain processes
|
||||
self.process_pool = []
|
||||
|
||||
# load driver modules
|
||||
DriverWrapperMain = getattr(importlib.import_module(f'wrappers.{self.driver}'), 'WrapperMain')
|
||||
self.driver_object = DriverWrapperMain(self.driver_settings)
|
||||
|
||||
# load options from upscaler class into driver settings
|
||||
self.driver_object.load_configurations(self)
|
||||
|
||||
# initialize FFmpeg object
|
||||
self.ffmpeg_object = Ffmpeg(self.ffmpeg_settings, extracted_frame_format=self.extracted_frame_format)
|
||||
|
||||
# define processing queue
|
||||
self.processing_queue = queue.Queue()
|
||||
|
||||
Avalon.info(_('Loading files into processing queue'))
|
||||
Avalon.debug_info(_('Input path(s): {}').format(self.input))
|
||||
|
||||
# make output directory if the input is a list or a directory
|
||||
if isinstance(self.input, list) or self.input.is_dir():
|
||||
self.output.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
input_files = []
|
||||
|
||||
# if input is single directory
|
||||
# put it in a list for compability with the following code
|
||||
if not isinstance(self.input, list):
|
||||
input_paths = [self.input]
|
||||
else:
|
||||
input_paths = self.input
|
||||
|
||||
# flatten directories into file paths
|
||||
for input_path in input_paths:
|
||||
|
||||
# if the input path is a single file
|
||||
# add the file's path object to input_files
|
||||
if input_path.is_file():
|
||||
input_files.append(input_path)
|
||||
|
||||
# if the input path is a directory
|
||||
# add all files under the directory into the input_files (non-recursive)
|
||||
elif input_path.is_dir():
|
||||
input_files.extend([f for f in input_path.iterdir() if f.is_file()])
|
||||
|
||||
output_paths = []
|
||||
|
||||
for input_path in input_files:
|
||||
|
||||
# get file type
|
||||
# try python-magic if it's available
|
||||
try:
|
||||
input_file_mime_type = magic.from_file(str(input_path.absolute()), mime=True)
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
except Exception:
|
||||
input_file_type = input_file_subtype = None
|
||||
|
||||
# in case python-magic fails to detect file type
|
||||
# try guessing file mime type with mimetypes
|
||||
if input_file_type not in ['image', 'video']:
|
||||
input_file_mime_type = mimetypes.guess_type(input_path.name)[0]
|
||||
input_file_type = input_file_mime_type.split('/')[0]
|
||||
input_file_subtype = input_file_mime_type.split('/')[1]
|
||||
|
||||
# set default output file suffixes
|
||||
# if image type is GIF, default output suffix is also .gif
|
||||
if input_file_mime_type == 'image/gif':
|
||||
output_path = self.output / self.output_file_name_format_string.format(original_file_name=input_path.stem, extension='.gif')
|
||||
|
||||
elif input_file_type == 'image':
|
||||
output_path = self.output / self.output_file_name_format_string.format(original_file_name=input_path.stem, extension=self.image_output_extension)
|
||||
|
||||
elif input_file_type == 'video':
|
||||
output_path = self.output / self.output_file_name_format_string.format(original_file_name=input_path.stem, extension=self.video_output_extension)
|
||||
|
||||
# if file is none of: image, image/gif, video
|
||||
# skip to the next task
|
||||
else:
|
||||
Avalon.error(_('File {} ({}) neither an image nor a video').format(input_path, input_file_mime_type))
|
||||
Avalon.warning(_('Skipping this file'))
|
||||
continue
|
||||
|
||||
# if there is only one input file
|
||||
# do not modify output file suffix
|
||||
if isinstance(self.input, pathlib.Path) and self.input.is_file():
|
||||
output_path = self.output
|
||||
|
||||
output_path_id = 0
|
||||
while str(output_path) in output_paths:
|
||||
output_path = output_path.parent / pathlib.Path(f'{output_path.stem}_{output_path_id}{output_path.suffix}')
|
||||
output_path_id += 1
|
||||
|
||||
# record output path
|
||||
output_paths.append(str(output_path))
|
||||
|
||||
# push file information into processing queue
|
||||
self.processing_queue.put((input_path.absolute(), output_path.absolute(), input_file_mime_type, input_file_type, input_file_subtype))
|
||||
|
||||
# check argument sanity before running
|
||||
self._check_arguments()
|
||||
|
||||
# record file count for external calls
|
||||
self.total_files = self.processing_queue.qsize()
|
||||
|
||||
Avalon.info(_('Loaded files into processing queue'))
|
||||
# print all files in queue for debugging
|
||||
for job in self.processing_queue.queue:
|
||||
Avalon.debug_info(_('Input file: {}').format(job[0].absolute()))
|
||||
|
||||
try:
|
||||
while not self.processing_queue.empty():
|
||||
|
||||
# get new job from queue
|
||||
self.current_input_file, output_path, input_file_mime_type, input_file_type, input_file_subtype = self.processing_queue.get()
|
||||
|
||||
# start handling input
|
||||
# if input file is a static image
|
||||
if input_file_type == 'image' and input_file_subtype != 'gif':
|
||||
Avalon.info(_('Starting to upscale image'))
|
||||
self.process_pool.append(self.driver_object.upscale(self.current_input_file, output_path))
|
||||
self._wait()
|
||||
Avalon.info(_('Upscaling completed'))
|
||||
|
||||
# static images don't require GIF or video encoding
|
||||
# go to the next task
|
||||
self.processing_queue.task_done()
|
||||
self.total_processed += 1
|
||||
continue
|
||||
|
||||
# if input file is a image/gif file or a video
|
||||
elif input_file_mime_type == 'image/gif' or input_file_type == 'video':
|
||||
|
||||
self.create_temp_directories()
|
||||
|
||||
# get video information JSON using FFprobe
|
||||
Avalon.info(_('Reading video information'))
|
||||
video_info = self.ffmpeg_object.probe_file_info(self.current_input_file)
|
||||
# analyze original video with FFprobe and retrieve framerate
|
||||
# width, height = info['streams'][0]['width'], info['streams'][0]['height']
|
||||
|
||||
# find index of video stream
|
||||
video_stream_index = None
|
||||
for stream in video_info['streams']:
|
||||
if stream['codec_type'] == 'video':
|
||||
video_stream_index = stream['index']
|
||||
break
|
||||
|
||||
# exit if no video stream found
|
||||
if video_stream_index is None:
|
||||
Avalon.error(_('Aborting: No video stream found'))
|
||||
raise StreamNotFoundError('no video stream found')
|
||||
|
||||
# get average frame rate of video stream
|
||||
framerate = float(Fraction(video_info['streams'][video_stream_index]['r_frame_rate']))
|
||||
Avalon.info(_('Framerate: {}').format(framerate))
|
||||
# self.ffmpeg_object.pixel_format = video_info['streams'][video_stream_index]['pix_fmt']
|
||||
|
||||
# extract frames from video
|
||||
self.process_pool.append((self.ffmpeg_object.extract_frames(self.current_input_file, self.extracted_frames)))
|
||||
self._wait()
|
||||
|
||||
# if driver is waifu2x-caffe
|
||||
# pass pixel format output depth information
|
||||
if self.driver == 'waifu2x_caffe':
|
||||
# get a dict of all pixel formats and corresponding bit depth
|
||||
pixel_formats = self.ffmpeg_object.get_pixel_formats()
|
||||
|
||||
# try getting pixel format's corresponding bti depth
|
||||
try:
|
||||
self.driver_settings['output_depth'] = pixel_formats[self.ffmpeg_object.pixel_format]
|
||||
except KeyError:
|
||||
Avalon.error(_('Unsupported pixel format: {}').format(self.ffmpeg_object.pixel_format))
|
||||
raise UnsupportedPixelError(f'unsupported pixel format {self.ffmpeg_object.pixel_format}')
|
||||
|
||||
# width/height will be coded width/height x upscale factor
|
||||
# original_width = video_info['streams'][video_stream_index]['width']
|
||||
# original_height = video_info['streams'][video_stream_index]['height']
|
||||
# scale_width = int(self.scale_ratio * original_width)
|
||||
# scale_height = int(self.scale_ratio * original_height)
|
||||
|
||||
# upscale images one by one using waifu2x
|
||||
Avalon.info(_('Starting to upscale extracted frames'))
|
||||
self._upscale_frames()
|
||||
Avalon.info(_('Upscaling completed'))
|
||||
|
||||
# start handling output
|
||||
# output can be either GIF or video
|
||||
|
||||
# if the desired output is gif file
|
||||
if output_path.suffix.lower() == '.gif':
|
||||
Avalon.info(_('Converting extracted frames into GIF image'))
|
||||
gifski_object = Gifski(self.gifski_settings)
|
||||
self.process_pool.append(gifski_object.make_gif(self.upscaled_frames, output_path, framerate, self.extracted_frame_format))
|
||||
self._wait()
|
||||
Avalon.info(_('Conversion completed'))
|
||||
|
||||
# if the desired output is video
|
||||
else:
|
||||
# frames to video
|
||||
Avalon.info(_('Converting extracted frames into video'))
|
||||
self.process_pool.append(self.ffmpeg_object.assemble_video(framerate, self.upscaled_frames))
|
||||
# f'{scale_width}x{scale_height}'
|
||||
self._wait()
|
||||
Avalon.info(_('Conversion completed'))
|
||||
|
||||
try:
|
||||
# migrate audio tracks and subtitles
|
||||
Avalon.info(_('Migrating audio, subtitles and other streams to upscaled video'))
|
||||
self.process_pool.append(self.ffmpeg_object.migrate_streams(self.current_input_file,
|
||||
output_path,
|
||||
self.upscaled_frames))
|
||||
self._wait()
|
||||
|
||||
# if failed to copy streams
|
||||
# use file with only video stream
|
||||
except subprocess.CalledProcessError:
|
||||
traceback.print_exc()
|
||||
Avalon.error(_('Failed to migrate streams'))
|
||||
Avalon.warning(_('Trying to output video without additional streams'))
|
||||
|
||||
if input_file_mime_type == 'image/gif':
|
||||
# copy will overwrite destination content if exists
|
||||
shutil.copy(self.upscaled_frames / self.ffmpeg_object.intermediate_file_name, output_path)
|
||||
|
||||
else:
|
||||
# construct output file path
|
||||
output_file_name = f'{output_path.stem}{self.ffmpeg_object.intermediate_file_name.suffix}'
|
||||
output_video_path = output_path.parent / output_file_name
|
||||
|
||||
# if output file already exists
|
||||
# create temporary directory in output folder
|
||||
# temporary directories generated by tempfile are guaranteed to be unique
|
||||
# and won't conflict with other files
|
||||
if output_video_path.exists():
|
||||
Avalon.error(_('Output video file exists'))
|
||||
|
||||
temporary_directory = pathlib.Path(tempfile.mkdtemp(dir=output_path.parent))
|
||||
output_video_path = temporary_directory / output_file_name
|
||||
Avalon.info(_('Created temporary directory to contain file'))
|
||||
|
||||
# move file to new destination
|
||||
Avalon.info(_('Writing intermediate file to: {}').format(output_video_path.absolute()))
|
||||
shutil.move(self.upscaled_frames / self.ffmpeg_object.intermediate_file_name, output_video_path)
|
||||
|
||||
# increment total number of files processed
|
||||
self.cleanup_temp_directories()
|
||||
self.processing_queue.task_done()
|
||||
self.total_processed += 1
|
||||
|
||||
except (Exception, KeyboardInterrupt, SystemExit) as e:
|
||||
with contextlib.suppress(ValueError, AttributeError):
|
||||
self.cleanup_temp_directories()
|
||||
self.running = False
|
||||
raise e
|
||||
|
||||
# signal upscaling completion
|
||||
self.running = False
|
||||
307
src/video2x.pot
307
src/video2x.pot
@@ -1,307 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2020-05-22 17:51-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=cp1252\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
|
||||
|
||||
#: progress_monitor.py:42
|
||||
msgid "Upscaling Progress"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:110
|
||||
msgid "Specified or default cache directory is a file/link"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:116
|
||||
msgid "Creating cache directory {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:119
|
||||
msgid "Unable to create {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:124
|
||||
msgid "Extracted frames are being saved to: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:126
|
||||
msgid "Upscaled frames are being saved to: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:136
|
||||
msgid "Cleaning up cache directory: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:141
|
||||
msgid "Unable to delete: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:147 upscaler.py:162 upscaler.py:173
|
||||
msgid "Input and output path type mismatch"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:148
|
||||
msgid "Input is multiple files but output is not directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:152
|
||||
msgid "Input path {} is neither a file nor a directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:156 upscaler.py:178
|
||||
msgid "Input directory and output directory cannot be the same"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:163
|
||||
msgid "Input is single file but output is directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:166
|
||||
msgid "No suffix found in output file path"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:167
|
||||
msgid "Suffix must be specified"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:174
|
||||
msgid "Input is directory but output is existing single file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:183
|
||||
msgid "Input path is neither a file nor a directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:192
|
||||
msgid "FFmpeg or FFprobe cannot be found under the specified path"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:193 upscaler.py:203
|
||||
msgid "Please check the configuration file settings"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:202
|
||||
msgid "Specified driver executable directory doesn't exist"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:229
|
||||
msgid "Failed to parse driver argument: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:261
|
||||
msgid "Unrecognized driver: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:301
|
||||
msgid "Starting progress monitor"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:306
|
||||
msgid "Starting upscaled image cleaner"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:315 upscaler.py:332
|
||||
msgid "Killing progress monitor"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:318 upscaler.py:335
|
||||
msgid "Killing upscaled image cleaner"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:339
|
||||
msgid "Terminating all processes"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:346
|
||||
msgid "Main process waiting for subprocesses to exit"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:365 upscaler.py:369
|
||||
msgid "Subprocess {} exited with code {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:375
|
||||
msgid "Stop signal received"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:380
|
||||
msgid "Subprocess execution ran into an error"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:410
|
||||
msgid "Loading files into processing queue"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:415
|
||||
msgid "Loading files from multiple paths"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:416 upscaler.py:435 upscaler.py:442
|
||||
msgid "Input path(s): {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:434
|
||||
msgid "Loading single file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:441
|
||||
msgid "Loading files from directory"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:455
|
||||
msgid "Loaded files into processing queue"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:458
|
||||
msgid "Input file: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:485
|
||||
msgid "Starting to upscale image"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:488 upscaler.py:550
|
||||
msgid "Upscaling completed"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:502
|
||||
msgid "Reading video information"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:516
|
||||
msgid "Aborting: No video stream found"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:521
|
||||
msgid "Framerate: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:538
|
||||
msgid "Unsupported pixel format: {}"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:548
|
||||
msgid "Starting to upscale extracted frames"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:555
|
||||
msgid "File {} ({}) neither an image nor a video"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:556
|
||||
msgid "Skipping this file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:566
|
||||
msgid "Converting extracted frames into GIF image"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:570 upscaler.py:579
|
||||
msgid "Conversion completed"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:575
|
||||
msgid "Converting extracted frames into video"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:583
|
||||
msgid "Migrating audio, subtitles and other streams to upscaled video"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:593
|
||||
msgid "Failed to migrate streams"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:594
|
||||
msgid "Trying to output video without additional streams"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:610
|
||||
msgid "Output video file exists"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:614
|
||||
msgid "Created temporary directory to contain file"
|
||||
msgstr ""
|
||||
|
||||
#: upscaler.py:617
|
||||
msgid "Writing intermediate file to: {}"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:85
|
||||
msgid ""
|
||||
"Video2X CLI Version: {}\n"
|
||||
"Upscaler Version: {}\n"
|
||||
"Author: K4YT3X\n"
|
||||
"License: GNU GPL v3\n"
|
||||
"Github Page: https://github.com/k4yt3x/video2x\n"
|
||||
"Contact: k4yt3x@k4yt3x.com"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:108
|
||||
msgid "Video2X Options"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:109
|
||||
msgid "show this help message and exit"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:110
|
||||
msgid "source video file/directory"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:111
|
||||
msgid "output video file/directory"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:112
|
||||
msgid "video2x config file path"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:114
|
||||
msgid "display version, lawful information and exit"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:117
|
||||
msgid "Upscaling Options"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:118
|
||||
msgid "upscaling driver"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:119
|
||||
msgid "scaling ratio"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:120
|
||||
msgid "number of processes to use for upscaling"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:121
|
||||
msgid "preserve extracted and upscaled frames"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:161
|
||||
msgid "This file cannot be imported"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:236
|
||||
msgid "Program completed, taking {} seconds"
|
||||
msgstr ""
|
||||
|
||||
#: video2x.py:239
|
||||
msgid "An exception has occurred"
|
||||
msgstr ""
|
||||
|
||||
267
src/video2x.py
267
src/video2x.py
@@ -1,267 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
r"""
|
||||
|
||||
__ __ _ _ ___ __ __
|
||||
\ \ / / (_) | | |__ \ \ \ / /
|
||||
\ \ / / _ __| | ___ ___ ) | \ V /
|
||||
\ \/ / | | / _` | / _ \ / _ \ / / > <
|
||||
\ / | | | (_| | | __/ | (_) | / /_ / . \
|
||||
\/ |_| \__,_| \___| \___/ |____| /_/ \_\
|
||||
|
||||
|
||||
Name: Video2X Controller
|
||||
Creator: K4YT3X
|
||||
Date Created: Feb 24, 2018
|
||||
Last Modified: June 29, 2020
|
||||
|
||||
Editor: BrianPetkovsek
|
||||
Last Modified: June 17, 2019
|
||||
|
||||
Editor: SAT3LL
|
||||
Last Modified: June 25, 2019
|
||||
|
||||
Editor: 28598519a
|
||||
Last Modified: March 23, 2020
|
||||
|
||||
Licensed under the GNU General Public License Version 3 (GNU GPL v3),
|
||||
available at: https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
(C) 2018 - 2020 K4YT3X
|
||||
|
||||
Video2X is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Video2X is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Description: Video2X is an automation software based on waifu2x image
|
||||
enlarging engine. It extracts frames from a video, enlarge it by a
|
||||
number of times without losing any details or quality, keeping lines
|
||||
smooth and edges sharp.
|
||||
"""
|
||||
|
||||
# local imports
|
||||
from bilogger import BiLogger
|
||||
from upscaler import AVAILABLE_DRIVERS
|
||||
from upscaler import UPSCALER_VERSION
|
||||
from upscaler import Upscaler
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import datetime
|
||||
import gettext
|
||||
import importlib
|
||||
import locale
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import traceback
|
||||
import yaml
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
# internationalization constants
|
||||
DOMAIN = 'video2x'
|
||||
LOCALE_DIRECTORY = pathlib.Path(__file__).parent.absolute() / 'locale'
|
||||
|
||||
# getting default locale settings
|
||||
default_locale, encoding = locale.getdefaultlocale()
|
||||
language = gettext.translation(DOMAIN, LOCALE_DIRECTORY, [default_locale], fallback=True)
|
||||
language.install()
|
||||
_ = language.gettext
|
||||
|
||||
CLI_VERSION = '4.2.0'
|
||||
|
||||
LEGAL_INFO = _('''Video2X CLI Version: {}
|
||||
Upscaler Version: {}
|
||||
Author: K4YT3X
|
||||
License: GNU GPL v3
|
||||
Github Page: https://github.com/k4yt3x/video2x
|
||||
Contact: k4yt3x@k4yt3x.com''').format(CLI_VERSION, UPSCALER_VERSION)
|
||||
|
||||
LOGO = r'''
|
||||
__ __ _ _ ___ __ __
|
||||
\ \ / / (_) | | |__ \ \ \ / /
|
||||
\ \ / / _ __| | ___ ___ ) | \ V /
|
||||
\ \/ / | | / _` | / _ \ / _ \ / / > <
|
||||
\ / | | | (_| | | __/ | (_) | / /_ / . \
|
||||
\/ |_| \__,_| \___| \___/ |____| /_/ \_\
|
||||
'''
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
""" parse CLI arguments
|
||||
"""
|
||||
parser = argparse.ArgumentParser(prog='video2x', formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
|
||||
# video options
|
||||
video2x_options = parser.add_argument_group(_('Video2X Options'))
|
||||
video2x_options.add_argument('-h', '--help', action='help', help=_('show this help message and exit'))
|
||||
|
||||
# if help is in arguments list
|
||||
# do not require input and output path to be specified
|
||||
require_input_output = True
|
||||
if '-h' in sys.argv or '--help' in sys.argv:
|
||||
require_input_output = False
|
||||
video2x_options.add_argument('-i', '--input', type=pathlib.Path, help=_('source video file/directory'), required=require_input_output)
|
||||
video2x_options.add_argument('-o', '--output', type=pathlib.Path, help=_('output video file/directory'), required=require_input_output)
|
||||
|
||||
video2x_options.add_argument('-c', '--config', type=pathlib.Path, help=_('video2x config file path'), action='store',
|
||||
default=pathlib.Path(__file__).parent.absolute() / 'video2x.yaml')
|
||||
video2x_options.add_argument('--log', type=pathlib.Path, help=_('log file path'),
|
||||
default=pathlib.Path(__file__).parent.absolute() / f'video2x_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.log')
|
||||
video2x_options.add_argument('--disable_logging', help=_('disable logging'), action='store_true')
|
||||
video2x_options.add_argument('-v', '--version', help=_('display version, lawful information and exit'), action='store_true')
|
||||
|
||||
# scaling options
|
||||
upscaling_options = parser.add_argument_group(_('Upscaling Options'))
|
||||
upscaling_options.add_argument('-d', '--driver', help=_('upscaling driver'), choices=AVAILABLE_DRIVERS, default='waifu2x_caffe')
|
||||
upscaling_options.add_argument('-r', '--ratio', help=_('scaling ratio'), action='store', type=float, default=2.0)
|
||||
upscaling_options.add_argument('-p', '--processes', help=_('number of processes to use for upscaling'), action='store', type=int, default=1)
|
||||
upscaling_options.add_argument('--preserve_frames', help=_('preserve extracted and upscaled frames'), action='store_true')
|
||||
|
||||
# if no driver arguments are specified
|
||||
if '--' not in sys.argv:
|
||||
video2x_args = parser.parse_args()
|
||||
return video2x_args, None
|
||||
|
||||
# if driver arguments are specified
|
||||
else:
|
||||
video2x_args = parser.parse_args(sys.argv[1:sys.argv.index('--')])
|
||||
wrapper = getattr(importlib.import_module(f'wrappers.{video2x_args.driver}'), 'WrapperMain')
|
||||
driver_args = wrapper.parse_arguments(sys.argv[sys.argv.index('--') + 1:])
|
||||
return video2x_args, driver_args
|
||||
|
||||
|
||||
def print_logo():
|
||||
"""print video2x logo"""
|
||||
print(LOGO)
|
||||
print(f'\n{"Video2X Video Enlarger".rjust(40, " ")}')
|
||||
print(f'\n{Avalon.FM.BD}{f"Version {CLI_VERSION}".rjust(36, " ")}{Avalon.FM.RST}\n')
|
||||
|
||||
|
||||
def read_config(config_file: pathlib.Path) -> dict:
|
||||
""" read video2x configurations from config file
|
||||
|
||||
Arguments:
|
||||
config_file {pathlib.Path} -- video2x configuration file pathlib.Path
|
||||
|
||||
Returns:
|
||||
dict -- dictionary of video2x configuration
|
||||
"""
|
||||
|
||||
with open(config_file, 'r') as config:
|
||||
return yaml.load(config, Loader=yaml.FullLoader)
|
||||
|
||||
|
||||
# /////////////////// Execution /////////////////// #
|
||||
|
||||
# this is not a library
|
||||
if __name__ != '__main__':
|
||||
Avalon.error(_('This file cannot be imported'))
|
||||
raise ImportError(f'{__file__} cannot be imported')
|
||||
|
||||
# print video2x logo
|
||||
print_logo()
|
||||
|
||||
# parse command line arguments
|
||||
video2x_args, driver_args = parse_arguments()
|
||||
|
||||
# display version and lawful informaition
|
||||
if video2x_args.version:
|
||||
print(LEGAL_INFO)
|
||||
sys.exit(0)
|
||||
|
||||
# redirect output to both terminal and log file
|
||||
if video2x_args.disable_logging is False:
|
||||
LOGFILE = video2x_args.log
|
||||
Avalon.debug_info(_('Redirecting console logs to {}').format(LOGFILE))
|
||||
sys.stdout = BiLogger(sys.stdout, LOGFILE)
|
||||
sys.stderr = BiLogger(sys.stderr, LOGFILE)
|
||||
|
||||
# read configurations from configuration file
|
||||
config = read_config(video2x_args.config)
|
||||
|
||||
# load waifu2x configuration
|
||||
driver_settings = config[video2x_args.driver]
|
||||
driver_settings['path'] = os.path.expandvars(driver_settings['path'])
|
||||
|
||||
# read FFmpeg configuration
|
||||
ffmpeg_settings = config['ffmpeg']
|
||||
ffmpeg_settings['ffmpeg_path'] = os.path.expandvars(ffmpeg_settings['ffmpeg_path'])
|
||||
|
||||
# read Gifski configuration
|
||||
gifski_settings = config['gifski']
|
||||
gifski_settings['gifski_path'] = os.path.expandvars(gifski_settings['gifski_path'])
|
||||
|
||||
# load video2x settings
|
||||
extracted_frame_format = config['video2x']['extracted_frame_format'].lower()
|
||||
output_file_name_format_string = config['video2x']['output_file_name_format_string']
|
||||
image_output_extension = config['video2x']['image_output_extension']
|
||||
video_output_extension = config['video2x']['video_output_extension']
|
||||
preserve_frames = config['video2x']['preserve_frames']
|
||||
|
||||
# if preserve frames specified in command line
|
||||
# overwrite config file options
|
||||
if video2x_args.preserve_frames is True:
|
||||
preserve_frames = True
|
||||
|
||||
# if cache directory not specified
|
||||
# use default path: %TEMP%\video2x
|
||||
if config['video2x']['video2x_cache_directory'] is None:
|
||||
video2x_cache_directory = (pathlib.Path(tempfile.gettempdir()) / 'video2x')
|
||||
else:
|
||||
video2x_cache_directory = pathlib.Path(config['video2x']['video2x_cache_directory'])
|
||||
|
||||
# overwrite driver_settings with driver_args
|
||||
if driver_args is not None:
|
||||
driver_args_dict = vars(driver_args)
|
||||
for key in driver_args_dict:
|
||||
if driver_args_dict[key] is not None:
|
||||
driver_settings[key] = driver_args_dict[key]
|
||||
|
||||
# start execution
|
||||
try:
|
||||
# start timer
|
||||
begin_time = time.time()
|
||||
|
||||
# initialize upscaler object
|
||||
upscaler = Upscaler(
|
||||
# required parameters
|
||||
input_path=video2x_args.input,
|
||||
output_path=video2x_args.output,
|
||||
driver_settings=driver_settings,
|
||||
ffmpeg_settings=ffmpeg_settings,
|
||||
gifski_settings=gifski_settings,
|
||||
|
||||
# optional parameters
|
||||
driver=video2x_args.driver,
|
||||
scale_ratio=video2x_args.ratio,
|
||||
processes=video2x_args.processes,
|
||||
video2x_cache_directory=video2x_cache_directory,
|
||||
extracted_frame_format=extracted_frame_format,
|
||||
output_file_name_format_string=output_file_name_format_string,
|
||||
image_output_extension=image_output_extension,
|
||||
video_output_extension=video_output_extension,
|
||||
preserve_frames=preserve_frames
|
||||
)
|
||||
|
||||
# run upscaler
|
||||
upscaler.run()
|
||||
|
||||
Avalon.info(_('Program completed, taking {} seconds').format(round((time.time() - begin_time), 5)))
|
||||
|
||||
except Exception:
|
||||
Avalon.error(_('An exception has occurred'))
|
||||
traceback.print_exc()
|
||||
182
src/video2x.yaml
182
src/video2x.yaml
@@ -1,182 +0,0 @@
|
||||
# Name: Video2X Configuration File
|
||||
# Creator: K4YT3X
|
||||
# Date Created: October 23, 2018
|
||||
# Last Modified: August 18, 2020
|
||||
# Values here are the default values. Change the value here to
|
||||
# save the default value permanently.
|
||||
# Items commented out are parameters irrelevant to this context
|
||||
# or parameters handled by Video2X internally.
|
||||
waifu2x_caffe:
|
||||
path: '%LOCALAPPDATA%\video2x\waifu2x-caffe\waifu2x-caffe-cui'
|
||||
tta: 0 # <0|1> 8x slower and slightly high quality
|
||||
gpu: 0 # gpu device no
|
||||
batch_size: 1 # input batch size
|
||||
crop_h: null # input image split size(height)
|
||||
crop_w: null # input image split size(width)
|
||||
crop_size: 128 # input image split size
|
||||
output_depth: 8 # output image chanel depth bit
|
||||
output_quality: -1 # output image quality
|
||||
process: gpu # <cpu|gpu|cudnn> process mode
|
||||
model_dir: null # path to custom model directory (don't append last / )
|
||||
scale_height: 0 # custom scale height (specifying this will overwrite scale_ratio)
|
||||
scale_width: 0 # custom scale width (specifying this will overwrite scale_ratio)
|
||||
#scale_ratio: null # custom scale ratio
|
||||
noise_level: 3 # <0|1|2|3> noise reduction level
|
||||
mode: noise_scale # <noise|scale|noise_scale|auto_scale> image processing mode
|
||||
output_extention: null # extension to output image file when output_path is (auto) or input_path is folder
|
||||
input_extention_list: null # extension to input image file when input_path is folder
|
||||
#output_path: null # path to output image file (when input_path is folder, output_path must be folder)
|
||||
#input_path: null # (required) path to input image file
|
||||
waifu2x_converter_cpp:
|
||||
path: '%LOCALAPPDATA%\video2x\waifu2x-converter-cpp\waifu2x-converter-cpp'
|
||||
#list-supported-formats: null # dump currently supported format list
|
||||
#list-opencv-formats: null # (deprecated. Use --list-supported-formats) dump opencv supported format list
|
||||
#list-processor # dump processor list
|
||||
output-format: null # The format used when running in recursive/folder mode
|
||||
png-compression: 5 # Set PNG compression level (0-9), 9 = Max compression (slowest & smallest)
|
||||
image-quality: -1 # JPEG & WebP Compression quality (-1-101, 0 being smallest size and lowest quality, -1 being default), use 101 for lossless WebP
|
||||
block-size: 0 # block size
|
||||
disable-gpu: false # disable GPU
|
||||
force-OpenCL: false # force to use OpenCL on Intel Platform
|
||||
processor: -1 # set target processor (-1 uses default device)
|
||||
jobs: 0 # number of threads launching at the same time
|
||||
model-dir: null # path to custom model directory (don't append last / ) default: models_rgb
|
||||
#scale-ratio: 2.0 # custom scale ratio
|
||||
noise-level: 1 # <0|1|2|3> noise reduction level
|
||||
mode: noise-scale # <noise|scale|noise-scale> image processing mode
|
||||
log-level: 1 # <0|1|2|3|4> Set log level
|
||||
silent: true # Enable silent mode. (same as --log-level 1)
|
||||
tta: 0 # Enable Test-Time Augmentation mode. (0 or 1)
|
||||
#generate-subdir: 0 # Generate sub folder when recursive directory is enabled.
|
||||
#auto-naming: 0 # Add postfix to output name when output path is not specified.
|
||||
#recursive-directory: 0 # Search recursively through directories to find more images to process.
|
||||
#output: null # path to output image file or directory (you should use the full path)
|
||||
#input: null # (required) path to input image file or directory (you should use the full path)
|
||||
waifu2x_ncnn_vulkan:
|
||||
path: '%LOCALAPPDATA%\video2x\waifu2x-ncnn-vulkan\waifu2x-ncnn-vulkan'
|
||||
v: null # verbose output
|
||||
#i: null # input-path: input image path (jpg/png) or directory
|
||||
#o: null # output-path: output image path (png) or directory
|
||||
'n': 2 # noise-level: denoise level (-1/0/1/2/3, default=0)
|
||||
s: 2 # scale: upscale ratio (1/2, default=2)
|
||||
t: 400 # tile-size: tile size (>=32, default=400)
|
||||
m: null # model-path: waifu2x model path (default=models-cunet)
|
||||
g: 0 # gpu-id: gpu device to use (default=0)
|
||||
j: '1:2:2' # thread count for load/proc/save (default=1:2:2)
|
||||
x: false # enable tta mode
|
||||
srmd_ncnn_vulkan:
|
||||
path: '%LOCALAPPDATA%\video2x\srmd-ncnn-vulkan\srmd-ncnn-vulkan'
|
||||
v: null # verbose output
|
||||
#i: null # input-path: input image path (jpg/png) or directory
|
||||
#o: null # output-path: output image path (png) or directory
|
||||
'n': 3 # noise-level: denoise level (-1/0/1/2/3/4/5/6/7/8/9/10, default=3)
|
||||
s: 2 # upscale ratio (2/3/4, default=2)
|
||||
t: 400 # tile-size: tile size (>=32, default=400)
|
||||
m: null # srmd model path (default=models-srmd)
|
||||
g: 0 # gpu device to use (default=0)
|
||||
j: '1:2:2' # thread count for load/proc/save (default=1:2:2)
|
||||
x: false # enable tta mode
|
||||
realsr_ncnn_vulkan:
|
||||
path: '%LOCALAPPDATA%\video2x\realsr-ncnn-vulkan\realsr-ncnn-vulkan'
|
||||
v: null # verbose output
|
||||
#i: null # input-path: input image path (jpg/png) or directory
|
||||
#o: null # output-path: output image path (png) or directory
|
||||
s: 4 # upscale ratio (4, default=4)
|
||||
t: 0 # tile size (>=32/0=auto, default=0)
|
||||
m: null # realsr model path (default=models-DF2K)
|
||||
g: 0 # gpu device to use (default=0)
|
||||
j: '1:2:2' # thread count for load/proc/save (default=1:2:2)
|
||||
x: false # enable tta mode
|
||||
anime4kcpp:
|
||||
path: '%LOCALAPPDATA%\video2x\anime4kcpp\CLI\Anime4KCPP_CLI\Anime4KCPP_CLI'
|
||||
#input: null # File for loading (string [=./pic/p1.png])
|
||||
#output: null # File for outputting (string [=output.png])
|
||||
passes: 2 # Passes for processing (int [=2])
|
||||
pushColorCount: 2 # Limit the number of color pushes (int [=2])
|
||||
strengthColor: 0.3 # Strength for pushing color,range 0 to 1,higher for thinner (double [=0.3])
|
||||
strengthGradient: 1.0 # Strength for pushing gradient,range 0 to 1,higher for sharper (double [=1])
|
||||
zoomFactor: 2.0 # zoom factor for resizing (double [=2])
|
||||
threads: 16 # Threads count for video processing (unsigned int [=16])
|
||||
fastMode: false # Faster but maybe low quality
|
||||
videoMode: false # Video process
|
||||
preview: null # Preview image
|
||||
preprocessing: false # Enable pre processing
|
||||
postprocessing: false # Enable post processing
|
||||
preFilters: 4 # Enhancement filter, only working when preProcessing is true,there are 5 options by binary:Median blur=0000001, Mean blur=0000010, CAS Sharpening=0000100, Gaussian blur weak=0001000, Gaussian blur=0010000, Bilateral filter=0100000, Bilateral filter faster=1000000, you can freely combine them, eg: Gaussian blur weak + Bilateral filter = 0001000 | 0100000 = 0101000 = 40(D) (unsigned int [=4])
|
||||
postFilters: 40 # Enhancement filter, only working when postProcessing is true,there are 5 options by binary:Median blur=0000001, Mean blur=0000010, CAS Sharpening=0000100, Gaussian blur weak=0001000, Gaussian blur=0010000, Bilateral filter=0100000, Bilateral filter faster=1000000, you can freely combine them, eg: Gaussian blur weak + Bilateral filter = 0001000 | 0100000 = 0101000 = 40(D), so you can put 40 to enable Gaussian blur weak and Bilateral filter, which also is what I recommend for image that < 1080P, 48 for image that >= 1080P, and for performance I recommend to use 72 for video that < 1080P, 80 for video that >=1080P (unsigned int [=40])
|
||||
GPUMode: false # Enable GPU acceleration
|
||||
CNNMode: false # Enable ACNet
|
||||
HDN: false # Enable HDN mode for ACNet
|
||||
HDNLevel: 1 # Set HDN level (int [=1])
|
||||
listGPUs: null # list GPUs
|
||||
platformID: 0 # Specify the platform ID (unsigned int [=0])
|
||||
deviceID: 0 # Specify the device ID (unsigned int [=0])
|
||||
codec: mp4v # Specify the codec for encoding from mp4v(recommended in Windows), dxva(for Windows), avc1(H264, recommended in Linux), vp09(very slow), hevc(not support in Windowds), av01(not support in Windowds) (string [=mp4v])
|
||||
forceFps: 0 # Set output video fps to the specifying number, 0 to disable (float [=0])
|
||||
disableProgress: false # disable progress display
|
||||
webVideo: null # process the video from URL
|
||||
alpha: false # preserve the Alpha channel for transparent image
|
||||
ffmpeg:
|
||||
ffmpeg_path: '%LOCALAPPDATA%\video2x\ffmpeg-latest-win64-static\bin'
|
||||
intermediate_file_name: 'intermediate.mkv'
|
||||
# Step 1: Frame Extraction
|
||||
# extract all frames from original input into temporary directory
|
||||
extract_frames:
|
||||
'-hwaccel': auto # automatically select hardware acceleration method
|
||||
'-y': true
|
||||
input_options: {} # empty dict, expand if necessary
|
||||
output_options:
|
||||
'-pix_fmt': rgb24 # extracted frames pixel format
|
||||
'-qscale:v': null # output image quality control for JPEG (1-31, 1 being highest)
|
||||
# Step 2: Video Assembly
|
||||
# assemble all frames back into a video with only a video track
|
||||
assemble_video:
|
||||
'-hwaccel': auto # automatically select hardware acceleration method
|
||||
'-y': true
|
||||
input_options:
|
||||
'-f': image2 # force image2 format
|
||||
output_options:
|
||||
'-vcodec': libx264 # video codec
|
||||
'-pix_fmt': 'yuv420p' # overwrite default pixel format
|
||||
'-crf': 17 # H.264 Constant Rate Factor
|
||||
'-b:v': null # target average bitrate
|
||||
'-vf': 'pad=ceil(iw/2)*2:ceil(ih/2)*2' # ensure output is divisible by 2, recommended for libx264
|
||||
'-tune': 'animation' # encoding tuning film/animation/grain/stillimage/fastdecode/zerolatency/psnr/ssim
|
||||
# Step 3: Streams Migration
|
||||
# migrate audio and subtitle streams from original
|
||||
# video into the upscaled video
|
||||
migrate_streams:
|
||||
'-hwaccel': auto # automatically select hardware acceleration method
|
||||
'-y': true
|
||||
input_options: {} # empty dict, expand if necessary
|
||||
output_options:
|
||||
'-map':
|
||||
- '0:v?' # copy video streams
|
||||
- '1:a?' # copy audio streams
|
||||
- '1:s?' # copy subtitle streams
|
||||
- '1:d?' # copy data streams
|
||||
- '1:t?' # copy fonts
|
||||
'-c': copy # copy codec for all streams
|
||||
# '-vf': 'minterpolate=''fps=60''' # minterpolate frame interpolation
|
||||
'-map_metadata': 0 # copy known metadata tags
|
||||
# '-movflags': 'use_metadata_tags' # copy custom/arbitrary metadata tags
|
||||
'-pix_fmt': null
|
||||
'-metadata': 'comment=Upscaled by Video2X'
|
||||
gifski:
|
||||
gifski_path: '%LOCALAPPDATA%\video2x\gifski\win\gifski'
|
||||
# output: null # Destination file to write to
|
||||
# fps: 20 # Animation frames per second (for PNG frames only) [default: 20]
|
||||
fast: false # 3 times faster encoding, but 10% lower quality and bigger file
|
||||
quality: 100 # Lower quality may give smaller file
|
||||
width: null # Maximum width
|
||||
height: null # Maximum height (if width is also set)
|
||||
once: false # Do not loop the GIF
|
||||
nosort: false # Use files exactly in the order given, rather than sorted
|
||||
quiet: false # Do not show a progress bar
|
||||
video2x:
|
||||
video2x_cache_directory: null # default: %TEMP%\video2x, directory where cache files are stored, will be deleted if preserve_frames is not set to true
|
||||
extracted_frame_format: png # png/jpg intermediate file format used for extracted frames during video processing
|
||||
output_file_name_format_string: "{original_file_name}_output{extension}" # format string to use for generating output file names
|
||||
image_output_extension: .png # image output extension during batch processing
|
||||
video_output_extension: .mp4 # video output extension during batch processing
|
||||
preserve_frames: false # if set to true, the cache directory won't be cleaned upon task completion
|
||||
1305
src/video2x_gui.py
1305
src/video2x_gui.py
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"files": ["video2x_gui.ui","video2x_gui.py"]
|
||||
}
|
||||
2988
src/video2x_gui.ui
2988
src/video2x_gui.ui
File diff suppressed because it is too large
Load Diff
@@ -1,444 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Video2X Setup Script
|
||||
Creator: K4YT3X
|
||||
Date Created: November 28, 2018
|
||||
Last Modified: May 30, 2020
|
||||
|
||||
Editor: BrianPetkovsek
|
||||
Editor: SAT3LL
|
||||
|
||||
Description: This script helps installing all dependencies of video2x
|
||||
and generates a configuration for it.
|
||||
|
||||
Installation Details:
|
||||
- ffmpeg: %LOCALAPPDATA%\\video2x\\ffmpeg
|
||||
- waifu2x-caffe: %LOCALAPPDATA%\\video2x\\waifu2x-caffe
|
||||
- waifu2x-cpp-converter: %LOCALAPPDATA%\\video2x\\waifu2x-converter-cpp
|
||||
- waifu2x_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\waifu2x-ncnn-vulkan
|
||||
- srmd_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\srmd-ncnn-vulkan
|
||||
- realsr_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\realsr-ncnn-vulkan
|
||||
- anime4kcpp: %LOCALAPPDATA%\\video2x\\anime4kcpp
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
from datetime import timedelta
|
||||
import argparse
|
||||
import contextlib
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
import time
|
||||
import traceback
|
||||
import urllib
|
||||
import zipfile
|
||||
|
||||
# Some libraries don't come with default Python installation.
|
||||
# Therefore, they will be installed during the Python dependency
|
||||
# installation step and imported later in the script.
|
||||
|
||||
SETUP_VERSION = '2.2.1'
|
||||
|
||||
# global static variables
|
||||
LOCALAPPDATA = pathlib.Path(os.getenv('localappdata'))
|
||||
DRIVER_OPTIONS = ['all',
|
||||
'ffmpeg',
|
||||
'gifski',
|
||||
'waifu2x_caffe',
|
||||
'waifu2x_converter_cpp',
|
||||
'waifu2x_ncnn_vulkan',
|
||||
'srmd_ncnn_vulkan',
|
||||
'realsr_ncnn_vulkan',
|
||||
'anime4kcpp']
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
""" parse command line arguments
|
||||
"""
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument('-d', '--driver', help='driver to download and configure', choices=DRIVER_OPTIONS, default='all')
|
||||
parser.add_argument('-u', '--uninstall', help='uninstall Video2X dependencies from default location', action='store_true')
|
||||
# parse arguments
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
class Video2xSetup:
|
||||
""" install dependencies for video2x video enlarger
|
||||
|
||||
This library is meant to be executed as a stand-alone
|
||||
script. All files will be installed under %LOCALAPPDATA%\\video2x.
|
||||
"""
|
||||
|
||||
def __init__(self, driver, download_python_modules):
|
||||
self.driver = driver
|
||||
self.download_python_modules = download_python_modules
|
||||
self.trash = []
|
||||
|
||||
def run(self):
|
||||
# regardless of which driver to install
|
||||
# always ensure Python modules are installed and up-to-date
|
||||
if self.download_python_modules:
|
||||
print('\nInstalling Python libraries')
|
||||
self._install_python_requirements()
|
||||
|
||||
# if all drivers are to be installed
|
||||
if self.driver == 'all':
|
||||
DRIVER_OPTIONS.remove('all')
|
||||
for driver in DRIVER_OPTIONS:
|
||||
getattr(self, f'_install_{driver}')()
|
||||
|
||||
# install only the selected driver
|
||||
else:
|
||||
getattr(self, f'_install_{self.driver}')()
|
||||
|
||||
print('\nCleaning up temporary files')
|
||||
self._cleanup()
|
||||
|
||||
def _install_python_requirements(self):
|
||||
""" Read requirements.txt and return its content
|
||||
"""
|
||||
pip_install('requirements.txt')
|
||||
|
||||
def _cleanup(self):
|
||||
""" Cleanup all the temp files downloaded
|
||||
"""
|
||||
for file in self.trash:
|
||||
try:
|
||||
if file.is_dir():
|
||||
print(f'Deleting directory: {file}')
|
||||
shutil.rmtree(file)
|
||||
else:
|
||||
print(f'Deleting file: {file}')
|
||||
file.unlink()
|
||||
except Exception:
|
||||
print(f'Error deleting: {file}')
|
||||
traceback.print_exc()
|
||||
|
||||
def _install_ffmpeg(self):
|
||||
""" Install FFMPEG
|
||||
"""
|
||||
print('\nInstalling FFmpeg')
|
||||
|
||||
latest_release = 'https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-latest-win64-static.zip'
|
||||
|
||||
ffmpeg_zip = download(latest_release, tempfile.gettempdir())
|
||||
self.trash.append(ffmpeg_zip)
|
||||
|
||||
with zipfile.ZipFile(ffmpeg_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
||||
|
||||
def _install_gifski(self):
|
||||
print('\nInstalling Gifski')
|
||||
import requests
|
||||
|
||||
# Get latest release of Gifski via Github API
|
||||
latest_release = requests.get('https://api.github.com/repos/ImageOptim/gifski/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'gifski-.*\.tar\.xz', a['browser_download_url']):
|
||||
gifski_tar_gz = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(gifski_tar_gz)
|
||||
|
||||
# extract and rename
|
||||
with tarfile.open(gifski_tar_gz) as archive:
|
||||
archive.extractall(LOCALAPPDATA / 'video2x' / 'gifski')
|
||||
|
||||
def _install_waifu2x_caffe(self):
|
||||
""" Install waifu2x_caffe
|
||||
"""
|
||||
print('\nInstalling waifu2x-caffe')
|
||||
import requests
|
||||
|
||||
# Get latest release of waifu2x-caffe via GitHub API
|
||||
latest_release = requests.get('https://api.github.com/repos/lltcggie/waifu2x-caffe/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if 'waifu2x-caffe.zip' in a['browser_download_url']:
|
||||
waifu2x_caffe_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(waifu2x_caffe_zip)
|
||||
|
||||
with zipfile.ZipFile(waifu2x_caffe_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
||||
|
||||
def _install_waifu2x_converter_cpp(self):
|
||||
""" Install waifu2x_caffe
|
||||
"""
|
||||
print('\nInstalling waifu2x-converter-cpp')
|
||||
import requests
|
||||
|
||||
# Get latest release of waifu2x-caffe via GitHub API
|
||||
latest_release = requests.get('https://api.github.com/repos/DeadSix27/waifu2x-converter-cpp/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'waifu2x-DeadSix27-win64_v[0-9]*\.zip', a['browser_download_url']):
|
||||
waifu2x_converter_cpp_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(waifu2x_converter_cpp_zip)
|
||||
|
||||
with zipfile.ZipFile(waifu2x_converter_cpp_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp')
|
||||
|
||||
def _install_waifu2x_ncnn_vulkan(self):
|
||||
""" Install waifu2x-ncnn-vulkan
|
||||
"""
|
||||
print('\nInstalling waifu2x-ncnn-vulkan')
|
||||
import requests
|
||||
|
||||
# Get latest release of waifu2x-ncnn-vulkan via Github API
|
||||
latest_release = requests.get('https://api.github.com/repos/nihui/waifu2x-ncnn-vulkan/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'waifu2x-ncnn-vulkan-\d*-windows\.zip', a['browser_download_url']):
|
||||
waifu2x_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(waifu2x_ncnn_vulkan_zip)
|
||||
|
||||
# extract and rename
|
||||
waifu2x_ncnn_vulkan_directory = LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan'
|
||||
with zipfile.ZipFile(waifu2x_ncnn_vulkan_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
||||
|
||||
# if directory already exists, remove it
|
||||
if waifu2x_ncnn_vulkan_directory.exists():
|
||||
shutil.rmtree(waifu2x_ncnn_vulkan_directory)
|
||||
|
||||
# rename the newly extracted directory
|
||||
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(waifu2x_ncnn_vulkan_directory)
|
||||
|
||||
def _install_srmd_ncnn_vulkan(self):
|
||||
""" Install srmd-ncnn-vulkan
|
||||
"""
|
||||
print('\nInstalling srmd-ncnn-vulkan')
|
||||
import requests
|
||||
|
||||
# Get latest release of srmd-ncnn-vulkan via Github API
|
||||
latest_release = requests.get('https://api.github.com/repos/nihui/srmd-ncnn-vulkan/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'srmd-ncnn-vulkan-\d*-windows\.zip', a['browser_download_url']):
|
||||
srmd_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(srmd_ncnn_vulkan_zip)
|
||||
|
||||
# extract and rename
|
||||
srmd_ncnn_vulkan_directory = LOCALAPPDATA / 'video2x' / 'srmd-ncnn-vulkan'
|
||||
with zipfile.ZipFile(srmd_ncnn_vulkan_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
||||
|
||||
# if directory already exists, remove it
|
||||
if srmd_ncnn_vulkan_directory.exists():
|
||||
shutil.rmtree(srmd_ncnn_vulkan_directory)
|
||||
|
||||
# rename the newly extracted directory
|
||||
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(srmd_ncnn_vulkan_directory)
|
||||
|
||||
def _install_realsr_ncnn_vulkan(self):
|
||||
""" Install realsr-ncnn-vulkan
|
||||
"""
|
||||
print('\nInstalling realsr-ncnn-vulkan')
|
||||
import requests
|
||||
|
||||
# Get latest release of realsr-ncnn-vulkan via Github API
|
||||
latest_release = requests.get('https://api.github.com/repos/nihui/realsr-ncnn-vulkan/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'realsr-ncnn-vulkan-\d*-windows\.zip', a['browser_download_url']):
|
||||
realsr_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(realsr_ncnn_vulkan_zip)
|
||||
|
||||
# extract and rename
|
||||
realsr_ncnn_vulkan_directory = LOCALAPPDATA / 'video2x' / 'realsr-ncnn-vulkan'
|
||||
with zipfile.ZipFile(realsr_ncnn_vulkan_zip) as zipf:
|
||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
||||
|
||||
# if directory already exists, remove it
|
||||
if realsr_ncnn_vulkan_directory.exists():
|
||||
shutil.rmtree(realsr_ncnn_vulkan_directory)
|
||||
|
||||
# rename the newly extracted directory
|
||||
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(realsr_ncnn_vulkan_directory)
|
||||
|
||||
def _install_anime4kcpp(self):
|
||||
""" Install Anime4KCPP
|
||||
"""
|
||||
print('\nInstalling Anime4KCPP')
|
||||
|
||||
import patoolib
|
||||
import requests
|
||||
|
||||
# get latest release of Anime4KCPP via Github API
|
||||
# at the time of writing this portion, Anime4KCPP doesn't yet have a stable release
|
||||
# therefore releases/latest won't work
|
||||
latest_release = requests.get('https://api.github.com/repos/TianZerL/Anime4KCPP/releases/latest').json()
|
||||
|
||||
for a in latest_release['assets']:
|
||||
if re.search(r'Anime4KCPP_CLI-.*-Win64-msvc\.7z', a['browser_download_url']):
|
||||
anime4kcpp_7z = download(a['browser_download_url'], tempfile.gettempdir())
|
||||
self.trash.append(anime4kcpp_7z)
|
||||
|
||||
# if running in PyInstaller, add sys._MEIPASS\7z to path
|
||||
# this directory contains 7za.exe and its DLL files
|
||||
with contextlib.suppress(AttributeError):
|
||||
os.environ['PATH'] += f';{sys._MEIPASS}\\7z'
|
||||
|
||||
# (LOCALAPPDATA / 'video2x' / 'anime4kcpp').mkdir(parents=True, exist_ok=True)
|
||||
# pyunpack.Archive(anime4kcpp_7z).extractall(LOCALAPPDATA / 'video2x' / 'anime4kcpp')
|
||||
if (LOCALAPPDATA / 'video2x' / 'anime4kcpp').exists():
|
||||
shutil.rmtree(LOCALAPPDATA / 'video2x' / 'anime4kcpp')
|
||||
patoolib.extract_archive(str(anime4kcpp_7z), outdir=str(LOCALAPPDATA / 'video2x' / 'anime4kcpp'))
|
||||
|
||||
|
||||
def download(url, save_path, chunk_size=4096):
|
||||
""" Download file to local with requests library
|
||||
"""
|
||||
from tqdm import tqdm
|
||||
import requests
|
||||
|
||||
save_path = pathlib.Path(save_path)
|
||||
|
||||
# create target folder if it doesn't exist
|
||||
save_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# create requests stream for steaming file
|
||||
stream = requests.get(url, stream=True, allow_redirects=True)
|
||||
|
||||
# get file name
|
||||
file_name = None
|
||||
if 'content-disposition' in stream.headers:
|
||||
disposition = stream.headers['content-disposition']
|
||||
with contextlib.suppress(IndexError):
|
||||
file_name = re.findall("filename=(.+)", disposition)[0].strip('"')
|
||||
|
||||
if file_name is None:
|
||||
# output_file = f'{save_path}\\{stream.url.split("/")[-1]}'
|
||||
output_file = save_path / stream.url.split('/')[-1]
|
||||
else:
|
||||
output_file = save_path / file_name
|
||||
|
||||
# decode url encoding
|
||||
output_file = pathlib.Path(urllib.parse.unquote(str(output_file)))
|
||||
|
||||
# get total size for progress bar if provided in headers
|
||||
total_size = 0
|
||||
if 'content-length' in stream.headers:
|
||||
total_size = int(stream.headers['content-length'])
|
||||
|
||||
# print download information summary
|
||||
print(f'Downloading: {url}')
|
||||
print(f'Total size: {total_size}')
|
||||
print(f'Chunk size: {chunk_size}')
|
||||
print(f'Saving to: {output_file}')
|
||||
|
||||
# Write content into file
|
||||
with open(output_file, 'wb') as output:
|
||||
with tqdm(total=total_size, ascii=True) as progress_bar:
|
||||
for chunk in stream.iter_content(chunk_size=chunk_size):
|
||||
if chunk:
|
||||
output.write(chunk)
|
||||
progress_bar.update(len(chunk))
|
||||
|
||||
# return the full path of saved file
|
||||
return output_file
|
||||
|
||||
|
||||
def pip_install(file):
|
||||
""" Install python package via python pip module
|
||||
|
||||
pip.main() is not available after pip 9.0.1, thus
|
||||
pip module is not used in this case.
|
||||
"""
|
||||
return subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', '-r', file]).returncode
|
||||
|
||||
|
||||
if __name__ != '__main__':
|
||||
raise ImportError('video2x_setup cannot be imported')
|
||||
|
||||
try:
|
||||
# set default exit code
|
||||
EXIT_CODE = 0
|
||||
|
||||
# get start time
|
||||
start_time = time.time()
|
||||
|
||||
# check platform
|
||||
if platform.system() != 'Windows':
|
||||
print('This script is currently only compatible with Windows')
|
||||
EXIT_CODE = 1
|
||||
sys.exit(1)
|
||||
|
||||
# parse command line arguments
|
||||
args = parse_arguments()
|
||||
print('Video2X Setup Script')
|
||||
print(f'Version: {SETUP_VERSION}')
|
||||
|
||||
# uninstall video2x dependencies
|
||||
if args.uninstall:
|
||||
if input('Are you sure you want to uninstall all Video2X dependencies? [y/N]: ').lower() == 'y':
|
||||
try:
|
||||
print(f'Removing: {LOCALAPPDATA / "video2x"}')
|
||||
shutil.rmtree(LOCALAPPDATA / 'video2x')
|
||||
print('Successfully uninstalled all dependencies')
|
||||
except FileNotFoundError:
|
||||
print(f'Dependency folder does not exist: {LOCALAPPDATA / "video2x"}')
|
||||
else:
|
||||
print('Uninstallation aborted')
|
||||
|
||||
# run installation
|
||||
else:
|
||||
# do not install pip modules if script
|
||||
# is packaged in exe format
|
||||
download_python_modules = True
|
||||
if sys.argv[0].endswith('.exe'):
|
||||
print('\nScript is packaged as exe, skipping pip module download')
|
||||
download_python_modules = False
|
||||
|
||||
# create setup install instance and run installer
|
||||
setup = Video2xSetup(args.driver, download_python_modules)
|
||||
setup.run()
|
||||
|
||||
print('\nScript finished successfully')
|
||||
|
||||
# let SystemExit signals pass through
|
||||
except SystemExit as e:
|
||||
raise e
|
||||
|
||||
# if PermissionError is raised
|
||||
# user needs to run this with higher privilege
|
||||
except PermissionError:
|
||||
traceback.print_exc()
|
||||
print('You might have insufficient privilege for this script to run')
|
||||
print('Try running this script with Administrator privileges')
|
||||
EXIT_CODE = 1
|
||||
|
||||
# for any exception in the script
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
print('An error has occurred')
|
||||
print('Video2X Automatic Setup has failed')
|
||||
|
||||
# in case of a failure, try cleaning up temp files
|
||||
try:
|
||||
setup._cleanup()
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
print('An error occurred while trying to cleanup files')
|
||||
|
||||
EXIT_CODE = 1
|
||||
|
||||
# regardless if script finishes successfully or not
|
||||
# print script execution summary
|
||||
finally:
|
||||
print('Script finished')
|
||||
print(f'Time taken: {timedelta(seconds=round(time.time() - start_time))}')
|
||||
|
||||
# if the program is launched as an Windows PE file
|
||||
# it might be launched from double clicking
|
||||
# pause the window before it closes automatically
|
||||
if sys.argv[0].endswith('.exe'):
|
||||
input('Press [ENTER] to exit script')
|
||||
|
||||
sys.exit(EXIT_CODE)
|
||||
@@ -1,237 +0,0 @@
|
||||
#!/usr/bin/bash -e
|
||||
# Name: Video2X Setup Script (Ubuntu)
|
||||
# Creator: K4YT3X
|
||||
# Date Created: June 5, 2020
|
||||
# Last Modified: July 25, 2020
|
||||
|
||||
# help message if input is incorrect of if -h/--help is specified
|
||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ "$#" -gt 2 ]; then
|
||||
echo "usage: $0 INSTALLATION_PATH TEMP"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# set intallation path if specified
|
||||
if [ ! -z "$1" ]; then
|
||||
export INSTALLATION_PATH=$1
|
||||
else
|
||||
export INSTALLATION_PATH="$HOME/.local/share"
|
||||
fi
|
||||
|
||||
# set temp directory location if specified
|
||||
if [ ! -z "$2" ]; then
|
||||
export TEMP=$2
|
||||
else
|
||||
export TEMP="/tmp/video2x"
|
||||
fi
|
||||
|
||||
# environment variables
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
# install basic utilities and add PPAs
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends apt-utils software-properties-common
|
||||
|
||||
# add PPAs and sources
|
||||
add-apt-repository -y ppa:apt-fast/stable
|
||||
add-apt-repository -y ppa:graphics-drivers/ppa
|
||||
apt-get install -y --no-install-recommends apt-fast
|
||||
apt-fast update
|
||||
|
||||
# install runtime packages
|
||||
apt-fast install -y --no-install-recommends ffmpeg libmagic1 nvidia-cuda-toolkit nvidia-driver-440 python3.8
|
||||
|
||||
# install compilation packages
|
||||
apt-fast install -y --no-install-recommends git-core curl wget ca-certificates gnupg2 python3-dev python3-pip python3-setuptools python3-wheel
|
||||
|
||||
# add Nvidia sources
|
||||
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add -
|
||||
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" >/etc/apt/sources.list.d/nvidia-ml.list
|
||||
apt-fast update
|
||||
|
||||
# install python3 packages
|
||||
git clone --recurse-submodules --progress https://github.com/k4yt3x/video2x.git --depth=1 $INSTALLATION_PATH/video2x
|
||||
python3.8 -m pip install -U pip
|
||||
python3.8 -m pip install -U -r $INSTALLATION_PATH/video2x/src/requirements.txt
|
||||
mkdir -v -p $INSTALLATION_PATH/video2x/src/dependencies
|
||||
|
||||
# install gifski
|
||||
apt-fast install -y --no-install-recommends cargo
|
||||
cargo install gifski
|
||||
|
||||
# install waifu2x-caffe
|
||||
apt-fast install -y --no-install-recommends autoconf build-essential cmake gcc-8 libatlas-base-dev libboost-atomic-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-iostreams-dev libboost-python-dev libboost-system-dev libboost-thread-dev libcudnn7 libcudnn7-dev libgflags-dev libgoogle-glog-dev libhdf5-dev libleveldb-dev liblmdb-dev libopencv-dev libprotobuf-dev libsnappy-dev protobuf-compiler python-numpy texinfo yasm zlib1g-dev
|
||||
|
||||
git clone --recurse-submodules --depth=1 --progress --recurse-submodules https://github.com/nagadomi/waifu2x-caffe-ubuntu.git $TEMP/waifu2x-caffe-ubuntu
|
||||
git clone --recurse-submodules --progress --depth=1 https://github.com/nagadomi/caffe.git $TEMP/waifu2x-caffe-ubuntu/caffe
|
||||
|
||||
export CC=/usr/bin/gcc-8
|
||||
export CXX=/usr/bin/g++-8
|
||||
mkdir -v -p $TEMP/waifu2x-caffe-ubuntu/build
|
||||
cd $TEMP/waifu2x-caffe-ubuntu/build
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
|
||||
make -j$(nproc) install
|
||||
|
||||
mv -v /tmp/video2x/waifu2x-caffe-ubuntu/bin $INSTALLATION_PATH/video2x/src/dependencies/waifu2x-caffe
|
||||
mv -v /tmp/video2x/waifu2x-caffe-ubuntu/build/waifu2x-caffe $INSTALLATION_PATH/video2x/src/dependencies/waifu2x-caffe/waifu2x-caffe
|
||||
|
||||
# install waifu2x-converter-cpp
|
||||
apt-fast install -y --no-install-recommends build-essential cmake libopencv-dev beignet-opencl-icd mesa-opencl-icd nvidia-cuda-toolkit ocl-icd-opencl-dev opencl-headers
|
||||
git clone --recurse-submodules --depth=1 --progress https://github.com/DeadSix27/waifu2x-converter-cpp $TEMP/waifu2x-converter-cpp
|
||||
mkdir -v $TEMP/waifu2x-converter-cpp/build
|
||||
cd $TEMP/waifu2x-converter-cpp/build
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
ldconfig
|
||||
mv -v $TEMP/waifu2x-converter-cpp/build $INSTALLATION_PATH/video2x/src/dependencies/waifu2x-converter-cpp
|
||||
mv -v $TEMP/waifu2x-converter-cpp/models_rgb $INSTALLATION_PATH/video2x/src/dependencies/waifu2x-converter-cpp/models_rgb
|
||||
|
||||
# install waifu2x-ncnn-vulkan
|
||||
# download libvulkan1
|
||||
apt-fast install -y --no-install-recommends libvulkan1 unzip jq
|
||||
|
||||
# get latest release JSON as a string
|
||||
echo "Fetching latest waifu2x-ncnn-vulkan release information using GitHub API"
|
||||
waifu2x_ncnn_vulkan_latest_release=$(curl -s https://api.github.com/repos/nihui/waifu2x-ncnn-vulkan/releases/latest)
|
||||
|
||||
# count the number of assets in this release
|
||||
assets=$(echo "$waifu2x_ncnn_vulkan_latest_release" | jq -r '.assets | length')
|
||||
|
||||
# iterate through each of the assets and see if the name of the asset matches what we're looking for
|
||||
for i in $(seq $assets $END); do
|
||||
if echo "$waifu2x_ncnn_vulkan_latest_release" | jq -r ".assets["$(($i - 1))"].name" | egrep "^waifu2x-ncnn-vulkan-[0-9]*-linux\.zip$"; then
|
||||
download_link=$(echo "$waifu2x_ncnn_vulkan_latest_release" | jq -r ".assets["$(($i - 1))"].browser_download_url")
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# check if download_link variable is set
|
||||
if [ -z "$download_link" ]; then
|
||||
echo "$waifu2x_ncnn_vulkan_latest_release"
|
||||
echo "Error: unable to find waifu2x-ncnn-vulkan download link or GitHub API rate limit exceeded"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
waifu2x_ncnn_vulkan_zip="$TEMP/waifu2x-ncnn-vulkan-linux.zip"
|
||||
echo "Downloading $download_link to $waifu2x_ncnn_vulkan_zip"
|
||||
wget "$download_link" -O "$waifu2x_ncnn_vulkan_zip"
|
||||
unzip "$waifu2x_ncnn_vulkan_zip" -d $TEMP/waifu2x-ncnn-vulkan
|
||||
mv -v $TEMP/waifu2x-ncnn-vulkan/waifu2x-ncnn-vulkan-*-linux $INSTALLATION_PATH/video2x/src/dependencies/waifu2x-ncnn-vulkan
|
||||
|
||||
# install srmd-ncnn-vulkan
|
||||
# download libvulkan1
|
||||
apt-fast install -y --no-install-recommends libvulkan1 unzip jq
|
||||
|
||||
# get latest release JSON as a string
|
||||
echo "Fetching latest srmd-ncnn-vulkan release information using GitHub API"
|
||||
srmd_ncnn_vulkan_latest_release=$(curl -s https://api.github.com/repos/nihui/srmd-ncnn-vulkan/releases/latest)
|
||||
|
||||
# count the number of assets in this release
|
||||
assets=$(echo "$srmd_ncnn_vulkan_latest_release" | jq -r '.assets | length')
|
||||
|
||||
# iterate through each of the assets and see if the name of the asset matches what we're looking for
|
||||
for i in $(seq $assets $END); do
|
||||
if echo "$srmd_ncnn_vulkan_latest_release" | jq -r ".assets["$(($i - 1))"].name" | egrep "^srmd-ncnn-vulkan-[0-9]*-linux\.zip$"; then
|
||||
download_link=$(echo "$srmd_ncnn_vulkan_latest_release" | jq -r ".assets["$(($i - 1))"].browser_download_url")
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# check if download_link variable is set
|
||||
if [ -z "$download_link" ]; then
|
||||
echo "$srmd_ncnn_vulkan_latest_release"
|
||||
echo "Error: unable to find srmd-ncnn-vulkan download link or GitHub API rate limit exceeded"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
srmd_ncnn_vulkan_zip="$TEMP/srmd-ncnn-vulkan-linux.zip"
|
||||
echo "Downloading $download_link to $srmd_ncnn_vulkan_zip"
|
||||
wget "$download_link" -O "$srmd_ncnn_vulkan_zip"
|
||||
unzip "$srmd_ncnn_vulkan_zip" -d $TEMP/srmd-ncnn-vulkan
|
||||
mv -v $TEMP/srmd-ncnn-vulkan/srmd-ncnn-vulkan-*-linux $INSTALLATION_PATH/video2x/src/dependencies/srmd-ncnn-vulkan
|
||||
|
||||
# install realsr-ncnn-vulkan
|
||||
# download libvulkan1
|
||||
apt-fast install -y --no-install-recommends libvulkan1 unzip jq
|
||||
|
||||
# get latest release JSON as a string
|
||||
echo "Fetching latest realsr-ncnn-vulkan release information using GitHub API"
|
||||
realsr_ncnn_vulkan_latest_release=$(curl -s https://api.github.com/repos/nihui/realsr-ncnn-vulkan/releases/latest)
|
||||
|
||||
# count the number of assets in this release
|
||||
assets=$(echo "$realsr_ncnn_vulkan_latest_release" | jq -r '.assets | length')
|
||||
|
||||
# iterate through each of the assets and see if the name of the asset matches what we're looking for
|
||||
for i in $(seq $assets $END); do
|
||||
if echo "$realsr_ncnn_vulkan_latest_release" | jq -r ".assets["$(($i - 1))"].name" | egrep "^realsr-ncnn-vulkan-[0-9]*-linux\.zip$"; then
|
||||
download_link=$(echo "$realsr_ncnn_vulkan_latest_release" | jq -r ".assets["$(($i - 1))"].browser_download_url")
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# check if download_link variable is set
|
||||
if [ -z "$download_link" ]; then
|
||||
echo "$realsr_ncnn_vulkan_latest_release"
|
||||
echo "Error: unable to find realsr-ncnn-vulkan download link or GitHub API rate limit exceeded"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
realsr_ncnn_vulkan_zip="$TEMP/realsr-ncnn-vulkan-linux.zip"
|
||||
echo "Downloading $download_link to $realsr_ncnn_vulkan_zip"
|
||||
wget "$download_link" -O "$realsr_ncnn_vulkan_zip"
|
||||
unzip "$realsr_ncnn_vulkan_zip" -d $TEMP/realsr-ncnn-vulkan
|
||||
mv -v $TEMP/realsr-ncnn-vulkan/realsr-ncnn-vulkan-*-linux $INSTALLATION_PATH/video2x/src/dependencies/realsr-ncnn-vulkan
|
||||
|
||||
# install anime4kcpp
|
||||
#apt-fast install -y --no-install-recommends build-essential cmake libopencv-dev beignet-opencl-icd mesa-opencl-icd ocl-icd-opencl-dev opencl-headers
|
||||
#git clone --recurse-submodules --depth=1 --progress https://github.com/TianZerL/Anime4KCPP.git $TEMP/anime4kcpp
|
||||
#mkdir -v $TEMP/anime4kcpp/build
|
||||
#cd $TEMP/anime4kcpp/CLI/build
|
||||
#cmake -DBuild_GUI=OFF ..
|
||||
#make -j$(nproc)
|
||||
#mv -v $TEMP/anime4kcpp/build $INSTALLATION_PATH/video2x/src/dependencies/anime4kcpp
|
||||
#mv -v $TEMP/anime4kcpp/models_rgb $INSTALLATION_PATH/video2x/src/dependencies/anime4kcpp/models_rgb
|
||||
|
||||
# rewrite config file values
|
||||
python3.8 - <<EOF
|
||||
import yaml
|
||||
import os
|
||||
|
||||
|
||||
INSTALLATION_PATH = os.environ['INSTALLATION_PATH']
|
||||
|
||||
with open('{}/video2x/src/video2x.yaml'.format(INSTALLATION_PATH), 'r') as template:
|
||||
template_dict = yaml.load(template, Loader=yaml.FullLoader)
|
||||
template.close()
|
||||
|
||||
template_dict['ffmpeg']['ffmpeg_path'] = '/usr/bin'
|
||||
template_dict['gifski']['gifski_path'] = '/root/.cargo/bin/gifski'
|
||||
template_dict['waifu2x_caffe']['path'] = '{}/video2x/src/dependencies/waifu2x-caffe/waifu2x-caffe'.format(INSTALLATION_PATH)
|
||||
template_dict['waifu2x_converter_cpp']['path'] = '{}/video2x/src/dependencies/waifu2x-converter-cpp/waifu2x-converter-cpp'.format(INSTALLATION_PATH)
|
||||
template_dict['waifu2x_ncnn_vulkan']['path'] = '{}/video2x/src/dependencies/waifu2x-ncnn-vulkan/waifu2x-ncnn-vulkan'.format(INSTALLATION_PATH)
|
||||
template_dict['srmd_ncnn_vulkan']['path'] = '{}/video2x/src/dependencies/srmd-ncnn-vulkan/srmd-ncnn-vulkan'.format(INSTALLATION_PATH)
|
||||
template_dict['realsr_ncnn_vulkan']['path'] = '{}/video2x/src/dependencies/realsr-ncnn-vulkan/realsr-ncnn-vulkan'.format(INSTALLATION_PATH)
|
||||
template_dict['anime4kcpp']['path'] = '{}/video2x/src/dependencies/anime4kcpp/anime4kcpp'.format(INSTALLATION_PATH)
|
||||
|
||||
# write configuration into file
|
||||
with open('{}/video2x/src/video2x.yaml'.format(INSTALLATION_PATH), 'w') as config:
|
||||
yaml.dump(template_dict, config)
|
||||
EOF
|
||||
|
||||
# clean up temp directory
|
||||
# purge default utilities
|
||||
# apt-get purge -y git-core curl wget ca-certificates gnupg2 python3-dev python3-pip python3-setuptools
|
||||
|
||||
# purge waifu2x-caffe build dependencies
|
||||
# apt-get purge -y autoconf build-essential cmake gcc-8 libatlas-base-dev libboost-atomic-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-iostreams-dev libboost-python-dev libboost-system-dev libboost-thread-dev libcudnn7 libcudnn7-dev libgflags-dev libgoogle-glog-dev libhdf5-dev libleveldb-dev liblmdb-dev libopencv-dev libprotobuf-dev libsnappy-dev protobuf-compiler python-numpy texinfo yasm zlib1g-dev
|
||||
|
||||
# purge waifu2x-converter-cpp build dependencies
|
||||
# apt-get purge -y libopencv-dev ocl-icd-opencl-dev
|
||||
|
||||
# purge waifu2x/srmd/realsr-ncnn-vulkan build dependencies
|
||||
# apt-get purge -y unzip jq
|
||||
|
||||
# run autoremove and purge all unused packages
|
||||
# apt-get autoremove --purge -y
|
||||
|
||||
# remove temp directory
|
||||
rm -vrf $TEMP
|
||||
@@ -1,131 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Anime4KCPP Driver
|
||||
Author: K4YT3X
|
||||
Date Created: May 3, 2020
|
||||
Last Modified: September 1, 2020
|
||||
|
||||
Description: This class is a high-level wrapper
|
||||
for Anime4KCPP.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class WrapperMain:
|
||||
""" Anime4K CPP wrapper
|
||||
"""
|
||||
|
||||
def __init__(self, driver_settings):
|
||||
self.driver_settings = driver_settings
|
||||
self.print_lock = threading.Lock()
|
||||
|
||||
@staticmethod
|
||||
def zero_to_one_float(value):
|
||||
value = float(value)
|
||||
if value < 0.0 or value > 1.0:
|
||||
raise argparse.ArgumentTypeError(f'{value} is not between 0.0 and 1.0')
|
||||
return value
|
||||
|
||||
@staticmethod
|
||||
def parse_arguments(arguments):
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
parser.error = lambda message: (_ for _ in ()).throw(AttributeError(message))
|
||||
parser.add_argument('--help', action='help', help='show this help message and exit')
|
||||
parser.add_argument('-i', '--input', type=str, help=argparse.SUPPRESS) # help='File for loading')
|
||||
parser.add_argument('-o', '--output', type=str, help=argparse.SUPPRESS) # help='File for outputting')
|
||||
parser.add_argument('-p', '--passes', type=int, help='Passes for processing')
|
||||
parser.add_argument('-n', '--pushColorCount', type=int, help='Limit the number of color pushes')
|
||||
parser.add_argument('-c', '--strengthColor', type=WrapperMain.zero_to_one_float, help='Strength for pushing color,range 0 to 1,higher for thinner')
|
||||
parser.add_argument('-g', '--strengthGradient', type=WrapperMain.zero_to_one_float, help='Strength for pushing gradient,range 0 to 1,higher for sharper')
|
||||
parser.add_argument('-z', '--zoomFactor', type=float, help='zoom factor for resizing')
|
||||
parser.add_argument('-t', '--threads', type=int, help='Threads count for video processing')
|
||||
parser.add_argument('-f', '--fastMode', action='store_true', help='Faster but maybe low quality')
|
||||
parser.add_argument('-v', '--videoMode', action='store_true', help='Video process')
|
||||
parser.add_argument('-s', '--preview', action='store_true', help='Preview image')
|
||||
parser.add_argument('-b', '--preprocessing', action='store_true', help='Enable pre processing')
|
||||
parser.add_argument('-a', '--postprocessing', action='store_true', help='Enable post processing')
|
||||
parser.add_argument('-r', '--preFilters', type=int, help='Enhancement filter, only working when preProcessing is true,there are 5 options by binary:Median blur=0000001, Mean blur=0000010, CAS Sharpening=0000100, Gaussian blur weak=0001000, Gaussian blur=0010000, Bilateral filter=0100000, Bilateral filter faster=1000000, you can freely combine them, eg: Gaussian blur weak + Bilateral filter = 0001000 | 0100000 = 0101000 = 40(D)')
|
||||
parser.add_argument('-e', '--postFilters', type=int, help='Enhancement filter, only working when postProcessing is true,there are 5 options by binary:Median blur=0000001, Mean blur=0000010, CAS Sharpening=0000100, Gaussian blur weak=0001000, Gaussian blur=0010000, Bilateral filter=0100000, Bilateral filter faster=1000000, you can freely combine them, eg: Gaussian blur weak + Bilateral filter = 0001000 | 0100000 = 0101000 = 40(D), so you can put 40 to enable Gaussian blur weak and Bilateral filter, which also is what I recommend for image that < 1080P, 48 for image that >= 1080P, and for performance I recommend to use 72 for video that < 1080P, 80 for video that >=1080P')
|
||||
parser.add_argument('-q', '--GPUMode', action='store_true', help='Enable GPU acceleration')
|
||||
parser.add_argument('-w', '--CNNMode', action='store_true', help='Enable ACNet')
|
||||
parser.add_argument('-H', '--HDN', action='store_true', help='Enable HDN mode for ACNet')
|
||||
parser.add_argument('-L', '--HDNLevel', type=int, help='Set HDN level')
|
||||
parser.add_argument('-l', '--listGPUs', action='store_true', help='list GPUs')
|
||||
parser.add_argument('-h', '--platformID', type=int, help='Specify the platform ID')
|
||||
parser.add_argument('-d', '--deviceID', type=int, help='Specify the device ID')
|
||||
parser.add_argument('-C', '--codec', type=str, help='Specify the codec for encoding from mp4v(recommended in Windows), dxva(for Windows), avc1(H264, recommended in Linux), vp09(very slow), hevc(not support in Windowds), av01(not support in Windowds) (string [=mp4v])')
|
||||
parser.add_argument('-F', '--forceFps', type=float, help='Set output video fps to the specifying number, 0 to disable')
|
||||
parser.add_argument('-D', '--disableProgress', action='store_true', help='disable progress display')
|
||||
parser.add_argument('-W', '--webVideo', type=str, help='process the video from URL')
|
||||
parser.add_argument('-A', '--alpha', action='store_true', help='preserve the Alpha channel for transparent image')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
self.driver_settings['zoomFactor'] = upscaler.scale_ratio
|
||||
self.driver_settings['threads'] = upscaler.processes
|
||||
|
||||
# append FFmpeg path to the end of PATH
|
||||
# Anime4KCPP will then use FFmpeg to migrate audio tracks
|
||||
os.environ['PATH'] += f';{upscaler.ffmpeg_settings["ffmpeg_path"]}'
|
||||
|
||||
def upscale(self, input_file, output_file):
|
||||
"""This is the core function for WAIFU2X class
|
||||
|
||||
Arguments:
|
||||
input_file {string} -- source directory path
|
||||
output_file {string} -- output directory path
|
||||
width {int} -- output video width
|
||||
height {int} -- output video height
|
||||
"""
|
||||
|
||||
# change the working directory to the binary's parent directory
|
||||
# so the binary can find shared object files and other files
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# overwrite config file settings
|
||||
self.driver_settings['input'] = input_file
|
||||
self.driver_settings['output'] = output_file
|
||||
|
||||
# Anime4KCPP will look for Anime4KCPPKernel.cl under the current working directory
|
||||
# change the CWD to its containing directory so it will find it
|
||||
if platform.system() == 'Windows':
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
execute.append(f'-{key}')
|
||||
else:
|
||||
execute.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
execute.append(str(value))
|
||||
|
||||
# return the Popen object of the new process created
|
||||
self.print_lock.acquire()
|
||||
Avalon.debug_info(f'[upscaler] Subprocess {os.getpid()} executing: {shlex.join(execute)}')
|
||||
self.print_lock.release()
|
||||
return subprocess.Popen(execute)
|
||||
@@ -1,287 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Video2X FFmpeg Controller
|
||||
Author: K4YT3X
|
||||
Date Created: Feb 24, 2018
|
||||
Last Modified: June 7, 2020
|
||||
|
||||
Description: This class handles all FFmpeg related operations.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import json
|
||||
import pathlib
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class Ffmpeg:
|
||||
"""This class communicates with FFmpeg
|
||||
|
||||
This class deals with FFmpeg. It handles extracting
|
||||
frames, stripping audio, converting images into videos
|
||||
and inserting audio tracks to videos.
|
||||
"""
|
||||
|
||||
def __init__(self, ffmpeg_settings, extracted_frame_format='png'):
|
||||
self.ffmpeg_settings = ffmpeg_settings
|
||||
|
||||
self.ffmpeg_path = pathlib.Path(self.ffmpeg_settings['ffmpeg_path'])
|
||||
self.ffmpeg_binary = self.ffmpeg_path / 'ffmpeg'
|
||||
self.ffmpeg_probe_binary = self.ffmpeg_path / 'ffprobe'
|
||||
|
||||
# video metadata
|
||||
self.extracted_frame_format = extracted_frame_format
|
||||
self.intermediate_file_name = pathlib.Path(self.ffmpeg_settings['intermediate_file_name'])
|
||||
self.pixel_format = self.ffmpeg_settings['extract_frames']['output_options']['-pix_fmt']
|
||||
|
||||
def get_pixel_formats(self):
|
||||
""" Get a dictionary of supported pixel formats
|
||||
|
||||
List all supported pixel formats and their
|
||||
corresponding bit depth.
|
||||
|
||||
Returns:
|
||||
dictionary -- JSON dict of all pixel formats to bit depth
|
||||
"""
|
||||
execute = [
|
||||
self.ffmpeg_probe_binary,
|
||||
'-v',
|
||||
'quiet',
|
||||
'-pix_fmts'
|
||||
]
|
||||
|
||||
# turn elements into str
|
||||
execute = [str(e) for e in execute]
|
||||
|
||||
Avalon.debug_info(f'Executing: {shlex.join(execute)}')
|
||||
|
||||
# initialize dictionary to store pixel formats
|
||||
pixel_formats = {}
|
||||
|
||||
# record all pixel formats into dictionary
|
||||
for line in subprocess.run(execute, check=True, stdout=subprocess.PIPE).stdout.decode().split('\n'):
|
||||
try:
|
||||
pixel_formats[' '.join(line.split()).split()[1]] = int(' '.join(line.split()).split()[3])
|
||||
except (IndexError, ValueError):
|
||||
pass
|
||||
|
||||
# print pixel formats for debugging
|
||||
Avalon.debug_info(str(pixel_formats))
|
||||
|
||||
return pixel_formats
|
||||
|
||||
def probe_file_info(self, input_video):
|
||||
""" Gets input video information
|
||||
|
||||
This method reads input video information
|
||||
using ffprobe in dictionary
|
||||
|
||||
Arguments:
|
||||
input_video {string} -- input video file path
|
||||
|
||||
Returns:
|
||||
dictionary -- JSON text of input video information
|
||||
"""
|
||||
|
||||
# this execution command needs to be hard-coded
|
||||
# since video2x only strictly recignizes this one format
|
||||
execute = [
|
||||
self.ffmpeg_probe_binary,
|
||||
'-v',
|
||||
'quiet',
|
||||
'-print_format',
|
||||
'json',
|
||||
'-show_format',
|
||||
'-show_streams',
|
||||
'-i',
|
||||
input_video
|
||||
]
|
||||
|
||||
# turn elements into str
|
||||
execute = [str(e) for e in execute]
|
||||
|
||||
Avalon.debug_info(f'Executing: {shlex.join(execute)}')
|
||||
json_str = subprocess.run(execute, check=True, stdout=subprocess.PIPE).stdout
|
||||
return json.loads(json_str.decode('utf-8'))
|
||||
|
||||
def extract_frames(self, input_file, extracted_frames):
|
||||
""" extract frames from video or GIF file
|
||||
"""
|
||||
execute = [
|
||||
self.ffmpeg_binary
|
||||
]
|
||||
|
||||
# load general options
|
||||
execute.extend(self._read_configuration(phase='extract_frames'))
|
||||
|
||||
# load input_options
|
||||
execute.extend(self._read_configuration(phase='extract_frames', section='input_options'))
|
||||
|
||||
# specify input file
|
||||
execute.extend([
|
||||
'-i',
|
||||
input_file
|
||||
])
|
||||
|
||||
# load output options
|
||||
execute.extend(self._read_configuration(phase='extract_frames', section='output_options'))
|
||||
|
||||
# specify output file
|
||||
execute.extend([
|
||||
extracted_frames / f'extracted_%0d.{self.extracted_frame_format}'
|
||||
])
|
||||
|
||||
return(self._execute(execute))
|
||||
|
||||
def assemble_video(self, framerate, upscaled_frames):
|
||||
"""Converts images into videos
|
||||
|
||||
This method converts a set of images into a video
|
||||
|
||||
Arguments:
|
||||
framerate {float} -- target video framerate
|
||||
resolution {string} -- target video resolution
|
||||
upscaled_frames {string} -- source images directory
|
||||
"""
|
||||
execute = [
|
||||
self.ffmpeg_binary,
|
||||
'-r',
|
||||
str(framerate)
|
||||
# '-s',
|
||||
# resolution
|
||||
]
|
||||
|
||||
# read other options
|
||||
execute.extend(self._read_configuration(phase='assemble_video'))
|
||||
|
||||
# read input options
|
||||
execute.extend(self._read_configuration(phase='assemble_video', section='input_options'))
|
||||
|
||||
# WORKAROUND FOR WAIFU2X-NCNN-VULKAN
|
||||
# Dev: SAT3LL
|
||||
# rename all .png.png suffixes to .png
|
||||
import re
|
||||
regex = re.compile(r'\.png\.png$', re.IGNORECASE)
|
||||
for frame_name in upscaled_frames.iterdir():
|
||||
(upscaled_frames / frame_name).rename(upscaled_frames / regex.sub('.png', str(frame_name)))
|
||||
# END WORKAROUND
|
||||
|
||||
# append input frames path into command
|
||||
execute.extend([
|
||||
'-i',
|
||||
upscaled_frames / f'extracted_%d.{self.extracted_frame_format}'
|
||||
])
|
||||
|
||||
# read FFmpeg output options
|
||||
execute.extend(self._read_configuration(phase='assemble_video', section='output_options'))
|
||||
|
||||
# specify output file location
|
||||
execute.extend([
|
||||
upscaled_frames / self.intermediate_file_name
|
||||
])
|
||||
|
||||
return(self._execute(execute))
|
||||
|
||||
def migrate_streams(self, input_video, output_video, upscaled_frames):
|
||||
""" Migrates audio tracks and subtitles from input video to output video
|
||||
|
||||
Arguments:
|
||||
input_video {string} -- input video file path
|
||||
output_video {string} -- output video file path
|
||||
upscaled_frames {string} -- directory containing upscaled frames
|
||||
"""
|
||||
execute = [
|
||||
self.ffmpeg_binary
|
||||
]
|
||||
|
||||
# load general options
|
||||
execute.extend(self._read_configuration(phase='migrate_streams'))
|
||||
|
||||
# load input options
|
||||
execute.extend(self._read_configuration(phase='migrate_streams', section='input_options'))
|
||||
|
||||
# load input file names
|
||||
execute.extend([
|
||||
|
||||
# input 1: upscaled intermediate file without sound
|
||||
'-i',
|
||||
upscaled_frames / self.intermediate_file_name,
|
||||
|
||||
# input 2: original video with streams to copy over
|
||||
'-i',
|
||||
input_video
|
||||
])
|
||||
|
||||
# load output options
|
||||
execute.extend(self._read_configuration(phase='migrate_streams', section='output_options'))
|
||||
|
||||
# load output video path
|
||||
execute.extend([
|
||||
output_video
|
||||
])
|
||||
|
||||
return(self._execute(execute))
|
||||
|
||||
def _read_configuration(self, phase, section=None):
|
||||
""" read configuration from JSON
|
||||
|
||||
Read the configurations (arguments) from the JSON
|
||||
configuration file and append them to the end of the
|
||||
FFmpeg command.
|
||||
|
||||
Arguments:
|
||||
execute {list} -- list of arguments to be executed
|
||||
phase {str} -- phase of operation
|
||||
"""
|
||||
|
||||
configuration = []
|
||||
|
||||
# if section is specified, read configurations or keys
|
||||
# from only that section
|
||||
if section:
|
||||
source = self.ffmpeg_settings[phase][section].keys()
|
||||
else:
|
||||
source = self.ffmpeg_settings[phase].keys()
|
||||
|
||||
# for each key in the section's dict
|
||||
for key in source:
|
||||
|
||||
if section:
|
||||
value = self.ffmpeg_settings[phase][section][key]
|
||||
else:
|
||||
value = self.ffmpeg_settings[phase][key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if value is None or value is False or isinstance(value, dict) or value == '':
|
||||
continue
|
||||
|
||||
# if the value is a list, append the same argument and all values
|
||||
elif isinstance(value, list):
|
||||
|
||||
for subvalue in value:
|
||||
configuration.append(key)
|
||||
if value is not True:
|
||||
configuration.append(str(subvalue))
|
||||
|
||||
# otherwise the value is typical
|
||||
else:
|
||||
configuration.append(key)
|
||||
|
||||
# true means key is an option
|
||||
if value is True:
|
||||
continue
|
||||
|
||||
configuration.append(str(value))
|
||||
|
||||
return configuration
|
||||
|
||||
def _execute(self, execute):
|
||||
# turn all list elements into string to avoid errors
|
||||
execute = [str(e) for e in execute]
|
||||
Avalon.debug_info(f'Executing: {shlex.join(execute)}')
|
||||
return subprocess.Popen(execute)
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Gifski Wrapper
|
||||
Creator: K4YT3X
|
||||
Date Created: May 11, 2020
|
||||
Last Modified: June 7, 2020
|
||||
|
||||
Description: High-level wrapper for Gifski.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import pathlib
|
||||
import subprocess
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class Gifski:
|
||||
|
||||
def __init__(self, gifski_settings):
|
||||
self.gifski_settings = gifski_settings
|
||||
|
||||
def make_gif(self, upscaled_frames: pathlib.Path, output_path: pathlib.Path, framerate: float, extracted_frame_format: str) -> subprocess.Popen:
|
||||
execute = [
|
||||
self.gifski_settings['gifski_path'],
|
||||
'-o',
|
||||
output_path,
|
||||
'--fps',
|
||||
int(round(framerate, 0))
|
||||
]
|
||||
|
||||
# load configurations from config file
|
||||
execute.extend(self._load_configuration())
|
||||
|
||||
# append frames location
|
||||
execute.extend([upscaled_frames / f'extracted_*.{extracted_frame_format}'])
|
||||
|
||||
return(self._execute(execute))
|
||||
|
||||
def _load_configuration(self):
|
||||
|
||||
configuration = []
|
||||
|
||||
for key in self.gifski_settings.keys():
|
||||
|
||||
value = self.gifski_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'gifski_path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
configuration.append(f'-{key}')
|
||||
else:
|
||||
configuration.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
configuration.append(str(value))
|
||||
return configuration
|
||||
|
||||
def _execute(self, execute: list) -> subprocess.Popen:
|
||||
# turn all list elements into string to avoid errors
|
||||
execute = [str(e) for e in execute]
|
||||
|
||||
Avalon.debug_info(f'Executing: {execute}')
|
||||
|
||||
return subprocess.Popen(execute)
|
||||
@@ -1,106 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: RealSR NCNN Vulkan Driver
|
||||
Creator: K4YT3X
|
||||
Date Created: May 26, 2020
|
||||
Last Modified: May 26, 2020
|
||||
|
||||
Description: This class is a high-level wrapper
|
||||
for realsr_ncnn_vulkan.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class WrapperMain:
|
||||
"""This class communicates with RealSR NCNN Vulkan engine
|
||||
|
||||
An object will be created for this class, containing information
|
||||
about the binary address and the processing method. When being called
|
||||
by the main program, other detailed information will be passed to
|
||||
the upscale function.
|
||||
"""
|
||||
|
||||
def __init__(self, driver_settings):
|
||||
self.driver_settings = driver_settings
|
||||
self.print_lock = threading.Lock()
|
||||
|
||||
@staticmethod
|
||||
def parse_arguments(arguments):
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
parser.error = lambda message: (_ for _ in ()).throw(AttributeError(message))
|
||||
parser.add_argument('--help', action='help', help='show this help message and exit')
|
||||
parser.add_argument('-v', action='store_true', help='verbose output')
|
||||
parser.add_argument('-i', type=str, help=argparse.SUPPRESS) # help='input image path (jpg/png) or directory')
|
||||
parser.add_argument('-o', type=str, help=argparse.SUPPRESS) # help='output image path (png) or directory')
|
||||
parser.add_argument('-s', type=int, choices=[4], help='upscale ratio')
|
||||
parser.add_argument('-t', type=int, help='tile size (>=32/0=auto)')
|
||||
parser.add_argument('-m', type=str, help='realsr model path')
|
||||
parser.add_argument('-g', type=int, help='gpu device to use')
|
||||
parser.add_argument('-j', type=str, help='thread count for load/proc/save')
|
||||
parser.add_argument('-x', action='store_true', help='enable tta mode')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
self.driver_settings['s'] = int(upscaler.scale_ratio)
|
||||
self.driver_settings['j'] = '{}:{}:{}'.format(upscaler.processes, upscaler.processes, upscaler.processes)
|
||||
|
||||
def upscale(self, input_directory, output_directory):
|
||||
"""This is the core function for RealSR NCNN Vulkan class
|
||||
|
||||
Arguments:
|
||||
input_directory {string} -- source directory path
|
||||
output_directory {string} -- output directory path
|
||||
ratio {int} -- output video ratio
|
||||
"""
|
||||
|
||||
# change the working directory to the binary's parent directory
|
||||
# so the binary can find shared object files and other files
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# overwrite config file settings
|
||||
self.driver_settings['i'] = input_directory
|
||||
self.driver_settings['o'] = output_directory
|
||||
|
||||
# by default, realsr-ncnn-vulkan will look for the models under the current working directory
|
||||
# change the working directory to its containing folder if model directory not specified
|
||||
if self.driver_settings['m'] is None and platform.system() == 'Windows':
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with the binary path as the first element
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
execute.append(f'-{key}')
|
||||
else:
|
||||
execute.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
execute.append(str(value))
|
||||
|
||||
# return the Popen object of the new process created
|
||||
self.print_lock.acquire()
|
||||
Avalon.debug_info(f'[upscaler] Subprocess {os.getpid()} executing: {shlex.join(execute)}')
|
||||
self.print_lock.release()
|
||||
return subprocess.Popen(execute)
|
||||
@@ -1,107 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: SRMD NCNN Vulkan Driver
|
||||
Creator: K4YT3X
|
||||
Date Created: April 26, 2020
|
||||
Last Modified: May 11, 2020
|
||||
|
||||
Description: This class is a high-level wrapper
|
||||
for srmd_ncnn_vulkan.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class WrapperMain:
|
||||
"""This class communicates with SRMD NCNN Vulkan engine
|
||||
|
||||
An object will be created for this class, containing information
|
||||
about the binary address and the processing method. When being called
|
||||
by the main program, other detailed information will be passed to
|
||||
the upscale function.
|
||||
"""
|
||||
|
||||
def __init__(self, driver_settings):
|
||||
self.driver_settings = driver_settings
|
||||
self.print_lock = threading.Lock()
|
||||
|
||||
@staticmethod
|
||||
def parse_arguments(arguments):
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
parser.error = lambda message: (_ for _ in ()).throw(AttributeError(message))
|
||||
parser.add_argument('--help', action='help', help='show this help message and exit')
|
||||
parser.add_argument('-v', action='store_true', help='verbose output')
|
||||
parser.add_argument('-i', type=str, help=argparse.SUPPRESS) # help='input image path (jpg/png) or directory')
|
||||
parser.add_argument('-o', type=str, help=argparse.SUPPRESS) # help='output image path (png) or directory')
|
||||
parser.add_argument('-n', type=int, choices=range(-1, 11), help='denoise level')
|
||||
parser.add_argument('-s', type=int, choices=range(2, 5), help='upscale ratio')
|
||||
parser.add_argument('-t', type=int, help='tile size (>=32)')
|
||||
parser.add_argument('-m', type=str, help='srmd model path')
|
||||
parser.add_argument('-g', type=int, help='gpu device to use')
|
||||
parser.add_argument('-j', type=str, help='thread count for load/proc/save')
|
||||
parser.add_argument('-x', action='store_true', help='enable tta mode')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
self.driver_settings['s'] = int(upscaler.scale_ratio)
|
||||
self.driver_settings['j'] = '{}:{}:{}'.format(upscaler.processes, upscaler.processes, upscaler.processes)
|
||||
|
||||
def upscale(self, input_directory, output_directory):
|
||||
"""This is the core function for SRMD ncnn Vulkan class
|
||||
|
||||
Arguments:
|
||||
input_directory {string} -- source directory path
|
||||
output_directory {string} -- output directory path
|
||||
ratio {int} -- output video ratio
|
||||
"""
|
||||
|
||||
# change the working directory to the binary's parent directory
|
||||
# so the binary can find shared object files and other files
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# overwrite config file settings
|
||||
self.driver_settings['i'] = input_directory
|
||||
self.driver_settings['o'] = output_directory
|
||||
|
||||
# by default, srmd-ncnn-vulkan will look for the models under the current working directory
|
||||
# change the working directory to its containing folder if model directory not specified
|
||||
if self.driver_settings['m'] is None and platform.system() == 'Windows':
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with the binary path as the first element
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
execute.append(f'-{key}')
|
||||
else:
|
||||
execute.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
execute.append(str(value))
|
||||
|
||||
# return the Popen object of the new process created
|
||||
self.print_lock.acquire()
|
||||
Avalon.debug_info(f'[upscaler] Subprocess {os.getpid()} executing: {shlex.join(execute)}')
|
||||
self.print_lock.release()
|
||||
return subprocess.Popen(execute)
|
||||
@@ -1,110 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Waifu2x Caffe Driver
|
||||
Author: K4YT3X
|
||||
Date Created: Feb 24, 2018
|
||||
Last Modified: June 7, 2020
|
||||
|
||||
Description: This class is a high-level wrapper
|
||||
for waifu2x-caffe.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import shlex
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class WrapperMain:
|
||||
"""This class communicates with waifu2x cui engine
|
||||
|
||||
An object will be created for this class, containing information
|
||||
about the binary address and the processing method. When being called
|
||||
by the main program, other detailed information will be passed to
|
||||
the upscale function.
|
||||
"""
|
||||
|
||||
def __init__(self, driver_settings):
|
||||
self.driver_settings = driver_settings
|
||||
self.print_lock = threading.Lock()
|
||||
|
||||
@staticmethod
|
||||
def parse_arguments(arguments):
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
parser.error = lambda message: (_ for _ in ()).throw(AttributeError(message))
|
||||
parser.add_argument('--help', action='help', help='show this help message and exit')
|
||||
parser.add_argument('-t', '--tta', type=int, choices=range(2), help='8x slower and slightly high quality')
|
||||
parser.add_argument('--gpu', type=int, help='gpu device no')
|
||||
parser.add_argument('-b', '--batch_size', type=int, help='input batch size')
|
||||
parser.add_argument('--crop_h', type=int, help='input image split size(height)')
|
||||
parser.add_argument('--crop_w', type=int, help='input image split size(width)')
|
||||
parser.add_argument('-c', '--crop_size', type=int, help='input image split size')
|
||||
parser.add_argument('-d', '--output_depth', type=int, help='output image chaneel depth bit')
|
||||
parser.add_argument('-q', '--output_quality', type=int, help='output image quality')
|
||||
parser.add_argument('-p', '--process', choices=['cpu', 'gpu', 'cudnn'], help='process mode')
|
||||
parser.add_argument('--model_dir', type=str, help='path to custom model directory (don\'t append last / )')
|
||||
parser.add_argument('-h', '--scale_height', type=int, help='custom scale height')
|
||||
parser.add_argument('-w', '--scale_width', type=int, help='custom scale width')
|
||||
parser.add_argument('-s', '--scale_ratio', type=float, help='custom scale ratio')
|
||||
parser.add_argument('-n', '--noise_level', type=int, choices=range(4), help='noise reduction level')
|
||||
parser.add_argument('-m', '--mode', choices=['noise', 'scale', 'noise_scale', 'auto_scale'], help='image processing mode')
|
||||
parser.add_argument('-e', '--output_extention', type=str, help='extention to output image file when output_path is (auto) or input_path is folder')
|
||||
parser.add_argument('-l', '--input_extention_list', type=str, help='extention to input image file when input_path is folder')
|
||||
parser.add_argument('-o', '--output_path', type=str, help=argparse.SUPPRESS) # help='path to output image file (when input_path is folder, output_path must be folder)')
|
||||
parser.add_argument('-i', '--input_path', type=str, help=argparse.SUPPRESS) # help='(required) path to input image file')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
# use scale width and scale height if specified
|
||||
self.driver_settings['scale_ratio'] = upscaler.scale_ratio
|
||||
self.driver_settings['output_extention'] = upscaler.extracted_frame_format
|
||||
|
||||
# bit_depth will be 12 at this point
|
||||
# it will up updated later
|
||||
self.driver_settings['output_depth'] = 12
|
||||
|
||||
def upscale(self, input_directory, output_directory):
|
||||
""" start upscaling process
|
||||
"""
|
||||
|
||||
# change the working directory to the binary's parent directory
|
||||
# so the binary can find shared object files and other files
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# overwrite config file settings
|
||||
self.driver_settings['input_path'] = input_directory
|
||||
self.driver_settings['output_path'] = output_directory
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
execute.append(f'-{key}')
|
||||
else:
|
||||
execute.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
execute.append(str(value))
|
||||
|
||||
# return the Popen object of the new process created
|
||||
self.print_lock.acquire()
|
||||
Avalon.debug_info(f'[upscaler] Subprocess {os.getpid()} executing: {shlex.join(execute)}')
|
||||
self.print_lock.release()
|
||||
return subprocess.Popen(execute)
|
||||
@@ -1,123 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Waifu2x Converter CPP Driver
|
||||
Author: K4YT3X
|
||||
Date Created: February 8, 2019
|
||||
Last Modified: June 13, 2020
|
||||
|
||||
Description: This class is a high-level wrapper
|
||||
for waifu2x-converter-cpp.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import shlex
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class WrapperMain:
|
||||
"""This class communicates with waifu2x cui engine
|
||||
|
||||
An object will be created for this class, containing information
|
||||
about the binary address and the processing method. When being called
|
||||
by the main program, other detailed information will be passed to
|
||||
the upscale function.
|
||||
"""
|
||||
|
||||
def __init__(self, driver_settings):
|
||||
self.driver_settings = driver_settings
|
||||
self.print_lock = threading.Lock()
|
||||
|
||||
@staticmethod
|
||||
def parse_arguments(arguments):
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
parser.error = lambda message: (_ for _ in ()).throw(AttributeError(message))
|
||||
parser.add_argument('--help', action='help', help='show this help message and exit')
|
||||
parser.add_argument('--list-supported-formats', action='store_true', help='dump currently supported format list')
|
||||
parser.add_argument('--list-opencv-formats', action='store_true', help='(deprecated. Use --list-supported-formats) dump opencv supported format list')
|
||||
parser.add_argument('-l', '--list-processor', action='store_true', help='dump processor list')
|
||||
parser.add_argument('-f', '--output-format', choices=['png', 'jpg'], help='The format used when running in recursive/folder mode\nSee --list-supported-formats for a list of supported formats/extensions.')
|
||||
parser.add_argument('-c', '--png-compression', type=int, choices=range(10), help='Set PNG compression level (0-9), 9 = Max compression (slowest & smallest)')
|
||||
parser.add_argument('-q', '--image-quality', type=int, choices=range(-1, 102), help='JPEG & WebP Compression quality (0-101, 0 being smallest size and lowest quality), use 101 for lossless WebP')
|
||||
parser.add_argument('--block-size', type=int, help='block size')
|
||||
parser.add_argument('--disable-gpu', action='store_true', help='disable GPU')
|
||||
parser.add_argument('--force-OpenCL', action='store_true', help='force to use OpenCL on Intel Platform')
|
||||
parser.add_argument('-p', '--processor', type=int, help='set target processor')
|
||||
parser.add_argument('-j', '--jobs', type=int, help='number of threads launching at the same time')
|
||||
parser.add_argument('--model-dir', type=str, help='path to custom model directory (don\'t append last / )')
|
||||
parser.add_argument('--scale-ratio', type=float, help='custom scale ratio')
|
||||
parser.add_argument('--noise-level', type=int, choices=range(4), help='noise reduction level')
|
||||
parser.add_argument('-m', '--mode', choices=['noise', 'scale', 'noise-scale'], help='image processing mode')
|
||||
parser.add_argument('-v', '--log-level', type=int, choices=range(5), help='Set log level')
|
||||
parser.add_argument('-s', '--silent', action='store_true', help='Enable silent mode. (same as --log-level 1)')
|
||||
parser.add_argument('-t', '--tta', type=int, choices=range(2), help='Enable Test-Time Augmentation mode.')
|
||||
parser.add_argument('-g', '--generate-subdir', type=int, choices=range(2), help='Generate sub folder when recursive directory is enabled.')
|
||||
parser.add_argument('-a', '--auto-naming', type=int, choices=range(2), help='Add postfix to output name when output path is not specified.\nSet 0 to disable this.')
|
||||
parser.add_argument('-r', '--recursive-directory', type=int, choices=range(2), help='Search recursively through directories to find more images to process.')
|
||||
parser.add_argument('-o', '--output', type=str, help=argparse.SUPPRESS) # help='path to output image file or directory (you should use the full path)')
|
||||
parser.add_argument('-i', '--input', type=str, help=argparse.SUPPRESS) # help='(required) path to input image file or directory (you should use the full path)')
|
||||
parser.add_argument('--version', action='store_true', help='Displays version information and exits.')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
self.driver_settings['scale-ratio'] = upscaler.scale_ratio
|
||||
self.driver_settings['jobs'] = upscaler.processes
|
||||
self.driver_settings['output-format'] = upscaler.extracted_frame_format.lower()
|
||||
|
||||
def upscale(self, input_directory, output_directory):
|
||||
""" Waifu2x Converter Driver Upscaler
|
||||
This method executes the upscaling of extracted frames.
|
||||
|
||||
Arguments:
|
||||
input_directory {string} -- source directory path
|
||||
output_directory {string} -- output directory path
|
||||
scale_ratio {int} -- frames' scale ratio
|
||||
threads {int} -- number of threads
|
||||
"""
|
||||
|
||||
# change the working directory to the binary's parent directory
|
||||
# so the binary can find shared object files and other files
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# overwrite config file settings
|
||||
self.driver_settings['input'] = input_directory
|
||||
self.driver_settings['output'] = output_directory
|
||||
|
||||
# models_rgb must be specified manually for waifu2x-converter-cpp
|
||||
# if it's not specified in the arguments, create automatically
|
||||
if self.driver_settings['model-dir'] is None:
|
||||
self.driver_settings['model-dir'] = pathlib.Path(self.driver_settings['path']).parent / 'models_rgb'
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
execute.append(f'-{key}')
|
||||
else:
|
||||
execute.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
execute.append(str(value))
|
||||
|
||||
# return the Popen object of the new process created
|
||||
self.print_lock.acquire()
|
||||
Avalon.debug_info(f'[upscaler] Subprocess {os.getpid()} executing: {shlex.join(execute)}')
|
||||
self.print_lock.release()
|
||||
return subprocess.Popen(execute)
|
||||
@@ -1,110 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Name: Waifu2x NCNN Vulkan Driver
|
||||
Creator: SAT3LL
|
||||
Date Created: June 26, 2019
|
||||
Last Modified: May 11, 2020
|
||||
|
||||
Editor: K4YT3X
|
||||
Last Modified: February 22, 2020
|
||||
|
||||
Description: This class is a high-level wrapper
|
||||
for waifu2x_ncnn_vulkan.
|
||||
"""
|
||||
|
||||
# built-in imports
|
||||
import argparse
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
# third-party imports
|
||||
from avalon_framework import Avalon
|
||||
|
||||
|
||||
class WrapperMain:
|
||||
"""This class communicates with waifu2x ncnn vulkan engine
|
||||
|
||||
An object will be created for this class, containing information
|
||||
about the binary address and the processing method. When being called
|
||||
by the main program, other detailed information will be passed to
|
||||
the upscale function.
|
||||
"""
|
||||
|
||||
def __init__(self, driver_settings):
|
||||
self.driver_settings = driver_settings
|
||||
self.print_lock = threading.Lock()
|
||||
|
||||
@staticmethod
|
||||
def parse_arguments(arguments):
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
|
||||
parser.error = lambda message: (_ for _ in ()).throw(AttributeError(message))
|
||||
parser.add_argument('--help', action='help', help='show this help message and exit')
|
||||
parser.add_argument('-v', action='store_true', help='verbose output')
|
||||
parser.add_argument('-i', type=str, help=argparse.SUPPRESS) # help='input image path (jpg/png) or directory')
|
||||
parser.add_argument('-o', type=str, help=argparse.SUPPRESS) # help='output image path (png) or directory')
|
||||
parser.add_argument('-n', type=int, choices=range(-1, 4), help='denoise level')
|
||||
parser.add_argument('-s', type=int, choices=range(1, 3), help='upscale ratio')
|
||||
parser.add_argument('-t', type=int, help='tile size (>=32)')
|
||||
parser.add_argument('-m', type=str, help='waifu2x model path')
|
||||
parser.add_argument('-g', type=int, help='gpu device to use')
|
||||
parser.add_argument('-j', type=str, help='thread count for load/proc/save')
|
||||
parser.add_argument('-x', action='store_true', help='enable tta mode')
|
||||
return parser.parse_args(arguments)
|
||||
|
||||
def load_configurations(self, upscaler):
|
||||
self.driver_settings['s'] = int(upscaler.scale_ratio)
|
||||
self.driver_settings['j'] = '{}:{}:{}'.format(upscaler.processes, upscaler.processes, upscaler.processes)
|
||||
|
||||
def upscale(self, input_directory, output_directory):
|
||||
"""This is the core function for WAIFU2X class
|
||||
|
||||
Arguments:
|
||||
input_directory {string} -- source directory path
|
||||
output_directory {string} -- output directory path
|
||||
ratio {int} -- output video ratio
|
||||
"""
|
||||
|
||||
# change the working directory to the binary's parent directory
|
||||
# so the binary can find shared object files and other files
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# overwrite config file settings
|
||||
self.driver_settings['i'] = input_directory
|
||||
self.driver_settings['o'] = output_directory
|
||||
|
||||
# by default, waifu2x-ncnn-vulkan will look for the models under the current working directory
|
||||
# change the working directory to its containing folder if model directory not specified
|
||||
if self.driver_settings['m'] is None and platform.system() == 'Windows':
|
||||
os.chdir(pathlib.Path(self.driver_settings['path']).parent)
|
||||
|
||||
# list to be executed
|
||||
# initialize the list with waifu2x binary path as the first element
|
||||
execute = [self.driver_settings['path']]
|
||||
|
||||
for key in self.driver_settings.keys():
|
||||
|
||||
value = self.driver_settings[key]
|
||||
|
||||
# null or None means that leave this option out (keep default)
|
||||
if key == 'path' or value is None or value is False:
|
||||
continue
|
||||
else:
|
||||
if len(key) == 1:
|
||||
execute.append(f'-{key}')
|
||||
else:
|
||||
execute.append(f'--{key}')
|
||||
|
||||
# true means key is an option
|
||||
if value is not True:
|
||||
execute.append(str(value))
|
||||
|
||||
# return the Popen object of the new process created
|
||||
self.print_lock.acquire()
|
||||
Avalon.debug_info(f'[upscaler] Subprocess {os.getpid()} executing: {shlex.join(execute)}')
|
||||
self.print_lock.release()
|
||||
return subprocess.Popen(execute)
|
||||
31
video2x/__init__.py
Executable file
31
video2x/__init__.py
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Name: Package Init
|
||||
Author: K4YT3X
|
||||
Date Created: July 3, 2021
|
||||
Last Modified: February 16, 2022
|
||||
"""
|
||||
|
||||
# version assignment has to precede imports to
|
||||
# prevent setup.cfg from producing import errors
|
||||
__version__ = "5.0.0-beta5"
|
||||
|
||||
from .interpolator import Interpolator
|
||||
from .upscaler import Upscaler
|
||||
from .video2x import Video2X
|
||||
30
video2x/__main__.py
Executable file
30
video2x/__main__.py
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Name: Package Main
|
||||
Author: K4YT3X
|
||||
Date Created: July 3, 2021
|
||||
Last Modified: February 26, 2022
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
from .video2x import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
198
video2x/decoder.py
Executable file
198
video2x/decoder.py
Executable file
@@ -0,0 +1,198 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Name: Video Decoder
|
||||
Author: K4YT3X
|
||||
Date Created: June 17, 2021
|
||||
Last Modified: March 21, 2022
|
||||
"""
|
||||
|
||||
import contextlib
|
||||
import multiprocessing
|
||||
import os
|
||||
import pathlib
|
||||
import queue
|
||||
import signal
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
from multiprocessing.sharedctypes import Synchronized
|
||||
|
||||
import ffmpeg
|
||||
from loguru import logger
|
||||
from PIL import Image
|
||||
|
||||
from .pipe_printer import PipePrinter
|
||||
|
||||
# map Loguru log levels to FFmpeg log levels
|
||||
LOGURU_FFMPEG_LOGLEVELS = {
|
||||
"trace": "trace",
|
||||
"debug": "debug",
|
||||
"info": "info",
|
||||
"success": "info",
|
||||
"warning": "warning",
|
||||
"error": "error",
|
||||
"critical": "fatal",
|
||||
}
|
||||
|
||||
|
||||
class VideoDecoder(threading.Thread):
|
||||
def __init__(
|
||||
self,
|
||||
input_path: pathlib.Path,
|
||||
input_width: int,
|
||||
input_height: int,
|
||||
frame_rate: float,
|
||||
processing_queue: multiprocessing.Queue,
|
||||
processing_settings: tuple,
|
||||
pause: Synchronized,
|
||||
ignore_max_image_pixels=True,
|
||||
) -> None:
|
||||
threading.Thread.__init__(self)
|
||||
self.running = False
|
||||
self.input_path = input_path
|
||||
self.input_width = input_width
|
||||
self.input_height = input_height
|
||||
self.processing_queue = processing_queue
|
||||
self.processing_settings = processing_settings
|
||||
self.pause = pause
|
||||
|
||||
# this disables the "possible DDoS" warning
|
||||
if ignore_max_image_pixels:
|
||||
Image.MAX_IMAGE_PIXELS = None
|
||||
|
||||
self.exception = None
|
||||
self.decoder = subprocess.Popen(
|
||||
ffmpeg.compile(
|
||||
ffmpeg.input(input_path, r=frame_rate)["v"]
|
||||
.output("pipe:1", format="rawvideo", pix_fmt="rgb24", vsync="cfr")
|
||||
.global_args("-hide_banner")
|
||||
.global_args("-nostats")
|
||||
.global_args("-nostdin")
|
||||
.global_args(
|
||||
"-loglevel",
|
||||
LOGURU_FFMPEG_LOGLEVELS.get(
|
||||
os.environ.get("LOGURU_LEVEL", "INFO").lower()
|
||||
),
|
||||
),
|
||||
overwrite_output=True,
|
||||
),
|
||||
env={"AV_LOG_FORCE_COLOR": "TRUE"},
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
|
||||
# start the PIPE printer to start printing FFmpeg logs
|
||||
self.pipe_printer = PipePrinter(self.decoder.stderr)
|
||||
self.pipe_printer.start()
|
||||
|
||||
def run(self) -> None:
|
||||
self.running = True
|
||||
|
||||
# the index of the frame
|
||||
frame_index = 0
|
||||
|
||||
# create placeholder for previous frame
|
||||
# used in interpolate mode
|
||||
previous_image = None
|
||||
|
||||
# continue running until an exception occurs
|
||||
# or all frames have been decoded
|
||||
while self.running:
|
||||
|
||||
# pause if pause flag is set
|
||||
if self.pause.value is True:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
try:
|
||||
buffer = self.decoder.stdout.read(
|
||||
3 * self.input_width * self.input_height
|
||||
)
|
||||
|
||||
# source depleted (decoding finished)
|
||||
# after the last frame has been decoded
|
||||
# read will return nothing
|
||||
if len(buffer) == 0:
|
||||
self.stop()
|
||||
continue
|
||||
|
||||
# convert raw bytes into image object
|
||||
image = Image.frombytes(
|
||||
"RGB", (self.input_width, self.input_height), buffer
|
||||
)
|
||||
|
||||
# keep checking if the running flag is set to False
|
||||
# while waiting to put the next image into the queue
|
||||
while self.running:
|
||||
with contextlib.suppress(queue.Full):
|
||||
self.processing_queue.put(
|
||||
(
|
||||
frame_index,
|
||||
(previous_image, image),
|
||||
self.processing_settings,
|
||||
),
|
||||
timeout=0.1,
|
||||
)
|
||||
break
|
||||
|
||||
previous_image = image
|
||||
frame_index += 1
|
||||
|
||||
# most likely "not enough image data"
|
||||
except ValueError as e:
|
||||
self.exception = e
|
||||
|
||||
# ignore queue closed
|
||||
if "is closed" not in str(e):
|
||||
logger.exception(e)
|
||||
break
|
||||
|
||||
# send exceptions into the client connection pipe
|
||||
except Exception as e:
|
||||
self.exception = e
|
||||
logger.exception(e)
|
||||
break
|
||||
else:
|
||||
logger.debug("Decoding queue depleted")
|
||||
|
||||
# flush the remaining data in STDOUT and STDERR
|
||||
self.decoder.stdout.flush()
|
||||
self.decoder.stderr.flush()
|
||||
|
||||
# send SIGINT (2) to FFmpeg
|
||||
# this instructs it to finalize and exit
|
||||
self.decoder.send_signal(signal.SIGINT)
|
||||
|
||||
# close PIPEs to prevent process from getting stuck
|
||||
self.decoder.stdout.close()
|
||||
self.decoder.stderr.close()
|
||||
|
||||
# wait for process to exit
|
||||
self.decoder.wait()
|
||||
|
||||
# wait for PIPE printer to exit
|
||||
self.pipe_printer.stop()
|
||||
self.pipe_printer.join()
|
||||
|
||||
logger.info("Decoder thread exiting")
|
||||
return super().run()
|
||||
|
||||
def stop(self) -> None:
|
||||
self.running = False
|
||||
198
video2x/encoder.py
Executable file
198
video2x/encoder.py
Executable file
@@ -0,0 +1,198 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Name: Video Encoder
|
||||
Author: K4YT3X
|
||||
Date Created: June 17, 2021
|
||||
Last Modified: March 20, 2022
|
||||
"""
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import signal
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
from multiprocessing.managers import ListProxy
|
||||
from multiprocessing.sharedctypes import Synchronized
|
||||
|
||||
import ffmpeg
|
||||
from loguru import logger
|
||||
|
||||
from .pipe_printer import PipePrinter
|
||||
|
||||
# map Loguru log levels to FFmpeg log levels
|
||||
LOGURU_FFMPEG_LOGLEVELS = {
|
||||
"trace": "trace",
|
||||
"debug": "debug",
|
||||
"info": "info",
|
||||
"success": "info",
|
||||
"warning": "warning",
|
||||
"error": "error",
|
||||
"critical": "fatal",
|
||||
}
|
||||
|
||||
|
||||
class VideoEncoder(threading.Thread):
|
||||
def __init__(
|
||||
self,
|
||||
input_path: pathlib.Path,
|
||||
frame_rate: float,
|
||||
output_path: pathlib.Path,
|
||||
output_width: int,
|
||||
output_height: int,
|
||||
total_frames: int,
|
||||
processed_frames: ListProxy,
|
||||
processed: Synchronized,
|
||||
pause: Synchronized,
|
||||
copy_audio: bool = True,
|
||||
copy_subtitle: bool = True,
|
||||
copy_data: bool = False,
|
||||
copy_attachments: bool = False,
|
||||
) -> None:
|
||||
threading.Thread.__init__(self)
|
||||
self.running = False
|
||||
self.input_path = input_path
|
||||
self.output_path = output_path
|
||||
self.total_frames = total_frames
|
||||
self.processed_frames = processed_frames
|
||||
self.processed = processed
|
||||
self.pause = pause
|
||||
|
||||
# stores exceptions if the thread exits with errors
|
||||
self.exception = None
|
||||
|
||||
# create FFmpeg input for the original input video
|
||||
self.original = ffmpeg.input(input_path)
|
||||
|
||||
# define frames as input
|
||||
frames = ffmpeg.input(
|
||||
"pipe:0",
|
||||
format="rawvideo",
|
||||
pix_fmt="rgb24",
|
||||
vsync="cfr",
|
||||
s=f"{output_width}x{output_height}",
|
||||
r=frame_rate,
|
||||
)
|
||||
|
||||
# copy additional streams from original file
|
||||
# https://ffmpeg.org/ffmpeg.html#Stream-specifiers-1
|
||||
additional_streams = [
|
||||
# self.original["1:v?"],
|
||||
self.original["a?"] if copy_audio is True else None,
|
||||
self.original["s?"] if copy_subtitle is True else None,
|
||||
self.original["d?"] if copy_data is True else None,
|
||||
self.original["t?"] if copy_attachments is True else None,
|
||||
]
|
||||
|
||||
# run FFmpeg and produce final output
|
||||
self.encoder = subprocess.Popen(
|
||||
ffmpeg.compile(
|
||||
ffmpeg.output(
|
||||
frames,
|
||||
*[s for s in additional_streams if s is not None],
|
||||
str(self.output_path),
|
||||
vcodec="libx264",
|
||||
vsync="cfr",
|
||||
pix_fmt="yuv420p",
|
||||
crf=17,
|
||||
preset="veryslow",
|
||||
# acodec="libfdk_aac",
|
||||
# cutoff=20000,
|
||||
r=frame_rate,
|
||||
map_metadata=1,
|
||||
metadata="comment=Processed with Video2X",
|
||||
)
|
||||
.global_args("-hide_banner")
|
||||
.global_args("-nostats")
|
||||
.global_args(
|
||||
"-loglevel",
|
||||
LOGURU_FFMPEG_LOGLEVELS.get(
|
||||
os.environ.get("LOGURU_LEVEL", "INFO").lower()
|
||||
),
|
||||
),
|
||||
overwrite_output=True,
|
||||
),
|
||||
env={"AV_LOG_FORCE_COLOR": "TRUE"},
|
||||
stdin=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
|
||||
# start the PIPE printer to start printing FFmpeg logs
|
||||
self.pipe_printer = PipePrinter(self.encoder.stderr)
|
||||
self.pipe_printer.start()
|
||||
|
||||
def run(self) -> None:
|
||||
self.running = True
|
||||
frame_index = 0
|
||||
while self.running and frame_index < self.total_frames:
|
||||
|
||||
# pause if pause flag is set
|
||||
if self.pause.value is True:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
try:
|
||||
image = self.processed_frames[frame_index]
|
||||
if image is None:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
# send the image to FFmpeg for encoding
|
||||
self.encoder.stdin.write(image.tobytes())
|
||||
|
||||
# remove the image from memory
|
||||
self.processed_frames[frame_index] = None
|
||||
|
||||
with self.processed.get_lock():
|
||||
self.processed.value += 1
|
||||
|
||||
frame_index += 1
|
||||
|
||||
# send exceptions into the client connection pipe
|
||||
except Exception as e:
|
||||
self.exception = e
|
||||
logger.exception(e)
|
||||
break
|
||||
else:
|
||||
logger.debug("Encoding queue depleted")
|
||||
|
||||
# flush the remaining data in STDIN and STDERR
|
||||
self.encoder.stdin.flush()
|
||||
self.encoder.stderr.flush()
|
||||
|
||||
# send SIGINT (2) to FFmpeg
|
||||
# this instructs it to finalize and exit
|
||||
self.encoder.send_signal(signal.SIGINT)
|
||||
|
||||
# close PIPEs to prevent process from getting stuck
|
||||
self.encoder.stdin.close()
|
||||
self.encoder.stderr.close()
|
||||
|
||||
# wait for process to exit
|
||||
self.encoder.wait()
|
||||
|
||||
# wait for PIPE printer to exit
|
||||
self.pipe_printer.stop()
|
||||
self.pipe_printer.join()
|
||||
|
||||
logger.info("Encoder thread exiting")
|
||||
return super().run()
|
||||
|
||||
def stop(self) -> None:
|
||||
self.running = False
|
||||
125
video2x/interpolator.py
Executable file
125
video2x/interpolator.py
Executable file
@@ -0,0 +1,125 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Name: Interpolator
|
||||
Author: K4YT3X
|
||||
Date Created: May 27, 2021
|
||||
Last Modified: March 20, 2022
|
||||
"""
|
||||
|
||||
import multiprocessing
|
||||
import queue
|
||||
import signal
|
||||
import time
|
||||
from multiprocessing.managers import ListProxy
|
||||
from multiprocessing.sharedctypes import Synchronized
|
||||
|
||||
from loguru import logger
|
||||
from PIL import ImageChops, ImageStat
|
||||
from rife_ncnn_vulkan_python.rife_ncnn_vulkan import Rife
|
||||
|
||||
ALGORITHM_CLASSES = {"rife": Rife}
|
||||
|
||||
|
||||
class Interpolator(multiprocessing.Process):
|
||||
def __init__(
|
||||
self,
|
||||
processing_queue: multiprocessing.Queue,
|
||||
processed_frames: ListProxy,
|
||||
pause: Synchronized,
|
||||
) -> None:
|
||||
multiprocessing.Process.__init__(self)
|
||||
self.running = False
|
||||
self.processing_queue = processing_queue
|
||||
self.processed_frames = processed_frames
|
||||
self.pause = pause
|
||||
|
||||
signal.signal(signal.SIGTERM, self._stop)
|
||||
|
||||
def run(self) -> None:
|
||||
self.running = True
|
||||
logger.opt(colors=True).info(
|
||||
f"Interpolator process <blue>{self.name}</blue> initiating"
|
||||
)
|
||||
processor_objects = {}
|
||||
while self.running:
|
||||
try:
|
||||
# pause if pause flag is set
|
||||
if self.pause.value is True:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
try:
|
||||
# get new job from queue
|
||||
(
|
||||
frame_index,
|
||||
(image0, image1),
|
||||
(difference_threshold, algorithm),
|
||||
) = self.processing_queue.get(False)
|
||||
except queue.Empty:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
# if image0 is None, image1 is the first frame
|
||||
# skip this round
|
||||
if image0 is None:
|
||||
continue
|
||||
|
||||
difference = ImageChops.difference(image0, image1)
|
||||
difference_stat = ImageStat.Stat(difference)
|
||||
difference_ratio = (
|
||||
sum(difference_stat.mean) / (len(difference_stat.mean) * 255) * 100
|
||||
)
|
||||
|
||||
# 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 = processor_objects.get(algorithm)
|
||||
if processor_object is None:
|
||||
processor_object = ALGORITHM_CLASSES[algorithm](0)
|
||||
processor_objects[algorithm] = processor_object
|
||||
interpolated_image = processor_object.process(image0, image1)
|
||||
|
||||
# if the difference is greater than threshold
|
||||
# there's a change in camera angle, ignore
|
||||
else:
|
||||
interpolated_image = image0
|
||||
|
||||
if frame_index == 1:
|
||||
self.processed_frames[0] = image0
|
||||
self.processed_frames[frame_index * 2 - 1] = interpolated_image
|
||||
self.processed_frames[frame_index * 2] = image1
|
||||
|
||||
# send exceptions into the client connection pipe
|
||||
except (SystemExit, KeyboardInterrupt):
|
||||
break
|
||||
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
break
|
||||
|
||||
logger.opt(colors=True).info(
|
||||
f"Interpolator process <blue>{self.name}</blue> terminating"
|
||||
)
|
||||
return super().run()
|
||||
|
||||
def _stop(self, _signal_number, _frame) -> None:
|
||||
self.running = False
|
||||
63
video2x/pipe_printer.py
Executable file
63
video2x/pipe_printer.py
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Name: PIPE Printer
|
||||
Author: K4YT3X
|
||||
Date Created: February 27, 2022
|
||||
Last Modified: February 28, 2022
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from typing import IO
|
||||
|
||||
|
||||
class PipePrinter(threading.Thread):
|
||||
def __init__(self, stderr: IO[bytes]) -> None:
|
||||
threading.Thread.__init__(self)
|
||||
self.stderr = stderr
|
||||
self.running = False
|
||||
|
||||
# set read mode to non-blocking
|
||||
os.set_blocking(self.stderr.fileno(), False)
|
||||
|
||||
def _print_output(self) -> None:
|
||||
output = self.stderr.read()
|
||||
if output is not None and len(output) != 0:
|
||||
print(output.decode(), file=sys.stderr)
|
||||
|
||||
def run(self) -> None:
|
||||
self.running = True
|
||||
|
||||
# keep printing contents in the PIPE
|
||||
while self.running:
|
||||
time.sleep(0.5)
|
||||
|
||||
try:
|
||||
self._print_output()
|
||||
|
||||
# pipe closed
|
||||
except ValueError:
|
||||
break
|
||||
|
||||
return super().run()
|
||||
|
||||
def stop(self) -> None:
|
||||
self.running = False
|
||||
207
video2x/upscaler.py
Executable file
207
video2x/upscaler.py
Executable file
@@ -0,0 +1,207 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Name: Upscaler
|
||||
Author: K4YT3X
|
||||
Date Created: May 27, 2021
|
||||
Last Modified: March 20, 2022
|
||||
"""
|
||||
|
||||
import math
|
||||
import multiprocessing
|
||||
import queue
|
||||
import signal
|
||||
import time
|
||||
from multiprocessing.managers import ListProxy
|
||||
from multiprocessing.sharedctypes import Synchronized
|
||||
|
||||
from loguru import logger
|
||||
from PIL import Image, ImageChops, ImageStat
|
||||
from realcugan_ncnn_vulkan_python import Realcugan
|
||||
from realsr_ncnn_vulkan_python import Realsr
|
||||
from srmd_ncnn_vulkan_python import Srmd
|
||||
from waifu2x_ncnn_vulkan_python import Waifu2x
|
||||
|
||||
# fixed scaling ratios supported by the algorithms
|
||||
# that only support certain fixed scale ratios
|
||||
ALGORITHM_FIXED_SCALING_RATIOS = {
|
||||
"waifu2x": [1, 2],
|
||||
"srmd": [2, 3, 4],
|
||||
"realsr": [4],
|
||||
"realcugan": [1, 2, 3, 4],
|
||||
}
|
||||
|
||||
ALGORITHM_CLASSES = {
|
||||
"waifu2x": Waifu2x,
|
||||
"srmd": Srmd,
|
||||
"realsr": Realsr,
|
||||
"realcugan": Realcugan,
|
||||
}
|
||||
|
||||
|
||||
class Upscaler(multiprocessing.Process):
|
||||
def __init__(
|
||||
self,
|
||||
processing_queue: multiprocessing.Queue,
|
||||
processed_frames: ListProxy,
|
||||
pause: Synchronized,
|
||||
) -> None:
|
||||
multiprocessing.Process.__init__(self)
|
||||
self.running = False
|
||||
self.processing_queue = processing_queue
|
||||
self.processed_frames = processed_frames
|
||||
self.pause = pause
|
||||
|
||||
signal.signal(signal.SIGTERM, self._stop)
|
||||
|
||||
def run(self) -> None:
|
||||
self.running = True
|
||||
logger.opt(colors=True).info(
|
||||
f"Upscaler process <blue>{self.name}</blue> initiating"
|
||||
)
|
||||
processor_objects = {}
|
||||
while self.running:
|
||||
try:
|
||||
# pause if pause flag is set
|
||||
if self.pause.value is True:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
try:
|
||||
# get new job from queue
|
||||
(
|
||||
frame_index,
|
||||
(image0, image1),
|
||||
(
|
||||
output_width,
|
||||
output_height,
|
||||
noise,
|
||||
difference_threshold,
|
||||
algorithm,
|
||||
),
|
||||
) = self.processing_queue.get(False)
|
||||
|
||||
# destructure settings
|
||||
except queue.Empty:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
difference_ratio = 0
|
||||
if image0 is not None:
|
||||
difference = ImageChops.difference(image0, image1)
|
||||
difference_stat = ImageStat.Stat(difference)
|
||||
difference_ratio = (
|
||||
sum(difference_stat.mean)
|
||||
/ (len(difference_stat.mean) * 255)
|
||||
* 100
|
||||
)
|
||||
|
||||
# if the difference is lower than threshold
|
||||
# skip this frame
|
||||
if difference_ratio < difference_threshold:
|
||||
|
||||
# make sure the previous frame has been processed
|
||||
if frame_index > 0:
|
||||
while self.processed_frames[frame_index - 1] is None:
|
||||
time.sleep(0.1)
|
||||
|
||||
# make the current image the same as the previous result
|
||||
self.processed_frames[frame_index] = self.processed_frames[
|
||||
frame_index - 1
|
||||
]
|
||||
|
||||
# if the difference is greater than threshold
|
||||
# process this frame
|
||||
else:
|
||||
width, height = image1.size
|
||||
|
||||
# calculate required minimum scale ratio
|
||||
output_scale = max(output_width / width, output_height / height)
|
||||
|
||||
# select the optimal algorithm scaling ratio to use
|
||||
supported_scaling_ratios = sorted(
|
||||
ALGORITHM_FIXED_SCALING_RATIOS[algorithm]
|
||||
)
|
||||
|
||||
remaining_scaling_ratio = math.ceil(output_scale)
|
||||
scaling_jobs = []
|
||||
|
||||
# if the scaling ratio is 1.0
|
||||
# apply the smallest scaling ratio available
|
||||
if remaining_scaling_ratio == 1:
|
||||
scaling_jobs.append(supported_scaling_ratios[0])
|
||||
else:
|
||||
while remaining_scaling_ratio > 1:
|
||||
for ratio in supported_scaling_ratios:
|
||||
if ratio >= remaining_scaling_ratio:
|
||||
scaling_jobs.append(ratio)
|
||||
remaining_scaling_ratio /= ratio
|
||||
break
|
||||
|
||||
else:
|
||||
found = False
|
||||
for i in supported_scaling_ratios:
|
||||
for j in supported_scaling_ratios:
|
||||
if i * j >= remaining_scaling_ratio:
|
||||
scaling_jobs.extend([i, j])
|
||||
remaining_scaling_ratio /= i * j
|
||||
found = True
|
||||
break
|
||||
if found is True:
|
||||
break
|
||||
|
||||
if found is False:
|
||||
scaling_jobs.append(supported_scaling_ratios[-1])
|
||||
remaining_scaling_ratio /= supported_scaling_ratios[
|
||||
-1
|
||||
]
|
||||
|
||||
for job in scaling_jobs:
|
||||
|
||||
# select a processor object with the required settings
|
||||
# create a new object if none are available
|
||||
processor_object = processor_objects.get((algorithm, job))
|
||||
if processor_object is None:
|
||||
processor_object = ALGORITHM_CLASSES[algorithm](
|
||||
noise=noise, scale=job
|
||||
)
|
||||
processor_objects[(algorithm, job)] = processor_object
|
||||
|
||||
# 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
|
||||
image1 = image1.resize((output_width, output_height), Image.LANCZOS)
|
||||
self.processed_frames[frame_index] = image1
|
||||
|
||||
# send exceptions into the client connection pipe
|
||||
except (SystemExit, KeyboardInterrupt):
|
||||
break
|
||||
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
break
|
||||
|
||||
logger.opt(colors=True).info(
|
||||
f"Upscaler process <blue>{self.name}</blue> terminating"
|
||||
)
|
||||
return super().run()
|
||||
|
||||
def _stop(self, _signal_number, _frame) -> None:
|
||||
self.running = False
|
||||
643
video2x/video2x.py
Executable file
643
video2x/video2x.py
Executable file
@@ -0,0 +1,643 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
r"""
|
||||
Copyright (C) 2018-2022 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
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
__ __ _ _ ___ __ __
|
||||
\ \ / / (_) | | |__ \ \ \ / /
|
||||
\ \ / / _ __| | ___ ___ ) | \ V /
|
||||
\ \/ / | | / _` | / _ \ / _ \ / / > <
|
||||
\ / | | | (_| | | __/ | (_) | / /_ / . \
|
||||
\/ |_| \__,_| \___| \___/ |____| /_/ \_\
|
||||
|
||||
|
||||
Name: Video2X
|
||||
Creator: K4YT3X
|
||||
Date Created: February 24, 2018
|
||||
Last Modified: March 21, 2022
|
||||
|
||||
Editor: BrianPetkovsek
|
||||
Last Modified: June 17, 2019
|
||||
|
||||
Editor: SAT3LL
|
||||
Last Modified: June 25, 2019
|
||||
|
||||
Editor: 28598519a
|
||||
Last Modified: March 23, 2020
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import ctypes
|
||||
import math
|
||||
import multiprocessing
|
||||
import os
|
||||
import pathlib
|
||||
import signal
|
||||
import sys
|
||||
import time
|
||||
|
||||
import cv2
|
||||
import ffmpeg
|
||||
from loguru import logger
|
||||
from rich import print
|
||||
from rich.console import Console
|
||||
from rich.file_proxy import FileProxy
|
||||
from rich.progress import (
|
||||
BarColumn,
|
||||
Progress,
|
||||
ProgressColumn,
|
||||
Task,
|
||||
TimeElapsedColumn,
|
||||
TimeRemainingColumn,
|
||||
)
|
||||
from rich.text import Text
|
||||
|
||||
from . import __version__
|
||||
from .decoder import VideoDecoder
|
||||
from .encoder import VideoEncoder
|
||||
from .interpolator import Interpolator
|
||||
from .upscaler import Upscaler
|
||||
|
||||
# for desktop environments only
|
||||
# if pynput can be loaded, enable global pause hotkey support
|
||||
try:
|
||||
import pynput
|
||||
except ImportError:
|
||||
ENABLE_HOTKEY = False
|
||||
else:
|
||||
ENABLE_HOTKEY = True
|
||||
|
||||
LEGAL_INFO = """Video2X\t\t{}
|
||||
Author:\t\tK4YT3X
|
||||
License:\tGNU AGPL v3
|
||||
Github Page:\thttps://github.com/k4yt3x/video2x
|
||||
Contact:\ti@k4yt3x.com""".format(
|
||||
__version__
|
||||
)
|
||||
|
||||
# algorithms available for upscaling tasks
|
||||
UPSCALING_ALGORITHMS = [
|
||||
"waifu2x",
|
||||
"srmd",
|
||||
"realsr",
|
||||
"realcugan",
|
||||
]
|
||||
|
||||
# algorithms available for frame interpolation tasks
|
||||
INTERPOLATION_ALGORITHMS = ["rife"]
|
||||
|
||||
# progress bar labels for different modes
|
||||
MODE_LABELS = {"upscale": "Upscaling", "interpolate": "Interpolating"}
|
||||
|
||||
# format string for Loguru loggers
|
||||
LOGURU_FORMAT = (
|
||||
"<green>{time:HH:mm:ss.SSSSSS!UTC}</green> | "
|
||||
"<level>{level: <8}</level> | "
|
||||
"<level>{message}</level>"
|
||||
)
|
||||
|
||||
|
||||
class ProcessingSpeedColumn(ProgressColumn):
|
||||
"""Custom progress bar column that displays the processing speed"""
|
||||
|
||||
def render(self, task: Task) -> Text:
|
||||
speed = task.finished_speed or task.speed
|
||||
return Text(
|
||||
f"{round(speed, 2) if isinstance(speed, float) else '?'} FPS",
|
||||
style="progress.data.speed",
|
||||
)
|
||||
|
||||
|
||||
class Video2X:
|
||||
"""
|
||||
Video2X class
|
||||
|
||||
provides two vital functions:
|
||||
- upscale: perform upscaling on a file
|
||||
- interpolate: perform motion interpolation on a file
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.version = __version__
|
||||
|
||||
def _get_video_info(self, path: pathlib.Path) -> tuple:
|
||||
"""
|
||||
get video file information with FFmpeg
|
||||
|
||||
:param path pathlib.Path: video file path
|
||||
:raises RuntimeError: raised when video stream isn't found
|
||||
"""
|
||||
# probe video file info
|
||||
logger.info("Reading input video information")
|
||||
for stream in ffmpeg.probe(path)["streams"]:
|
||||
if stream["codec_type"] == "video":
|
||||
video_info = stream
|
||||
break
|
||||
else:
|
||||
raise RuntimeError("unable to find video stream")
|
||||
|
||||
# get total number of frames to be processed
|
||||
capture = cv2.VideoCapture(str(path))
|
||||
|
||||
# check if file is opened successfully
|
||||
if not capture.isOpened():
|
||||
raise RuntimeError("OpenCV has failed to open the input file")
|
||||
|
||||
total_frames = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|
||||
frame_rate = capture.get(cv2.CAP_PROP_FPS)
|
||||
|
||||
return video_info["width"], video_info["height"], total_frames, frame_rate
|
||||
|
||||
def _toggle_pause(self, _signal_number: int = -1, _frame=None):
|
||||
# print console messages and update the progress bar's status
|
||||
if self.pause.value is False:
|
||||
self.progress.update(self.task, description=self.description + " (paused)")
|
||||
self.progress.stop_task(self.task)
|
||||
logger.warning("Processing paused, press Ctrl+Alt+V again to resume")
|
||||
|
||||
elif self.pause.value is True:
|
||||
self.progress.update(self.task, description=self.description)
|
||||
logger.warning("Resuming processing")
|
||||
self.progress.start_task(self.task)
|
||||
|
||||
# invert the value of the pause flag
|
||||
with self.pause.get_lock():
|
||||
self.pause.value = not self.pause.value
|
||||
|
||||
def _run(
|
||||
self,
|
||||
input_path: pathlib.Path,
|
||||
width: int,
|
||||
height: int,
|
||||
total_frames: int,
|
||||
frame_rate: float,
|
||||
output_path: pathlib.Path,
|
||||
output_width: int,
|
||||
output_height: int,
|
||||
Processor: object,
|
||||
mode: str,
|
||||
processes: int,
|
||||
processing_settings: tuple,
|
||||
) -> None:
|
||||
|
||||
# record original STDOUT and STDERR for restoration
|
||||
original_stdout = sys.stdout
|
||||
original_stderr = sys.stderr
|
||||
|
||||
# create console for rich's Live display
|
||||
console = Console()
|
||||
|
||||
# redirect STDOUT and STDERR to console
|
||||
sys.stdout = FileProxy(console, sys.stdout)
|
||||
sys.stderr = FileProxy(console, sys.stderr)
|
||||
|
||||
# re-add Loguru to point to the new STDERR
|
||||
logger.remove()
|
||||
logger.add(sys.stderr, colorize=True, format=LOGURU_FORMAT)
|
||||
|
||||
# initialize values
|
||||
self.processor_processes = []
|
||||
self.processing_queue = multiprocessing.Queue(maxsize=processes * 10)
|
||||
processed_frames = multiprocessing.Manager().list([None] * total_frames)
|
||||
self.processed = multiprocessing.Value("I", 0)
|
||||
self.pause = multiprocessing.Value(ctypes.c_bool, False)
|
||||
|
||||
# set up and start decoder thread
|
||||
logger.info("Starting video decoder")
|
||||
self.decoder = VideoDecoder(
|
||||
input_path,
|
||||
width,
|
||||
height,
|
||||
frame_rate,
|
||||
self.processing_queue,
|
||||
processing_settings,
|
||||
self.pause,
|
||||
)
|
||||
self.decoder.start()
|
||||
|
||||
# set up and start encoder thread
|
||||
logger.info("Starting video encoder")
|
||||
self.encoder = VideoEncoder(
|
||||
input_path,
|
||||
frame_rate * 2 if mode == "interpolate" else frame_rate,
|
||||
output_path,
|
||||
output_width,
|
||||
output_height,
|
||||
total_frames,
|
||||
processed_frames,
|
||||
self.processed,
|
||||
self.pause,
|
||||
)
|
||||
self.encoder.start()
|
||||
|
||||
# create processor processes
|
||||
for process_name in range(processes):
|
||||
process = Processor(self.processing_queue, processed_frames, self.pause)
|
||||
process.name = str(process_name)
|
||||
process.daemon = True
|
||||
process.start()
|
||||
self.processor_processes.append(process)
|
||||
|
||||
# create progress bar
|
||||
self.progress = Progress(
|
||||
"[progress.description]{task.description}",
|
||||
BarColumn(complete_style="blue", finished_style="green"),
|
||||
"[progress.percentage]{task.percentage:>3.0f}%",
|
||||
"[color(240)]({task.completed}/{task.total})",
|
||||
ProcessingSpeedColumn(),
|
||||
TimeElapsedColumn(),
|
||||
"<",
|
||||
TimeRemainingColumn(),
|
||||
console=console,
|
||||
speed_estimate_period=300.0,
|
||||
disable=True,
|
||||
)
|
||||
|
||||
self.description = f"[cyan]{MODE_LABELS.get(mode, 'Unknown')}"
|
||||
self.task = self.progress.add_task(self.description, total=total_frames)
|
||||
|
||||
# allow sending SIGUSR1 to pause/resume processing
|
||||
signal.signal(signal.SIGUSR1, self._toggle_pause)
|
||||
|
||||
# enable global pause hotkey if it's supported
|
||||
if ENABLE_HOTKEY is True:
|
||||
|
||||
# create global pause hotkey
|
||||
pause_hotkey = pynput.keyboard.HotKey(
|
||||
pynput.keyboard.HotKey.parse("<ctrl>+<alt>+v"), self._toggle_pause
|
||||
)
|
||||
|
||||
# create global keyboard input listener
|
||||
keyboard_listener = pynput.keyboard.Listener(
|
||||
on_press=(
|
||||
lambda key: pause_hotkey.press(keyboard_listener.canonical(key))
|
||||
),
|
||||
on_release=(
|
||||
lambda key: pause_hotkey.release(keyboard_listener.canonical(key))
|
||||
),
|
||||
)
|
||||
|
||||
# start monitoring global key presses
|
||||
keyboard_listener.start()
|
||||
|
||||
# a temporary variable that stores the exception
|
||||
exception = []
|
||||
|
||||
try:
|
||||
|
||||
# wait for jobs in queue to deplete
|
||||
while self.processed.value < total_frames - 1:
|
||||
time.sleep(1)
|
||||
|
||||
# check processor health
|
||||
for process in self.processor_processes:
|
||||
if not process.is_alive():
|
||||
raise Exception("process died unexpectedly")
|
||||
|
||||
# check decoder health
|
||||
if not self.decoder.is_alive() and self.decoder.exception is not None:
|
||||
raise Exception("decoder died unexpectedly")
|
||||
|
||||
# check encoder health
|
||||
if not self.encoder.is_alive() and self.encoder.exception is not None:
|
||||
raise Exception("encoder died unexpectedly")
|
||||
|
||||
# show progress bar when upscale starts
|
||||
if self.progress.disable is True and self.processed.value > 0:
|
||||
self.progress.disable = False
|
||||
self.progress.start()
|
||||
|
||||
# update progress
|
||||
if self.pause.value is False:
|
||||
self.progress.update(self.task, completed=self.processed.value)
|
||||
|
||||
self.progress.update(self.task, completed=total_frames)
|
||||
self.progress.stop()
|
||||
logger.info("Processing has completed")
|
||||
|
||||
# if SIGTERM is received or ^C is pressed
|
||||
# TODO: pause and continue here
|
||||
except (SystemExit, KeyboardInterrupt) as e:
|
||||
self.progress.stop()
|
||||
logger.warning("Exit signal received, exiting gracefully")
|
||||
logger.warning("Press ^C again to force terminate")
|
||||
exception.append(e)
|
||||
|
||||
except Exception as e:
|
||||
self.progress.stop()
|
||||
logger.exception(e)
|
||||
exception.append(e)
|
||||
|
||||
finally:
|
||||
|
||||
# stop keyboard listener
|
||||
if ENABLE_HOTKEY is True:
|
||||
keyboard_listener.stop()
|
||||
keyboard_listener.join()
|
||||
|
||||
# stop progress display
|
||||
self.progress.stop()
|
||||
|
||||
# stop processor processes
|
||||
logger.info("Stopping processor processes")
|
||||
for process in self.processor_processes:
|
||||
process.terminate()
|
||||
|
||||
# wait for processes to finish
|
||||
for process in self.processor_processes:
|
||||
process.join()
|
||||
|
||||
# stop encoder and decoder
|
||||
logger.info("Stopping decoder and encoder threads")
|
||||
self.decoder.stop()
|
||||
self.encoder.stop()
|
||||
self.decoder.join()
|
||||
self.encoder.join()
|
||||
|
||||
# mark processing queue as closed
|
||||
self.processing_queue.close()
|
||||
|
||||
# raise the error if there is any
|
||||
if len(exception) > 0:
|
||||
raise exception[0]
|
||||
|
||||
# restore original STDOUT and STDERR
|
||||
sys.stdout = original_stdout
|
||||
sys.stderr = original_stderr
|
||||
|
||||
# re-add Loguru to point to the restored STDERR
|
||||
logger.remove()
|
||||
logger.add(sys.stderr, colorize=True, format=LOGURU_FORMAT)
|
||||
|
||||
def upscale(
|
||||
self,
|
||||
input_path: pathlib.Path,
|
||||
output_path: pathlib.Path,
|
||||
output_width: int,
|
||||
output_height: int,
|
||||
noise: int,
|
||||
processes: int,
|
||||
threshold: float,
|
||||
algorithm: str,
|
||||
) -> None:
|
||||
|
||||
# get basic video information
|
||||
width, height, total_frames, frame_rate = self._get_video_info(input_path)
|
||||
|
||||
# automatically calculate output width and height if only one is given
|
||||
if output_width == 0 or output_width is None:
|
||||
output_width = output_height / height * width
|
||||
|
||||
elif output_height == 0 or output_height is None:
|
||||
output_height = output_width / width * height
|
||||
|
||||
# sanitize output width and height to be divisible by 2
|
||||
output_width = int(math.ceil(output_width / 2.0) * 2)
|
||||
output_height = int(math.ceil(output_height / 2.0) * 2)
|
||||
|
||||
# start processing
|
||||
self._run(
|
||||
input_path,
|
||||
width,
|
||||
height,
|
||||
total_frames,
|
||||
frame_rate,
|
||||
output_path,
|
||||
output_width,
|
||||
output_height,
|
||||
Upscaler,
|
||||
"upscale",
|
||||
processes,
|
||||
(
|
||||
output_width,
|
||||
output_height,
|
||||
noise,
|
||||
threshold,
|
||||
algorithm,
|
||||
),
|
||||
)
|
||||
|
||||
def interpolate(
|
||||
self,
|
||||
input_path: pathlib.Path,
|
||||
output_path: pathlib.Path,
|
||||
processes: int,
|
||||
threshold: float,
|
||||
algorithm: str,
|
||||
) -> None:
|
||||
|
||||
# get video basic information
|
||||
width, height, original_frames, frame_rate = self._get_video_info(input_path)
|
||||
|
||||
# calculate the number of total output frames
|
||||
total_frames = original_frames * 2 - 1
|
||||
|
||||
# start processing
|
||||
self._run(
|
||||
input_path,
|
||||
width,
|
||||
height,
|
||||
total_frames,
|
||||
frame_rate,
|
||||
output_path,
|
||||
width,
|
||||
height,
|
||||
Interpolator,
|
||||
"interpolate",
|
||||
processes,
|
||||
(threshold, algorithm),
|
||||
)
|
||||
|
||||
|
||||
def parse_arguments() -> argparse.Namespace:
|
||||
"""
|
||||
parse command line arguments
|
||||
|
||||
:rtype argparse.Namespace: command parsing results
|
||||
"""
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="video2x",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--version", help="show version information and exit", action="store_true"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-i",
|
||||
"--input",
|
||||
type=pathlib.Path,
|
||||
help="input file/directory path",
|
||||
required=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--output",
|
||||
type=pathlib.Path,
|
||||
help="output file/directory path",
|
||||
required=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p", "--processes", type=int, help="number of processes to launch", default=1
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--loglevel",
|
||||
choices=["trace", "debug", "info", "success", "warning", "error", "critical"],
|
||||
default="info",
|
||||
)
|
||||
|
||||
# upscaler arguments
|
||||
action = parser.add_subparsers(
|
||||
help="action to perform", dest="action", required=True
|
||||
)
|
||||
|
||||
upscale = action.add_parser(
|
||||
"upscale",
|
||||
help="upscale a file",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
add_help=False,
|
||||
)
|
||||
upscale.add_argument(
|
||||
"--help", action="help", help="show this help message and exit"
|
||||
)
|
||||
upscale.add_argument("-w", "--width", type=int, help="output width")
|
||||
upscale.add_argument("-h", "--height", type=int, help="output height")
|
||||
upscale.add_argument("-n", "--noise", type=int, help="denoise level", default=3)
|
||||
upscale.add_argument(
|
||||
"-a",
|
||||
"--algorithm",
|
||||
choices=UPSCALING_ALGORITHMS,
|
||||
help="algorithm to use for upscaling",
|
||||
default=UPSCALING_ALGORITHMS[0],
|
||||
)
|
||||
upscale.add_argument(
|
||||
"-t",
|
||||
"--threshold",
|
||||
type=float,
|
||||
help=(
|
||||
"skip if the percent difference between two adjacent frames is below this"
|
||||
" value; set to 0 to process all frames"
|
||||
),
|
||||
default=0,
|
||||
)
|
||||
|
||||
# interpolator arguments
|
||||
interpolate = action.add_parser(
|
||||
"interpolate",
|
||||
help="interpolate frames for file",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
add_help=False,
|
||||
)
|
||||
interpolate.add_argument(
|
||||
"--help", action="help", help="show this help message and exit"
|
||||
)
|
||||
interpolate.add_argument(
|
||||
"-a",
|
||||
"--algorithm",
|
||||
choices=UPSCALING_ALGORITHMS,
|
||||
help="algorithm to use for upscaling",
|
||||
default=INTERPOLATION_ALGORITHMS[0],
|
||||
)
|
||||
interpolate.add_argument(
|
||||
"-t",
|
||||
"--threshold",
|
||||
type=float,
|
||||
help=(
|
||||
"skip if the percent difference between two adjacent frames exceeds this"
|
||||
" value; set to 100 to interpolate all frames"
|
||||
),
|
||||
default=10,
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""
|
||||
command line entrypoint for direct CLI invocation
|
||||
|
||||
:rtype int: 0 if completed successfully, else other int
|
||||
"""
|
||||
|
||||
try:
|
||||
# display version and lawful informaition
|
||||
if "--version" in sys.argv:
|
||||
print(LEGAL_INFO)
|
||||
return 0
|
||||
|
||||
# parse command line arguments
|
||||
args = parse_arguments()
|
||||
|
||||
# check input/output file paths
|
||||
if not args.input.exists():
|
||||
logger.critical(f"Cannot find input file: {args.input}")
|
||||
return 1
|
||||
elif not args.input.is_file():
|
||||
logger.critical("Input path is not a file")
|
||||
return 1
|
||||
|
||||
# set logger level
|
||||
if os.environ.get("LOGURU_LEVEL") is None:
|
||||
os.environ["LOGURU_LEVEL"] = args.loglevel.upper()
|
||||
|
||||
# remove default handler
|
||||
logger.remove()
|
||||
|
||||
# add new sink with custom handler
|
||||
logger.add(sys.stderr, colorize=True, format=LOGURU_FORMAT)
|
||||
|
||||
# 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>"
|
||||
)
|
||||
|
||||
# initialize video2x object
|
||||
video2x = Video2X()
|
||||
|
||||
if args.action == "upscale":
|
||||
video2x.upscale(
|
||||
args.input,
|
||||
args.output,
|
||||
args.width,
|
||||
args.height,
|
||||
args.noise,
|
||||
args.processes,
|
||||
args.threshold,
|
||||
args.algorithm,
|
||||
)
|
||||
|
||||
elif args.action == "interpolate":
|
||||
video2x.interpolate(
|
||||
args.input,
|
||||
args.output,
|
||||
args.processes,
|
||||
args.threshold,
|
||||
args.algorithm,
|
||||
)
|
||||
|
||||
# don't print the traceback for manual terminations
|
||||
except KeyboardInterrupt:
|
||||
return 2
|
||||
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
return 1
|
||||
|
||||
# if no exceptions were produced
|
||||
else:
|
||||
logger.success("Processing completed successfully")
|
||||
return 0
|
||||
Reference in New Issue
Block a user