203 Commits
4.0.0 ... 4.8.1

Author SHA1 Message Date
K4YT3X
095d40b688 Merge pull request #434 from k4yt3x/black
Formatted code with Black and updated README
2020-12-21 01:58:19 +00:00
K4YT3X
bd6690fed1 updated Patreon badge 2020-12-20 20:56:49 -05:00
K4YT3X
bfda833bcf formatted code with black 2020-12-19 18:11:11 -05:00
K4YT3X
09345703e6 fixed video2x ubuntu setup script paths 2020-12-15 13:05:16 -05:00
K4YT3X
64e4a41710 Merge pull request #424 from fire0shadow/anime4kcpp-import-fix
Add 'import sys' to anime4kcpp.py wrapper
2020-12-15 17:59:28 +00:00
K4YT3X
f7b8b2520a sorted imports and updated file metadata 2020-12-15 17:58:45 +00:00
K4YT3X
fad793b18e formatted build script 2020-12-15 12:56:28 -05:00
K4YT3X
d09d05ae9b fixed video2x_gui name 2020-12-15 12:55:58 -05:00
Fireshadow
89ca3b09d9 Add 'import sys' to anime4kcpp.py wrapper 2020-12-14 23:26:16 +07:00
K4YT3X
4694c557ec added a none option for -tune to address #401 2020-12-13 17:13:03 -05:00
K4YT3X
33d96bcd4e added Discord server description 2020-12-13 16:55:37 -05:00
K4YT3X
eee43def3b redirected subprocess.Popen streams to system stdout and stderr 2020-12-13 16:53:55 -05:00
K4YT3X
f4be9cc596 BiLogger now inherits io.TextIOWrapper and has a fileno attribute 2020-12-13 16:52:58 -05:00
K4YT3X
cc89b0aac5 formatted setup script with black 2020-12-13 16:39:49 -05:00
K4YT3X
9e8e95803f setup script 2.4.1: fixed Gifski setup issues and enhanced garbage cleaning 2020-12-13 16:39:13 -05:00
K4YT3X
df0861ff5c Merge pull request #411 from konqiDAM/master
fix: windows installer fixed, now uses "zipball_url" for gifski
2020-11-18 20:24:54 +00:00
K4YT3X
706aeab03f updated setup script metadata 2020-11-18 20:24:17 +00:00
konqi
f850ca80f1 fix: windows installer fixed, now uses "zipball_url" for gifski 2020-11-18 20:56:56 +01:00
K4YT3X
608bf1a2ec added a link for @Felixkruemel 's name 2020-10-26 18:24:43 -04:00
K4YT3X
b1f7290c20 update Google Colab descriptions 2020-10-26 18:22:52 -04:00
K4YT3X
65d445c293 upscaler 4.4.1: use mimetypes to re-check python-magic's results 2020-10-26 18:14:49 -04:00
K4YT3X
43dbb134b6 Merge pull request #389 from jitsuCM/arr_fix
Quick fix for special case no-upscale 1.0 upscale
2020-10-26 22:09:04 +00:00
K4YT3X
84b0684d64 apply the smallest scaling ratio available instead of 1 2020-10-26 21:53:03 +00:00
K4YT3X
29b4153b63 Merge pull request #384 from Felixkruemel/master
Added Google Colab to readme
2020-10-26 21:47:43 +00:00
K4YT3X
3f1821f1ac Merge pull request #373 from donicrosby/master
Fixed issue where if hwaccel value in config is overwritten with auto
2020-10-26 21:47:16 +00:00
K4YT3X
4f8bb1be1c setup script 2.4.0: updated FFmpeg download URL and unpacking method 2020-10-26 13:13:54 -04:00
jitsuCM
c2f1e43656 Quick fix for special case no-upscale 1.0 upscale 2020-10-22 09:21:53 +02:00
Felixkruemel
914d5cdf87 fixed blank line 2020-10-13 19:27:36 +02:00
Felixkruemel
de77c90dd1 Updated Readme.md with Google Colab integration 2020-10-13 19:26:53 +02:00
donicrosby
458ce82644 Merge branch 'master' of https://github.com/k4yt3x/video2x into master 2020-09-29 17:18:37 -04:00
donicrosby
1d145a8690 Fixed issue where if hwaccel value is set to anything other auto it would be overwritten 2020-09-29 00:51:32 -04:00
K4YT3X
b37acfa31d setup script 2.3.0: changed FFmpeg build provider from zeranoe to gyan.dev 2020-09-28 20:31:22 -04:00
K4YT3X
a0522311e2 made custom intermediate frame format available for waifu2x/srmd/realsr 2020-09-21 15:14:00 -04:00
K4YT3X
7de9cc699a Merge pull request #363 from medram/waifu2x_ncnn_vulkan_args_update
Fixed supporting jpg format for waifu2x_ncnn_vulkan by updating its arguments.
2020-09-21 19:06:42 +00:00
medram
685648957f Update waifu2x_ncnn_vulkan arguments to the latest version! 2020-09-20 21:34:20 +01:00
K4YT3X
c2260ca709 updated wordings and translations 2020-09-14 14:25:17 -04:00
K4YT3X
776475265e added generate POT file script 2020-09-13 17:10:03 -04:00
K4YT3X
21928f9eb4 commented controlled parameters for waifu2x-caffe and Gifski 2020-09-13 17:09:24 -04:00
K4YT3X
211f024e49 removed useless Gifski width/height elements in GUI 2020-09-13 17:08:34 -04:00
K4YT3X
bfdb051705 fixed global scaling variable errors and Gifski output resolution issues 2020-09-13 17:05:36 -04:00
K4YT3X
d824cd6516 added description for log file saving scheme 2020-09-13 16:43:44 -04:00
K4YT3X
b4f46ad31e enhanced logging and error reporting system 2020-09-13 16:38:44 -04:00
K4YT3X
a8d7f7ecf2 redesigned upscaler to use pillow's Lanczos filter for downscaling; bug fixes 2020-09-13 14:34:52 -04:00
K4YT3X
2b84e497b5 added pillow into requirements 2020-09-13 14:34:17 -04:00
K4YT3X
9b408a6e62 renamed labels 2020-09-13 14:33:46 -04:00
K4YT3X
ecf94490a7 fixed working directory and timing errors 2020-09-13 14:33:35 -04:00
K4YT3X
881183ed0a removed image resizing function which is no longer needed 2020-09-13 14:33:12 -04:00
K4YT3X
9389511d2d fixed bulk processing file output issues 2020-09-13 12:42:55 -04:00
K4YT3X
16389fc8a6 changed frame preview layout 2020-09-13 12:42:36 -04:00
K4YT3X
c7013b2576 redesigned upscaler class to make arbitrary scaling available for images 2020-09-13 11:07:39 -04:00
K4YT3X
a82fcc778e fixed waifu2x-caffe upscale by resolution errors and optimized upscaler code 2020-09-12 19:34:48 -04:00
K4YT3X
6dbdf93ca4 eliminated unnecessary variable upscale_begin_time 2020-09-12 17:40:17 -04:00
K4YT3X
64eb03ac08 calculate width/height automatically if the value is 0 2020-09-10 16:38:11 -04:00
K4YT3X
227cf54a47 removed all use of the walrus operator for better backwards compatibility 2020-09-10 16:19:07 -04:00
K4YT3X
107d31e5dc removed the use of shlex.join for better backwards compatibility 2020-09-10 16:15:05 -04:00
K4YT3X
04562dcaa1 allow only one of width an height to be specified 2020-09-10 13:14:36 -04:00
K4YT3X
7059852586 added arbitrary upscaling ratio/resolution support 2020-09-09 13:07:42 -04:00
K4YT3X
8b7e9f959b fixed Docker Anime4KCPP path 2020-09-04 22:04:04 -04:00
K4YT3X
19bd05149d updated Anime4KCPP build script for the latest Anime4KCPP 2020-09-04 21:48:13 -04:00
K4YT3X
a3706a1a17 fixed aria2c download directory 2020-09-04 16:56:00 -04:00
K4YT3X
5a7c464dea added Anime4KCPP into Ubuntu setup script 2020-09-04 12:26:34 -04:00
K4YT3X
6c1b49b5ed GUI 2.7.3: fixed waifu2x-caffe output quality option 2020-09-04 02:06:24 -04:00
K4YT3X
59860dcfc3 added missing source command in Docker script 2020-09-02 14:00:47 -04:00
K4YT3X
b38ce2c56d fixed gifski build issue by downloading the newest cargo directly 2020-09-02 13:54:58 -04:00
K4YT3X
68e6331672 updated GUI for the newest version of Anime4kCPP 2020-09-01 03:48:00 -04:00
K4YT3X
188a44ce38 updated Anime4KCPP driver arguments 2020-08-20 04:50:19 -04:00
K4YT3X
5621eb306a changed default extracted frames pixel format from rgba64be to rgb24 2020-08-18 06:07:46 -04:00
K4YT3X
07a6356836 Created CodeQL workflow for code security scanning 2020-08-10 22:47:53 +00:00
K4YT3X
ef4269bbcd fixed ubuntu setup script embedded script path inconsistency 2020-07-25 19:56:25 -04:00
K4YT3X
898d45e4b5 opening log file with UTF-8 encoding to avoid compatibility problems 2020-07-17 14:48:57 -04:00
k4yt3x
01493068e1 added scroll area in GUI for low-resolution displays 2020-07-01 21:02:40 -04:00
k4yt3x
e44264bb6b added output file name format string 2020-06-30 10:41:31 -04:00
K4YT3X
06355441ea using gcc/g++ 8 to provide CC/CXX for cmake via environment variable instead of linking 2020-06-13 10:53:12 -04:00
K4YT3X
9b9da1ba5a updated Docker tag version 2020-06-13 09:47:35 -04:00
K4YT3X
78fa5e8c07 removed duplicating ca-certificates package 2020-06-13 08:25:21 -04:00
K4YT3X
b2d7415a2c fixed Docker build CA error 2020-06-13 08:07:59 -04:00
K4YT3X
75d342f145 updated Docker usages in README 2020-06-13 07:51:23 -04:00
K4YT3X
fae08dfb11 fixed waifu2x-caffe pathlib not found 2020-06-13 06:47:03 -04:00
K4YT3X
a0745e2196 made all drivers change cwd to binary's parent directory to resolve fnf issues 2020-06-13 06:26:27 -04:00
K4YT3X
986619165f bind mounting host to Docker 2020-06-13 06:13:12 -04:00
K4YT3X
78b0420e07 fixing waifu2x-converter-cpp issues 2020-06-13 06:12:52 -04:00
K4YT3X
1eba4f2187 patching waifu2x-converter-cpp libw2xc.so not found issue 2020-06-13 05:09:10 -04:00
k4yt3x
6e1315f2ed updated issue templates 2020-06-11 02:00:35 -04:00
k4yt3x
29a776d049 added file descriptions for src folder 2020-06-09 08:53:17 -04:00
k4yt3x
da4bfe9827 updated disable logging switch name in README 2020-06-08 05:10:09 -04:00
k4yt3x
00c391b46c disabled purging to avoid accidental uninstallation of wanted packages 2020-06-08 03:56:19 -04:00
k4yt3x
f5eb6514e1 moved upscaler optional parameters into function definition 2020-06-08 02:36:44 -04:00
k4yt3x
3f6a3addaa updated gitignore for QtCreator files 2020-06-08 02:07:27 -04:00
k4yt3x
8f2113ab0a removed useless QtCreator file 2020-06-08 02:06:38 -04:00
k4yt3x
60cf792c23 added disable logging check box 2020-06-07 23:59:00 -04:00
k4yt3x
7e87dac15e made output extensions in batch processing customizable 2020-06-07 23:36:09 -04:00
k4yt3x
0b15fb7bd2 renamed image_format to extracted_frame_format 2020-06-07 23:35:17 -04:00
k4yt3x
765db2512b remove libvulkan1 from garbage deletion 2020-06-07 19:39:54 -04:00
k4yt3x
e14fbea67b fixing issue #289 2020-06-07 15:43:30 -04:00
k4yt3x
491f80d2d2 updated Anime4KCPP 2.0 CNN Mode support 2020-06-07 15:27:15 -04:00
K4YT3X
2f4953e6c7 updated Dockerfile for ubuntu setup script changes 2020-06-05 16:11:43 -04:00
K4YT3X
3f36cb8b43 fixing waifu2x-caffe compile issues 2020-06-05 09:12:46 -04:00
K4YT3X
3e57e206c6 added config updating Python script 2020-06-05 08:56:37 -04:00
K4YT3X
da0e47528c changed file mode for script files 2020-06-05 08:41:17 -04:00
K4YT3X
f6aac30f96 added ubuntu setup script 2020-06-05 08:40:32 -04:00
K4YT3X
7d00189f2f added Actions download login notice 2020-06-05 07:54:05 -04:00
K4YT3X
751150fe64 ignoring all python-magic errors 2020-06-05 07:14:03 -04:00
K4YT3X
eb2b62b056 removed a redundant line 2020-06-05 07:13:44 -04:00
K4YT3X
cc1b0b5464 changed file mode 2020-06-05 02:10:24 -04:00
k4yt3x
fe7ded7e53 pointing download links to the latest releases 2020-06-05 01:52:38 -04:00
k4yt3x
5f2ad35d41 fixing issue #287 2020-06-05 01:09:57 -04:00
k4yt3x
d688ca490e bumped last edited date and added comments 2020-06-04 22:13:30 -04:00
k4yt3x
708c983c1e added log file 2020-06-04 22:10:19 -04:00
K4YT3X
9b91016d98 Merge pull request #286 from ImportTaste/requirements
Adjustments to return to a single requirements.txt
2020-06-05 00:33:01 +00:00
ImportTaste
b024581906 Adjustments to return to a single requirements.txt 2020-06-04 19:25:31 -05:00
k4yt3x
8fd3292cd6 use mimetypes when python-magic binaries are not found 2020-06-04 18:46:29 -04:00
k4yt3x
e646825c57 moved apt-key statement to resolve stdout error 2020-05-31 04:00:45 -04:00
k4yt3x
fdf326108f fixing libcudnn7-dev source 2020-05-30 22:43:49 -04:00
k4yt3x
e26561c56a removing unused packages from Dockerfile and fixed a typo 2020-05-30 20:02:04 -04:00
k4yt3x
9d7c3963c3 removed some unused packages 2020-05-30 20:01:24 -04:00
k4yt3x
ce5d4051e5 setup script 2.2.1: updated regex for new waifu2x/srmd/realsr NCNN Vulkan 2020-05-30 16:11:05 -04:00
k4yt3x
9f6f1eee5b added more comments in the config file 2020-05-29 21:18:07 -04:00
k4yt3x
6ae7491652 added RealSR into descriptions and credits 2020-05-29 21:15:36 -04:00
k4yt3x
d35472fbfb added links to specials thanks usernames 2020-05-29 18:14:54 -04:00
k4yt3x
7166afdc0e updated file information and maintainer labels, added comments, changed ENTRYPOINT 2020-05-29 18:14:32 -04:00
k4yt3x
d3db4e8cf1 updated build script requirements file name 2020-05-29 16:24:22 -04:00
k4yt3x
f887dfe3a7 fixed a dash with the wrong encoding 2020-05-29 16:20:11 -04:00
k4yt3x
a41df138bf updated setup script for RealSR NCNN Vulkan and changed requirement files 2020-05-29 16:02:06 -04:00
k4yt3x
41833f4068 fixed Anime4KCPP multi-processing mishandling issue 2020-05-29 15:30:16 -04:00
K4YT3X
c0955ae7e4 updated file modes for Linux 2020-05-28 10:52:38 -04:00
K4YT3X
682aeb82ff updated GitHub Actions config for requirements file changes 2020-05-28 10:24:24 -04:00
K4YT3X
21407c831c separated Linux requirements from Windows requirements 2020-05-28 10:23:54 -04:00
k4yt3x
7e34bf7516 updated Patreon badge 2020-05-27 19:17:05 -04:00
k4yt3x
4c5ca73e38 added RealSR NCNN Vulkan support 2020-05-26 06:35:53 -04:00
k4yt3x
387a233daf added Docker cloud build status badge 2020-05-25 05:29:28 -04:00
k4yt3x
781eb6686f added Docker usage section, added @lhanjian to special thanks for writing the Dockerfile 2020-05-24 23:36:10 -04:00
k4yt3x
c73edd9001 fixed docker submodule issues, formatted Dockerfile 2020-05-24 23:09:22 -04:00
k4yt3x
deb742ee8d added a short description for each of the drivers 2020-05-24 14:26:32 -04:00
k4yt3x
5ef6eb7e8e added Dockerfile written by @lhanjian 2020-05-24 13:24:28 -04:00
k4yt3x
6c5e079a1c added a list of supported drivers into README since it is useful info 2020-05-23 10:19:18 -04:00
k4yt3x
1e384596ee Updated special thanks section 2020-05-23 09:40:17 -04:00
k4yt3x
4680647f1f removed the insignificant master version number badge 2020-05-23 09:05:31 -04:00
k4yt3x
4015db5bcf CLI 4.0.1: require input and output to be specified if help is not specified 2020-05-23 08:59:57 -04:00
k4yt3x
082c6d44fa GUI 2.4.0: added H264/265 tune option 2020-05-23 08:59:39 -04:00
k4yt3x
de841a4636 removed bold exception string to avoid formatting bugs 2020-05-23 07:41:01 -04:00
k4yt3x
40711a2711 updated translations for upscaler 4.1.1 2020-05-22 17:56:31 -04:00
k4yt3x
0c63768165 Upscaler 4.1.1: fixed python-magic detection issues, added more debug output 2020-05-22 17:56:22 -04:00
k4yt3x
ac2d447391 GUI 2.3.1: added shortcut keys 2020-05-22 17:55:55 -04:00
k4yt3x
b03747dbde updated translations after fixing typo 2020-05-22 16:30:02 -04:00
k4yt3x
89740f01dc using mimetypes as a backup mime detection method, fixed typo 2020-05-22 16:29:51 -04:00
k4yt3x
676e70f088 updated drivers tooltips 2020-05-17 16:15:38 -04:00
k4yt3x
f57b5e9d04 bumped GUI version number 2020-05-17 16:15:26 -04:00
k4yt3x
f48e23a890 ignore FileNotFoundError while clearing cache 2020-05-17 15:50:05 -04:00
k4yt3x
826b4e9829 renamed stream copy checkbox 2020-05-17 15:48:21 -04:00
k4yt3x
c56be51e21 updated output path generation logic, organized lines 2020-05-17 15:48:06 -04:00
k4yt3x
d2b3175ccd changed default output codec to yuv420p for wider compatibility, added frame interpolation comment 2020-05-17 15:47:33 -04:00
k4yt3x
a98d1c7277 added stopping confirmation 2020-05-17 10:51:17 -04:00
k4yt3x
e107ddc96e updated translations 2020-05-17 10:13:43 -04:00
k4yt3x
289f5441eb added FFmpeg frame interpolation option 2020-05-17 09:57:07 -04:00
k4yt3x
179bd6afc8 updated GUI 2.1.0 screenshot 2020-05-16 08:01:11 -04:00
k4yt3x
5af49012c8 upscaler 4.1.0: removed Anime4KCPP workaround to enable support for GIF and progress bar 2020-05-16 07:12:25 -04:00
k4yt3x
192c6ef38b setup script 2.1.0: added uninstallation option, other minor enhancements 2020-05-16 07:04:44 -04:00
k4yt3x
0b67ec879d updated Jekyll site settings 2020-05-16 06:32:49 -04:00
k4yt3x
288f21f7ce updated Jekyll config 2020-05-16 06:21:30 -04:00
k4yt3x
60af2a2782 updated mirror site information 2020-05-16 05:40:44 -04:00
k4yt3x
53aa27409e fixing Jekyll theme plugin 2020-05-16 04:00:26 -04:00
k4yt3x
ab22fb2359 changing GitHub Pages theme attempt 2 2020-05-16 03:54:07 -04:00
k4yt3x
fc18307b22 changing GitHub Pages theme 2020-05-16 03:36:58 -04:00
k4yt3x
04d598a525 CLI and GUI now displays upscaler version 2020-05-15 21:28:22 -04:00
k4yt3x
748f1e5799 updated run from source code URL 2020-05-15 21:15:03 -04:00
k4yt3x
c384bb91c4 added checkbox to ensure width and height are divisible by 2 2020-05-14 22:34:27 -04:00
k4yt3x
0882f44e1f added Gifski settings, added config filter for ffmpeg 2020-05-14 20:17:10 -04:00
k4yt3x
99abb4f6df 2.1.0: added FFmpeg Settings tab 2020-05-14 19:56:06 -04:00
k4yt3x
54f8f19c7e added input_options import for every phase 2020-05-14 19:55:52 -04:00
k4yt3x
c1c96815cf adjusted FFmpeg options and added comments 2020-05-14 19:55:25 -04:00
k4yt3x
98a7fbf9cb fixed FFmpeg configuration key 2020-05-13 02:43:22 -04:00
k4yt3x
f2ba6033b7 added locale into pyinstaller packages 2020-05-13 02:42:56 -04:00
k4yt3x
f92d1a41a2 moved FFprobe general options before input and output options 2020-05-12 21:23:26 -04:00
k4yt3x
1b6c4b8c49 renamed FFmpeg phase names to match FFmpeg wrapper function names 2020-05-12 21:11:30 -04:00
k4yt3x
9b4ee89aee added FFmpeg Settings tab and Tools tab and FFprobe tool 2020-05-12 20:31:58 -04:00
k4yt3x
0953fc52a1 made image format optional 2020-05-12 20:31:39 -04:00
k4yt3x
759a3c7c96 updated FFmpeg parameters, moved debug info 2020-05-12 20:30:59 -04:00
k4yt3x
786ccaa610 upon stream migration fails, move intermediate file instead of copy 2020-05-12 19:27:37 -04:00
k4yt3x
0c3c136458 fixing issue #249 by @GitGerby 2020-05-12 19:25:39 -04:00
k4yt3x
1be2c1ead7 fixed pyinstaller 7z unpacking issues, replaced pyunpack with patoolib 2020-05-12 06:31:18 -04:00
k4yt3x
180bfcab20 added 7z files for pyinstaller 2020-05-12 06:30:49 -04:00
k4yt3x
0cc67857f7 changed setup script pyunpack to patoolib 2020-05-12 05:50:08 -04:00
k4yt3x
e07848f4bf updated GUI and CLI screenshots 2020-05-12 04:47:00 -04:00
k4yt3x
379d699c0d added patool hidden import for setup script 2020-05-12 04:39:24 -04:00
k4yt3x
e6702d4486 removed "recent change" as this info will be available in releases 2020-05-12 04:31:22 -04:00
k4yt3x
8f5edb720e updated translations 2020-05-12 04:30:04 -04:00
k4yt3x
b27e9b1fa5 added line breaks before image captions 2020-05-12 04:18:20 -04:00
k4yt3x
0b72236d95 added nightly build information, updated some other fields 2020-05-12 04:15:02 -04:00
k4yt3x
fdb813d6d6 moved build.yml to nightly.yml 2020-05-12 03:42:48 -04:00
k4yt3x
417dfc5deb changed nightly build workflow name 2020-05-12 03:42:13 -04:00
k4yt3x
12673f1c37 added pywin32 to fix build issues, renamed artifacts 2020-05-12 03:31:34 -04:00
k4yt3x
f7d8d551b3 corrected nightly build path 2020-05-12 03:23:17 -04:00
k4yt3x
9cbb213e55 added artifact collecting and uploading 2020-05-12 03:16:28 -04:00
k4yt3x
181e5c94e6 fixed path error for requirements.txt 2020-05-12 02:43:44 -04:00
k4yt3x
37547d1233 changed workflow default working directory 2020-05-12 02:40:55 -04:00
k4yt3x
8368cb1f49 replaced workflow forward slash with grave accent 2020-05-12 02:29:44 -04:00
k4yt3x
9643c96ed7 updated workflow to eliminate unix shell syntax 2020-05-12 02:26:07 -04:00
K4YT3X
1c5bf1604f Create build.yml 2020-05-12 06:18:24 +00:00
k4yt3x
23cfba86f8 updated GIF and image upscale examples 2020-05-11 22:41:06 -04:00
k4yt3x
0ef0d6e161 updated banner and social preview PSD file 2020-05-11 22:02:47 -04:00
k4yt3x
4e43ff9086 fixed Anime4KCPP attribute issue 2020-05-11 21:01:09 -04:00
k4yt3x
a93d18eb09 updated logo and banner 2020-05-11 21:00:55 -04:00
k4yt3x
e305d0188e added image and GIF upscale support 2020-05-11 20:24:18 -04:00
58 changed files with 8206 additions and 3109 deletions

View File

@@ -7,26 +7,20 @@ assignees: K4YT3X
---
## Environment Information
## Component Versions
|Module|Version|
|-|-|
|`Video2X`||
|`FFmpeg`||
|`waifu2x-caffe`||
|`waifu2x-converter-cpp`||
|`waifu2x-ncnn-vulkan`||
Please at least fill in the release version and GUI or CLI version.
- **Video2X release version**:
- **Upscaler version**:
- **GUI version**:
- **CLI version**:
## Symptom
Briefly describe what's going on.
In this section, briefly describe what's going on.
## Screenshots or Error Messages
## Error Log or Screenshots
Please paste screenshots or error messages here.
Include as much details as you can, as this greatly helps debugging the problem.
Please paste your error message in the code block down below:
```
```
Please upload or paste the error log here. You may also include screenshots.
**It is highly recommended to include your error log.**

View File

@@ -9,7 +9,7 @@ assignees: K4YT3X
## Description
Briefly describe the feature you want to be added into `video2x`.
Briefly describe the feature that you'd like Video2X to have.
## Sources

54
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
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 Normal file
View File

@@ -0,0 +1,69 @@
# 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/

3
.gitignore vendored
View File

@@ -1,3 +1,6 @@
# QtCreator
video2x_gui.pyproject.user
# PyCharm
.idea/

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# Name: Video2X Dockerfile
# Creator: Danielle Douglas
# Date Created: Unknown
# Last Modified: January 14, 2020
# Editor: Lhanjian
# Last Modified: May 24, 2020
# 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
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 /
WORKDIR /host
ENTRYPOINT ["python3.8", "/video2x/src/video2x.py"]
ENV NVIDIA_DRIVER_CAPABILITIES all
ENV DEBIAN_FRONTEND teletype

203
README.md
View File

@@ -1,43 +1,92 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/21986859/81489504-c7d1f780-9265-11ea-86c8-cc0316e2082d.png"/>
<img src="https://user-images.githubusercontent.com/21986859/81626588-ae5ab800-93eb-11ea-918f-ebe98c2de40a.png"/>
</p>
![Master Branch Version](https://img.shields.io/badge/master-v4.0.0-9cf?style=flat-square)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/k4yt3x/video2x?style=flat-square)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/k4yt3x/video2x/Video2X%20Nightly%20Build?label=Nightly&style=flat-square)
![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/k4yt3x/video2x?style=flat-square)
![GitHub All Releases](https://img.shields.io/github/downloads/k4yt3x/video2x/total?style=flat-square)
![GitHub](https://img.shields.io/github/license/k4yt3x/video2x?style=flat-square)
![Platforms](https://img.shields.io/badge/Platforms-Windows%20%7C%20Linux%20%7C%20macOS-blue?style=flat-square)
<img alt="Become a Patron!"
src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png"
href="https://www.patreon.com/bePatron?u=34970782"
height=20 />
![Become A Patron!](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)
<!--# Video2X Lossless Video Enlarger-->
### Official Discussion Group (Telegram): https://t.me/video2x
## [Download Builds](https://github.com/k4yt3x/video2x/releases) (Windows)
A [Discord server](https://discord.gg/Pwf6Ht) is also available. Please note that most developers are only on Telegram. If you join the Discord server, the developers might not be able to see your questions and help you. It is mostly for user-user interactions and those who do not want to use Telegram.
You can go to the [releases page](https://github.com/k4yt3x/video2x/releases) to download the latest builds of Video2X. The exe files will require no Python or Python module installation. There are two editions available.
## [Download Stable/Beta Builds](https://github.com/k4yt3x/video2x/releases/latest) (Windows)
- **`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.
Go to the [Quick Start](#quick-start) section for usages.
Go to the **[Quick Start](#quick-start)** section for usages.
### [Download From Mirror](https://files.k4yt3x.com/Projects/Video2X/latest)
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.
## [Download Nightly Builds](https://github.com/k4yt3x/video2x/actions) (Windows)
**You need to be logged into GitHub to be able to download GitHub Actions artifacts.**
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.
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).
## [Google Colab](https://colab.research.google.com/drive/1xqeZvoJXaBBPP6UyVwErnhwrnth0br0u)
You can use Video2X on [Google Colab](https://colab.research.google.com/) for free. Colab allows you too use a GPU on Google's Servers (Tesla K80, T4, P4, P100). Please bare in mind that Colab can only be provided for free if all users know that they shouldn't abuse it. A single free-tier tier session can last up to 12 hours. Please do not abuse the platform by creating sessions back-to-back and running upscaling 24/7. This might result in you getting banned.
Here is an exmaple Notebook written by [@Felixkruemel](https://github.com/Felixkruemel): [Video2X_on_Colab.ipynb](https://colab.research.google.com/drive/1xqeZvoJXaBBPP6UyVwErnhwrnth0br0u). This file can be used in combination of the following modified configuration file: [@Felixkruemel's Video2X configuration for Google Colab](https://gist.githubusercontent.com/Felixkruemel/71e62de4bb38965ead2e0f4bae7ef4ee/raw/video2x.yaml).
## Introduction
Video2X is a video upscaling software based on Waifu2X, Anime4K and SRMD written in Python 3. It upscales videos and restores details from low-resolution videos. Below is a side-by-side preview.
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.
![Spirited Away Demo](https://user-images.githubusercontent.com/21986859/49412428-65083280-f73a-11e8-8237-bb34158a545e.png)
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
### Video Upscaling
![Spirited Away Demo](https://user-images.githubusercontent.com/21986859/49412428-65083280-f73a-11e8-8237-bb34158a545e.png)\
*Upscale Comparison Demonstration*
**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.
## Demo Videos
### 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](https://user-images.githubusercontent.com/21986859/81631069-96d4fc80-93f6-11ea-92fb-33d6545055e7.gif)\
*Catfru original 160x120 GIF image*
Below is what it looks like after getting upscaled to 640x480 (4x) using Video2X.
![catfru4x](https://user-images.githubusercontent.com/21986859/81631070-976d9300-93f6-11ea-9137-072a3b386110.gif)\
*Catfru 4x upscaled GIF*
### Image Upscaling
![jill_comparison](https://user-images.githubusercontent.com/21986859/81631903-79a12d80-93f8-11ea-9c3c-f340240cf08c.png)\
*Image upscaling example*
[Original image](https://72915.tumblr.com/post/173793265673) from [nananicu@twitter](https://twitter.com/nananicu/status/994546266968281088), edited by K4YT3X.
## All Demo Videos
Below is a list of all the demo videos available.
The list is sorted from new to old.
@@ -54,52 +103,27 @@ The list is sorted from new to old.
- YouTube: https://youtu.be/mGEfasQl2Zo
- Bilibili: https://www.bilibili.com/video/BV1V5411471i/
---
## Screenshots
### Video2X GUI
![GUI Preview](https://user-images.githubusercontent.com/21986859/81546668-3bf5c380-936a-11ea-9583-c969ea0d862b.png)
![GUI Preview](https://user-images.githubusercontent.com/21986859/82119295-bc526500-976c-11ea-9ea8-53264689023e.png)\
*Video2X GUI Screenshot*
### Video2X CLI
![Video2X CLI Screenshot](https://user-images.githubusercontent.com/21986859/81039711-4fe88380-8e99-11ea-9846-175f72100a76.png)
![Video2X CLI Screenshot](https://user-images.githubusercontent.com/21986859/81662415-0c5bbf80-942d-11ea-8aa6-aacf813f9368.png)\
*Video2X CLI Screenshot*
---
## 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.
### [Run From Source](https://github.com/k4yt3x/video2x/wiki/Run-From-Source)
Instructions for how to run this program from source code.
### [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.
### [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.
---
### 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_video](https://user-images.githubusercontent.com/21986859/52905766-d5512b00-3236-11e9-9aea-077636539679.png)
![sample_video](https://user-images.githubusercontent.com/21986859/52905766-d5512b00-3236-11e9-9aea-077636539679.png)\
*Sample Upscale Videos*
- [Sample Video (240P) 4.54MB](https://files.k4yt3x.com/Resources/Videos/sample_input.mp4)
@@ -126,19 +150,23 @@ Before running Video2X, you'll need to ensure you have installed the drivers' ex
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](https://user-images.githubusercontent.com/21986859/81489846-28633380-926a-11ea-9e81-fb92f492e14c.png)
![Video2X Release Files](https://user-images.githubusercontent.com/21986859/81489846-28633380-926a-11ea-9e81-fb92f492e14c.png)\
*Video2X release files*
Simply double click on video2x_gui.exe to launch the GUI.
![Video2X GUI Main Tab](https://user-images.githubusercontent.com/21986859/81489858-4c267980-926a-11ea-9ab2-38ec738f2fb6.png)
![Video2X GUI Main Tab](https://user-images.githubusercontent.com/21986859/81489858-4c267980-926a-11ea-9ab2-38ec738f2fb6.png)\
*Video2X GUI main tab*
Then, drag the videos you wish to upscale into the window and select the appropriate output path.
![drag-drop](https://user-images.githubusercontent.com/21986859/81489880-7bd58180-926a-11ea-85ae-b72d2f4f5e72.png)
![drag-drop](https://user-images.githubusercontent.com/21986859/81489880-7bd58180-926a-11ea-85ae-b72d2f4f5e72.png)\
*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.
![upscale-started](https://user-images.githubusercontent.com/21986859/81489924-ce16a280-926a-11ea-831c-6c66b950f957.png)
![upscale-started](https://user-images.githubusercontent.com/21986859/81489924-ce16a280-926a-11ea-831c-6c66b950f957.png)\
*Video2X started processing input files*
### Running Video2X (CLI)
@@ -166,77 +194,41 @@ To see a help page for driver-specific settings, use `-d` to select the driver a
python video2x.py -d waifu2x_caffe -- --help
```
---
### Running Video2X (Docker)
## Recent Changes
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).
### 4.0.0 (May 5, 2020)
- Added internationalization support
- Added language zh_CN (简体中文)
- Language will change automatically according to system locale settings
- Added support for [Anime4KCPP](https://github.com/TianZerL/Anime4KCPP) in replacement for Anime4K (Java)
- Driver-specific settings can now be specified in the command line by specifying them after a `--`
- All driver-specific settings are parsed by the corresponding driver
- Modularized driver wrappers in Video2X
- Cleaned up some clutters in the code
### 3.2.0 (April 26, 2020)
- Added support for [SRMD-NCNN-Vulkan](https://github.com/nihui/srmd-ncnn-vulkan)
### 3.1.0 (February 26, 2020)
- Removed the redundant layer of multi-threading since multi-process has to be implemented for launching Windows PE files in sub-processes
- Added support for graceful exit upon `KeyboardInterrupt` or termination signals
- Other minor improvements such as replacing `' '.join(execute)` with `shlex.join(execute)`
### Setup Script 1.8.0 (May 5, 2020)
- Added support for Anime4KCPP
```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
```
---
# Full Usage
## Documentations
## Video2X Options
### [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki)
### -h, --help
show this help message and exit
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.
### -i INPUT, --input INPUT
source video file/directory
### [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial)
### -o OUTPUT, --output OUTPUT
output video file/directory
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.
### -c CONFIG, --config CONFIG
video2x config file path
### [Run From Source Code](https://github.com/k4yt3x/video2x/wiki/Run-From-Source-Code)
### -v, --version
display version, lawful information and exit
This wiki page contains all instructions for how you can run Video2X directly from Python source code.
## Upscaling Options
### [Drivers](https://github.com/k4yt3x/video2x/wiki/Drivers)
### -d DRIVER, --driver DRIVER
upscaling driver (default: waifu2x_caffe)
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.
Available options are:
### [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A)
- waifu2x_caffe
- waifu2x_converter_cpp
- waifu2x_ncnn_vulkan
- srmd_ncnn_vulkan
- anime4kcpp
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.
### -r RATIO, --ratio RATIO
scaling ratio
### [History](https://github.com/k4yt3x/video2x/wiki/History)
### -p PROCESSES, --processes PROCESSES
number of processes to use for upscaling (default: 1)
### --preserve_frames
preserve extracted and upscaled frames (default: False)
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.
---
@@ -258,14 +250,19 @@ This project relies on the following software and projects.
- [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)
## Special Thanks
Appreciations given to the following code contributors:
Appreciations given to the following personnel who have contributed significantly to the project (specifically the technical perspective).
- @BrianPetkovsek
- @SAT3LL
- [@BrianPetkovsek](https://github.com/BrianPetkovsek)
- [@sat3ll](https://github.com/sat3ll)
- [@ddouglas87](https://github.com/ddouglas87)
- [@lhanjian](https://github.com/lhanjian)
## Related Projects

View File

@@ -1 +1,20 @@
theme: jekyll-theme-slate
# 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

21
src/README.md Normal file
View File

@@ -0,0 +1,21 @@
# 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

45
src/bilogger.py Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Creator: Video2X Bidirectional Logger
Author: K4YT3X
Date Created: June 4, 2020
Last Modified: December 13, 2020
"""
# built-in imports
import io
class BiLogger(io.TextIOWrapper):
"""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, log_file: io.BufferedRandom):
"""initialize BiLogger
Args:
terminal (_io.TextIOWrapper): original terminal IO wrapper
logfile (_io.BufferedRandom): log file wrapper
"""
self.terminal = terminal
self.log_file = log_file
self.fileno = self.log_file.fileno
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_file.write(message)
self.log_file.flush()
def flush(self):
"""flush logger (for compability only)"""
pass

12
src/build.ps1 Normal file → Executable file
View File

@@ -2,17 +2,17 @@
Name: Video2X Build Script
Creator: K4YT3X
Date Created: May 6, 2020
Last Modified: May 7, 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
powershell -ExecutionPolicy Bypass
#>
if ($args.count -ne 1){
if ($args.count -ne 1) {
Write-Host -ForegroundColor White "Usage:`n .\build.ps1 VIDEO2X_VERSION"
Exit
}
@@ -29,6 +29,7 @@ Building Video2X release $($VIDEO2X_VERSION)"
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
@@ -48,6 +49,9 @@ pyinstaller --noconfirm --log-level=WARN `
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
@@ -84,7 +88,7 @@ Copy-Item "requirements.txt" -Destination "$($VIDEO2X_VERSION)\video2x-$($VIDEO2
Write-Host -ForegroundColor White "`nDeleting temporary files"
$pathsToRemove = "__pycache__", "build", "dist", "*.spec"
foreach ($path in $pathsToRemove){
foreach ($path in $pathsToRemove) {
Write-Host "Removing path: $($path)"
Remove-Item -path $path -recurse
}

14
src/generate_pot.ps1 Normal file
View File

@@ -0,0 +1,14 @@
<#
Name: Video2X Generate POT Script
Creator: K4YT3X
Date Created: September 12, 2020
Last Modified: September 12, 2020
Description: A PowerShell script that uses Python's pygettext
script to generate the POT file for translations.
To start a PowerShell session with execution policy bypass
powershell -ExecutionPolicy Bypass
#>
python $env:LOCALAPPDATA\Programs\Python\Python38\Tools\i18n\pygettext.py -d video2x *.py wrappers\*.py

View File

@@ -22,7 +22,7 @@ import time
class ImageCleaner(threading.Thread):
""" Video2X Image Cleaner
"""Video2X Image Cleaner
This class creates an object that keeps track of extracted
frames that has already been upscaled and are not needed
@@ -40,8 +40,7 @@ class ImageCleaner(threading.Thread):
self.running = False
def run(self):
""" Run image cleaner
"""
"""Run image cleaner"""
self.running = True
while self.running:
@@ -49,13 +48,12 @@ class ImageCleaner(threading.Thread):
time.sleep(1)
def stop(self):
""" Stop the image cleaner
"""
"""Stop the image cleaner"""
self.running = False
self.join()
def remove_upscaled_frames(self):
""" remove frames that have already been upscaled
"""remove frames that have already been upscaled
This method compares the files in the extracted frames
directory with the upscaled frames directory, and removes

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-05-11 04:39-0400\n"
"PO-Revision-Date: 2020-05-11 04:40-0400\n"
"POT-Creation-Date: 2020-09-14 14:24-0400\n"
"PO-Revision-Date: 2020-09-14 14:24-0400\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n"
@@ -14,264 +14,399 @@ msgstr ""
"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"
"X-Generator: Poedit 2.4.1\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: progress_monitor.py:42
msgid "Upscaling Progress"
msgstr "放大进度"
#: progress_monitor.py:37
msgid "Processing: {} (pass {}/{})"
msgstr "正在处理:{}进度"
#: upscaler.py:104
#: upscaler.py:149
msgid "Specified or default cache directory is a file/link"
msgstr "指定或默认的缓存目录是文件/链接"
#: upscaler.py:110
#: upscaler.py:155
msgid "Creating cache directory {}"
msgstr "创建缓存目录 {}"
#: upscaler.py:113
#: upscaler.py:158
msgid "Unable to create {}"
msgstr "无法创建 {}"
#: upscaler.py:118
#: upscaler.py:163
msgid "Extracted frames are being saved to: {}"
msgstr "提取的帧将被保存到:{}"
#: upscaler.py:120
#: upscaler.py:165
msgid "Upscaled frames are being saved to: {}"
msgstr "已放大的帧将被保存到:{}"
#: upscaler.py:130
#: upscaler.py:175
msgid "Cleaning up cache directory: {}"
msgstr "清理缓存目录:{}"
#: upscaler.py:133
#: upscaler.py:180
msgid "Unable to delete: {}"
msgstr "无法删除:{}"
#: upscaler.py:139 upscaler.py:154 upscaler.py:165
#: upscaler.py:186 upscaler.py:201 upscaler.py:212
msgid "Input and output path type mismatch"
msgstr "输入和输出路径类型不匹配"
#: upscaler.py:140
#: upscaler.py:187
msgid "Input is multiple files but output is not directory"
msgstr "输入是多个文件,但输出不是目录"
#: upscaler.py:144
#: upscaler.py:191
msgid "Input path {} is neither a file nor a directory"
msgstr "输入路径 {} 既不是文件也不是目录"
#: upscaler.py:148 upscaler.py:170
#: upscaler.py:195 upscaler.py:217
msgid "Input directory and output directory cannot be the same"
msgstr "输入目录和输出目录不能相同"
#: upscaler.py:155
#: upscaler.py:202
msgid "Input is single file but output is directory"
msgstr "所选的输入路径是单个文件,但输出路径是目录"
#: upscaler.py:158
#: upscaler.py:205
msgid "No suffix found in output file path"
msgstr "在输出文件路径中未找到后缀"
#: upscaler.py:159
msgid "Suffix must be specified for FFmpeg"
msgstr "必须为 FFmpeg 指定后缀"
#: upscaler.py:206
msgid "Suffix must be specified"
msgstr "必须指定文件后缀"
#: upscaler.py:166
#: upscaler.py:213
msgid "Input is directory but output is existing single file"
msgstr "输入是目录,但输出是现有的单个文件"
#: upscaler.py:175
#: upscaler.py:222
msgid "Input path is neither a file nor a directory"
msgstr "输入路径既不是文件也不是目录"
#: upscaler.py:184
#: upscaler.py:231
msgid "FFmpeg or FFprobe cannot be found under the specified path"
msgstr "在指定的路径下找不到 FFmpeg 或 FFprobe"
#: upscaler.py:185 upscaler.py:195
#: upscaler.py:232 upscaler.py:242
msgid "Please check the configuration file settings"
msgstr "请检查配置文件设置"
#: upscaler.py:194
#: upscaler.py:241
msgid "Specified driver executable directory doesn't exist"
msgstr "指定驱动的可执行文件不存在"
#: upscaler.py:221
#: upscaler.py:268
msgid "Failed to parse driver argument: {}"
msgstr "解析驱动程序参数失败:{}"
#: upscaler.py:253
#: upscaler.py:288
msgid "Unrecognized driver: {}"
msgstr "无法识别的驱动名称:{}"
#: upscaler.py:293
#: upscaler.py:328
msgid "Starting progress monitor"
msgstr "启动进度监视器"
#: upscaler.py:298
#: upscaler.py:333
msgid "Starting upscaled image cleaner"
msgstr "启动已放大图像清理程序"
#: upscaler.py:307 upscaler.py:324
#: upscaler.py:342 upscaler.py:359
msgid "Killing progress monitor"
msgstr "终结进度监视器"
#: upscaler.py:310 upscaler.py:327
#: upscaler.py:345 upscaler.py:362
msgid "Killing upscaled image cleaner"
msgstr "终结已放大图像清理程序"
#: upscaler.py:331
#: upscaler.py:366
msgid "Terminating all processes"
msgstr "正在终止所有进程"
#: upscaler.py:338
#: upscaler.py:373
msgid "Main process waiting for subprocesses to exit"
msgstr "主进程开始等待子进程结束"
#: upscaler.py:357 upscaler.py:361
#: upscaler.py:392 upscaler.py:396
msgid "Subprocess {} exited with code {}"
msgstr "子进程 {} 结束,返回码 {}"
#: upscaler.py:367
#: upscaler.py:402
msgid "Stop signal received"
msgstr "收到停止信号"
#: upscaler.py:372
#: upscaler.py:407
msgid "Subprocess execution ran into an error"
msgstr "子进程执行遇到错误"
#: upscaler.py:421
msgid "Upscaling single video file: {}"
msgstr "放大单个视频文件:{}"
#: upscaler.py:437
msgid "Loading files into processing queue"
msgstr "正在将文件添加到处理队列中"
#: upscaler.py:443 upscaler.py:502
msgid "Starting to upscale extracted images"
msgstr "开始对提取的帧进行放大"
#: upscaler.py:438
msgid "Input path(s): {}"
msgstr "输入路径:{}"
#: upscaler.py:448 upscaler.py:504
msgid "Upscaling completed"
msgstr "放大完成"
#: upscaler.py:484
msgid "File MIME type: {}"
msgstr "文件 MIME 类型:{}"
#: upscaler.py:457
msgid "Reading video information"
msgstr "读取视频信息"
#: upscaler.py:500
msgid "File {} ({}) neither an image nor a video"
msgstr "文件 {} {} 既不是图片也不是视频"
#: upscaler.py:471
#: upscaler.py:501
msgid "Skipping this file"
msgstr "将跳过此文件"
#: upscaler.py:526
msgid "Loaded files into processing queue"
msgstr "文件已添加到处理队列"
#: upscaler.py:529
msgid "Input file: {}"
msgstr "输入文件:{}"
#: upscaler.py:541
msgid "Reading file information"
msgstr "正在读取视频信息"
#: upscaler.py:550
msgid "Starting upscaling image"
msgstr "开始放大图像"
#: upscaler.py:561
msgid "Starting upscaling video/GIF"
msgstr "开始放大视频/GIF"
#: upscaler.py:572
msgid "Aborting: No video stream found"
msgstr "程序中止:文件中未找到视频流"
#: upscaler.py:490
msgid "Unsupported pixel format: {}"
msgstr "不支持的像素格式:{}"
#: upscaler.py:581
msgid "Getting total number of frames in the file"
msgstr "正在获取文件中的总帧数"
#: upscaler.py:493
#: upscaler.py:592
msgid "Calculating scaling parameters"
msgstr "正在计算缩放参数"
#: upscaler.py:656
msgid "Framerate: {}"
msgstr "帧率:{}"
#: upscaler.py:507
msgid "Converting extracted frames into video"
msgstr "正在将提取的帧转换为视频"
#: upscaler.py:657
msgid "Width: {}"
msgstr "宽:{}"
#: upscaler.py:514
#: upscaler.py:658
msgid "Height: {}"
msgstr "高:{}"
#: upscaler.py:659
msgid "Total number of frames: {}"
msgstr "总帧数:{}"
#: upscaler.py:660
msgid "Output width: {}"
msgstr "输出宽度:{}"
#: upscaler.py:661
msgid "Output height: {}"
msgstr "输出高度:{}"
#: upscaler.py:662
msgid "Required scale ratio: {}"
msgstr "需要的缩放比例:{}"
#: upscaler.py:663
msgid "Upscaling jobs queue: {}"
msgstr "放大工作队列:{}"
#: upscaler.py:680
msgid "Unsupported pixel format: {}"
msgstr "不支持的像素格式:{}"
#: upscaler.py:684
msgid "Starting to upscale extracted frames"
msgstr "开始对提取的帧进行放大"
#: upscaler.py:701
msgid "Upscaling completed"
msgstr "放大完成"
#: upscaler.py:702
msgid "Average processing speed: {} seconds per frame"
msgstr "平均处理速度:{} 秒每帧"
#: upscaler.py:705
msgid "Lanczos downscaling frames"
msgstr "正在使用 Lanczos 算法缩放图像"
#: upscaler.py:710
msgid "Downscaling"
msgstr "正在缩放图像"
#: upscaler.py:729
msgid "Exporting image"
msgstr "正在导出图像"
#: upscaler.py:739
msgid "Converting extracted frames into GIF image"
msgstr "正在将提取的帧转换为 GIF"
#: upscaler.py:743 upscaler.py:752
msgid "Conversion completed"
msgstr "转换已完成"
#: upscaler.py:518
#: upscaler.py:748
msgid "Converting extracted frames into video"
msgstr "正在将提取的帧转换为视频"
#: upscaler.py:756
msgid "Migrating audio, subtitles and other streams to upscaled video"
msgstr "正在将音频、字幕和其他流迁移到放大后的视频"
#: upscaler.py:527
#: upscaler.py:766
msgid "Failed to migrate streams"
msgstr "迁移流失败"
#: upscaler.py:528
#: upscaler.py:767
msgid "Trying to output video without additional streams"
msgstr "正在尝试输出不含其他流的视频"
#: upscaler.py:535
msgid "Output video file exists, aborting"
msgstr "输出目标文件已存在,取消输出"
#: upscaler.py:783
msgid "Output video file exists"
msgstr "输出目标文件已存在"
#: upscaler.py:539
#: upscaler.py:787
msgid "Created temporary directory to contain file"
msgstr "为文件创建了临时目录"
#: upscaler.py:790
msgid "Writing intermediate file to: {}"
msgstr "正在将中间视频文件写入至:{}"
#: video2x.py:84
#: video2x.py:85
msgid ""
"Video2X Version: {}\n"
"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:106
#: video2x.py:108
msgid "Video2X Options"
msgstr "Video2X 选项"
#: video2x.py:107
#: video2x.py:109
msgid "show this help message and exit"
msgstr "显示此帮助消息并退出"
#: video2x.py:108
#: video2x.py:116
msgid "source video file/directory"
msgstr "源视频文件/目录"
#: video2x.py:109
#: video2x.py:117
msgid "output video file/directory"
msgstr "输出视频文件/目录"
#: video2x.py:110
msgid "video2x config file path"
msgstr "video2x 配置文件路径"
#: video2x.py:119
msgid "Video2X config file path"
msgstr "Video2X 配置文件路径"
#: video2x.py:112
#: video2x.py:121
msgid "log file path"
msgstr "日志文件路径"
#: video2x.py:122
msgid "display version, lawful information and exit"
msgstr "显示版本和法律信息并退出"
#: video2x.py:115
#: video2x.py:125
msgid "Upscaling Options"
msgstr "视频放大选项"
#: video2x.py:116
msgid "upscaling driver"
msgstr "视频放大驱动"
#: video2x.py:117
#: video2x.py:126
msgid "scaling ratio"
msgstr "缩放比"
#: video2x.py:118
#: video2x.py:127
msgid "output width"
msgstr "输出宽度"
#: video2x.py:128
msgid "output height"
msgstr "输出高度"
#: video2x.py:129
msgid "upscaling driver"
msgstr "视频放大驱动"
#: video2x.py:130
msgid "number of processes to use for upscaling"
msgstr "并发进程数"
#: video2x.py:119
#: video2x.py:131
msgid "preserve extracted and upscaled frames"
msgstr "保留提取的和放大的帧"
#: video2x.py:159
#: video2x.py:171
msgid "This file cannot be imported"
msgstr "此文件无法被当作模块导入"
#: video2x.py:229
#: video2x.py:187
msgid "Specify either scaling ratio or scaling resolution, not both"
msgstr "您只能指定缩放比或输出分辨率两者之一"
#: video2x.py:273
msgid "Program completed, taking {} seconds"
msgstr "程序执行完毕,总计花费 {} 秒"
#: video2x.py:232
#: video2x.py:277
msgid "An exception has occurred"
msgstr "发生了异常"
#~ msgid "output video width"
#~ msgstr "输出视频宽度"
#: video2x.py:292
msgid "The error log file can be found at: {}"
msgstr "错误日志已被保存到:{}"
#~ msgid "output video height"
#~ msgstr "输出视频高度"
#~ msgid "disable logging"
#~ msgstr "禁用日志"
#~ msgid "Only one of scaling width and scaling height is specified"
#~ msgstr "输出高度和宽度仅有其中一项被指定"
#~ msgid "Redirecting console logs to {}"
#~ msgstr "将控制台日志重定向到 {}"
#~ msgid "Upscaling Progress"
#~ msgstr "放大进度"
#~ msgid "Loading files from multiple paths"
#~ msgstr "正在从多个路径中导入文件"
#~ msgid "Loading single file"
#~ msgstr "正在导入单个文件"
#~ msgid "Loading files from directory"
#~ msgstr "正在从文件夹中导入文件"
#~ msgid "Anime4KCPP doesn't yet support GIF processing"
#~ msgstr "Anime4KCPP 尚不支持GIF处理"
#~ msgid "Starting to upscale video with Anime4KCPP"
#~ msgstr "开始用 Anime4KCPP 放大视频"
#~ msgid "You must specify input video file/directory path"
#~ msgstr "您必须指定输入视频文件/目录路径"
@@ -288,11 +423,5 @@ msgstr "发生了异常"
#~ 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 "您必须同时指定宽度和高度"
#~ msgid "Upscaling videos in directory: {}"
#~ msgstr "放大该文件夹中的所有视频:{}"

29
src/progress_monitor.py Normal file → Executable file
View File

@@ -2,9 +2,9 @@
# -*- coding: utf-8 -*-
"""
Name: Video2X Upscale Progress Monitor
Author: BrianPetkovsek
Author: K4YT3X
Date Created: May 7, 2020
Last Modified: May 10, 2020
Last Modified: September 9, 2020
"""
# built-in imports
@@ -17,7 +17,7 @@ from tqdm import tqdm
class ProgressMonitor(threading.Thread):
""" progress monitor
"""progress monitor
This class provides progress monitoring functionalities
by keeping track of the amount of frames in the input
@@ -34,12 +34,15 @@ class ProgressMonitor(threading.Thread):
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.image_format.lower())])
with tqdm(total=self.upscaler.total_frames, ascii=True, desc=_('Upscaling Progress')) as progress_bar:
with tqdm(
total=self.upscaler.total_frames,
ascii=True,
desc=_("Processing: {} (pass {}/{})").format(
self.upscaler.current_input_file.name,
self.upscaler.current_pass,
len(self.upscaler.scaling_jobs),
),
) 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.
@@ -47,7 +50,13 @@ class ProgressMonitor(threading.Thread):
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.image_format.lower())]
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)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,85 @@
.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.

View File

@@ -0,0 +1,211 @@
.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.

View File

@@ -0,0 +1,84 @@
.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>

View File

@@ -0,0 +1,211 @@
.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"

View File

@@ -0,0 +1,67 @@
; 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="*"

View File

@@ -0,0 +1,67 @@
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"="*"

View File

@@ -0,0 +1,67 @@
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.

View File

@@ -0,0 +1,31 @@
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/

View File

@@ -0,0 +1,111 @@
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

View File

@@ -0,0 +1,124 @@
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.

View File

@@ -0,0 +1,80 @@
# -----------------------------------------------------------------------------
# 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",
]

View File

@@ -1,9 +1,10 @@
avalon_framework
colorama
patool
psutil
pillow
pyqt5
pyunpack
python-magic-bin; platform_system == "Windows"
python-magic; platform_system != "Windows"
pyyaml
requests
tqdm

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2020-05-11 04:39-0400\n"
"POT-Creation-Date: 2020-09-14 14:24-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"
@@ -15,248 +15,361 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
#: progress_monitor.py:42
msgid "Upscaling Progress"
#: progress_monitor.py:37
msgid "Processing: {} (pass {}/{})"
msgstr ""
#: upscaler.py:104
#: upscaler.py:149
msgid "Specified or default cache directory is a file/link"
msgstr ""
#: upscaler.py:110
#: upscaler.py:155
msgid "Creating cache directory {}"
msgstr ""
#: upscaler.py:113
#: upscaler.py:158
msgid "Unable to create {}"
msgstr ""
#: upscaler.py:118
#: upscaler.py:163
msgid "Extracted frames are being saved to: {}"
msgstr ""
#: upscaler.py:120
#: upscaler.py:165
msgid "Upscaled frames are being saved to: {}"
msgstr ""
#: upscaler.py:130
#: upscaler.py:175
msgid "Cleaning up cache directory: {}"
msgstr ""
#: upscaler.py:133
#: upscaler.py:180
msgid "Unable to delete: {}"
msgstr ""
#: upscaler.py:139 upscaler.py:154 upscaler.py:165
#: upscaler.py:186 upscaler.py:201 upscaler.py:212
msgid "Input and output path type mismatch"
msgstr ""
#: upscaler.py:140
#: upscaler.py:187
msgid "Input is multiple files but output is not directory"
msgstr ""
#: upscaler.py:144
#: upscaler.py:191
msgid "Input path {} is neither a file nor a directory"
msgstr ""
#: upscaler.py:148 upscaler.py:170
#: upscaler.py:195 upscaler.py:217
msgid "Input directory and output directory cannot be the same"
msgstr ""
#: upscaler.py:155
#: upscaler.py:202
msgid "Input is single file but output is directory"
msgstr ""
#: upscaler.py:158
#: upscaler.py:205
msgid "No suffix found in output file path"
msgstr ""
#: upscaler.py:159
msgid "Suffix must be specified for FFmpeg"
#: upscaler.py:206
msgid "Suffix must be specified"
msgstr ""
#: upscaler.py:166
#: upscaler.py:213
msgid "Input is directory but output is existing single file"
msgstr ""
#: upscaler.py:175
#: upscaler.py:222
msgid "Input path is neither a file nor a directory"
msgstr ""
#: upscaler.py:184
#: upscaler.py:231
msgid "FFmpeg or FFprobe cannot be found under the specified path"
msgstr ""
#: upscaler.py:185 upscaler.py:195
#: upscaler.py:232 upscaler.py:242
msgid "Please check the configuration file settings"
msgstr ""
#: upscaler.py:194
#: upscaler.py:241
msgid "Specified driver executable directory doesn't exist"
msgstr ""
#: upscaler.py:221
#: upscaler.py:268
msgid "Failed to parse driver argument: {}"
msgstr ""
#: upscaler.py:253
#: upscaler.py:288
msgid "Unrecognized driver: {}"
msgstr ""
#: upscaler.py:293
#: upscaler.py:328
msgid "Starting progress monitor"
msgstr ""
#: upscaler.py:298
#: upscaler.py:333
msgid "Starting upscaled image cleaner"
msgstr ""
#: upscaler.py:307 upscaler.py:324
#: upscaler.py:342 upscaler.py:359
msgid "Killing progress monitor"
msgstr ""
#: upscaler.py:310 upscaler.py:327
#: upscaler.py:345 upscaler.py:362
msgid "Killing upscaled image cleaner"
msgstr ""
#: upscaler.py:331
#: upscaler.py:366
msgid "Terminating all processes"
msgstr ""
#: upscaler.py:338
#: upscaler.py:373
msgid "Main process waiting for subprocesses to exit"
msgstr ""
#: upscaler.py:357 upscaler.py:361
#: upscaler.py:392 upscaler.py:396
msgid "Subprocess {} exited with code {}"
msgstr ""
#: upscaler.py:367
#: upscaler.py:402
msgid "Stop signal received"
msgstr ""
#: upscaler.py:372
#: upscaler.py:407
msgid "Subprocess execution ran into an error"
msgstr ""
#: upscaler.py:421
msgid "Upscaling single video file: {}"
#: upscaler.py:437
msgid "Loading files into processing queue"
msgstr ""
#: upscaler.py:443 upscaler.py:502
msgid "Starting to upscale extracted images"
#: upscaler.py:438
msgid "Input path(s): {}"
msgstr ""
#: upscaler.py:448 upscaler.py:504
msgid "Upscaling completed"
#: upscaler.py:484
msgid "File MIME type: {}"
msgstr ""
#: upscaler.py:457
msgid "Reading video information"
#: upscaler.py:500
msgid "File {} ({}) neither an image nor a video"
msgstr ""
#: upscaler.py:471
#: upscaler.py:501
msgid "Skipping this file"
msgstr ""
#: upscaler.py:526
msgid "Loaded files into processing queue"
msgstr ""
#: upscaler.py:529
msgid "Input file: {}"
msgstr ""
#: upscaler.py:541
msgid "Reading file information"
msgstr ""
#: upscaler.py:550
msgid "Starting upscaling image"
msgstr ""
#: upscaler.py:561
msgid "Starting upscaling video/GIF"
msgstr ""
#: upscaler.py:572
msgid "Aborting: No video stream found"
msgstr ""
#: upscaler.py:490
msgid "Unsupported pixel format: {}"
#: upscaler.py:581
msgid "Getting total number of frames in the file"
msgstr ""
#: upscaler.py:493
#: upscaler.py:592
msgid "Calculating scaling parameters"
msgstr ""
#: upscaler.py:656
msgid "Framerate: {}"
msgstr ""
#: upscaler.py:507
msgid "Converting extracted frames into video"
#: upscaler.py:657
msgid "Width: {}"
msgstr ""
#: upscaler.py:514
#: upscaler.py:658
msgid "Height: {}"
msgstr ""
#: upscaler.py:659
msgid "Total number of frames: {}"
msgstr ""
#: upscaler.py:660
msgid "Output width: {}"
msgstr ""
#: upscaler.py:661
msgid "Output height: {}"
msgstr ""
#: upscaler.py:662
msgid "Required scale ratio: {}"
msgstr ""
#: upscaler.py:663
msgid "Upscaling jobs queue: {}"
msgstr ""
#: upscaler.py:680
msgid "Unsupported pixel format: {}"
msgstr ""
#: upscaler.py:684
msgid "Starting to upscale extracted frames"
msgstr ""
#: upscaler.py:701
msgid "Upscaling completed"
msgstr ""
#: upscaler.py:702
msgid "Average processing speed: {} seconds per frame"
msgstr ""
#: upscaler.py:705
msgid "Lanczos downscaling frames"
msgstr ""
#: upscaler.py:710
msgid "Downscaling"
msgstr ""
#: upscaler.py:729
msgid "Exporting image"
msgstr ""
#: upscaler.py:739
msgid "Converting extracted frames into GIF image"
msgstr ""
#: upscaler.py:743 upscaler.py:752
msgid "Conversion completed"
msgstr ""
#: upscaler.py:518
#: upscaler.py:748
msgid "Converting extracted frames into video"
msgstr ""
#: upscaler.py:756
msgid "Migrating audio, subtitles and other streams to upscaled video"
msgstr ""
#: upscaler.py:527
#: upscaler.py:766
msgid "Failed to migrate streams"
msgstr ""
#: upscaler.py:528
#: upscaler.py:767
msgid "Trying to output video without additional streams"
msgstr ""
#: upscaler.py:535
msgid "Output video file exists, aborting"
#: upscaler.py:783
msgid "Output video file exists"
msgstr ""
#: upscaler.py:539
#: upscaler.py:787
msgid "Created temporary directory to contain file"
msgstr ""
#: upscaler.py:790
msgid "Writing intermediate file to: {}"
msgstr ""
#: video2x.py:84
#: video2x.py:85
msgid ""
"Video2X Version: {}\n"
"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:106
#: video2x.py:108
msgid "Video2X Options"
msgstr ""
#: video2x.py:107
#: video2x.py:109
msgid "show this help message and exit"
msgstr ""
#: video2x.py:108
#: video2x.py:116
msgid "source video file/directory"
msgstr ""
#: video2x.py:109
#: video2x.py:117
msgid "output video file/directory"
msgstr ""
#: video2x.py:110
msgid "video2x config file path"
#: video2x.py:119
msgid "Video2X config file path"
msgstr ""
#: video2x.py:112
#: video2x.py:121
msgid "log file path"
msgstr ""
#: video2x.py:122
msgid "display version, lawful information and exit"
msgstr ""
#: video2x.py:115
#: video2x.py:125
msgid "Upscaling Options"
msgstr ""
#: video2x.py:116
msgid "upscaling driver"
msgstr ""
#: video2x.py:117
#: video2x.py:126
msgid "scaling ratio"
msgstr ""
#: video2x.py:118
#: video2x.py:127
msgid "output width"
msgstr ""
#: video2x.py:128
msgid "output height"
msgstr ""
#: video2x.py:129
msgid "upscaling driver"
msgstr ""
#: video2x.py:130
msgid "number of processes to use for upscaling"
msgstr ""
#: video2x.py:119
#: video2x.py:131
msgid "preserve extracted and upscaled frames"
msgstr ""
#: video2x.py:159
#: video2x.py:171
msgid "This file cannot be imported"
msgstr ""
#: video2x.py:229
#: video2x.py:187
msgid "Specify either scaling ratio or scaling resolution, not both"
msgstr ""
#: video2x.py:273
msgid "Program completed, taking {} seconds"
msgstr ""
#: video2x.py:232
#: video2x.py:277
msgid "An exception has occurred"
msgstr ""
#: video2x.py:292
msgid "The error log file can be found at: {}"
msgstr ""

View File

@@ -13,7 +13,7 @@ __ __ _ _ ___ __ __
Name: Video2X Controller
Creator: K4YT3X
Date Created: Feb 24, 2018
Last Modified: May 10, 2020
Last Modified: September 13, 2020
Editor: BrianPetkovsek
Last Modified: June 17, 2019
@@ -49,7 +49,9 @@ 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
@@ -69,65 +71,143 @@ import yaml
from avalon_framework import Avalon
# internationalization constants
DOMAIN = 'video2x'
LOCALE_DIRECTORY = pathlib.Path(__file__).parent.absolute() / 'locale'
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 = gettext.translation(
DOMAIN, LOCALE_DIRECTORY, [default_locale], fallback=True
)
language.install()
_ = language.gettext
CLI_VERSION = "4.3.1"
VERSION = '4.0.0'
LEGAL_INFO = _('''Video2X Version: {}
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(VERSION)
Contact: k4yt3x@k4yt3x.com"""
).format(CLI_VERSION, UPSCALER_VERSION)
LOGO = r'''
LOGO = r"""
__ __ _ _ ___ __ __
\ \ / / (_) | | |__ \ \ \ / /
\ \ / / _ __| | ___ ___ ) | \ V /
\ \/ / | | / _` | / _ \ / _ \ / / > <
\ / | | | (_| | | __/ | (_) | / /_ / . \
\/ |_| \__,_| \___| \___/ |____| /_/ \_\
'''
"""
def parse_arguments():
""" parse CLI arguments
"""
parser = argparse.ArgumentParser(prog='video2x', formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False)
"""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'))
video2x_options.add_argument('-i', '--input', type=pathlib.Path, help=_('source video file/directory'))
video2x_options.add_argument('-o', '--output', type=pathlib.Path, help=_('output video file/directory'))
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('-v', '--version', help=_('display version, lawful information and exit'), action='store_true')
video2x_options = parser.add_argument_group(_("Video2X Options"))
video2x_options.add_argument(
"--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"))
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')
upscaling_options = parser.add_argument_group(_("Upscaling Options"))
upscaling_options.add_argument(
"-r", "--ratio", help=_("scaling ratio"), action="store", type=float
)
upscaling_options.add_argument(
"-w", "--width", help=_("output width"), action="store", type=float
)
upscaling_options.add_argument(
"-h", "--height", help=_("output height"), action="store", type=float
)
upscaling_options.add_argument(
"-d",
"--driver",
help=_("upscaling driver"),
choices=AVAILABLE_DRIVERS,
default="waifu2x_ncnn_vulkan",
)
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:
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:])
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
@@ -135,11 +215,11 @@ def print_logo():
"""print video2x logo"""
print(LOGO)
print(f'\n{"Video2X Video Enlarger".rjust(40, " ")}')
print(f'\n{Avalon.FM.BD}{f"Version {VERSION}".rjust(36, " ")}{Avalon.FM.RST}\n')
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
"""read video2x configurations from config file
Arguments:
config_file {pathlib.Path} -- video2x configuration file pathlib.Path
@@ -148,16 +228,16 @@ def read_config(config_file: pathlib.Path) -> dict:
dict -- dictionary of video2x configuration
"""
with open(config_file, 'r') as config:
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')
if __name__ != "__main__":
Avalon.error(_("This file cannot be imported"))
raise ImportError(f"{__file__} cannot be imported")
# print video2x logo
print_logo()
@@ -170,20 +250,47 @@ if video2x_args.version:
print(LEGAL_INFO)
sys.exit(0)
# additional checks on upscaling arguments
if video2x_args.ratio is not None and (
video2x_args.width is not None or video2x_args.height is not None
):
Avalon.error(_("Specify either scaling ratio or scaling resolution, not both"))
sys.exit(1)
# redirect output to both terminal and log file
if video2x_args.log is not None:
log_file = video2x_args.log.open(mode="a+", encoding="utf-8")
else:
log_file = tempfile.TemporaryFile(
mode="a+", suffix=".log", prefix="video2x_", encoding="utf-8"
)
original_stdout = sys.stdout
original_stderr = sys.stderr
sys.stdout = BiLogger(sys.stdout, log_file)
sys.stderr = BiLogger(sys.stderr, log_file)
# 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'])
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'])
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
image_format = config['video2x']['image_format'].lower()
preserve_frames = config['video2x']['preserve_frames']
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
@@ -192,10 +299,10 @@ if video2x_args.preserve_frames is 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')
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'])
video2x_cache_directory = pathlib.Path(config["video2x"]["video2x_cache_directory"])
# overwrite driver_settings with driver_args
if driver_args is not None:
@@ -210,24 +317,56 @@ try:
begin_time = time.time()
# initialize upscaler object
upscaler = Upscaler(input_path=video2x_args.input,
output_path=video2x_args.output,
driver_settings=driver_settings,
ffmpeg_settings=ffmpeg_settings)
# set upscaler optional options
upscaler.driver = video2x_args.driver
upscaler.scale_ratio = video2x_args.ratio
upscaler.processes = video2x_args.processes
upscaler.video2x_cache_directory = video2x_cache_directory
upscaler.image_format = image_format
upscaler.preserve_frames = preserve_frames
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,
scale_width=video2x_args.width,
scale_height=video2x_args.height,
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)))
Avalon.info(
_("Program completed, taking {} seconds").format(
round((time.time() - begin_time), 5)
)
)
except Exception:
Avalon.error(_('An exception has occurred'))
Avalon.error(_("An exception has occurred"))
traceback.print_exc()
if video2x_args.log is not None:
log_file_path = video2x_args.log.absolute()
# if log file path is not specified, create temporary file as permanent log file
# tempfile.TempFile does not have a name attribute and is not guaranteed to have
# a visible name on the file system
else:
log_file_path = tempfile.mkstemp(suffix=".log", prefix="video2x_")[1]
with open(log_file_path, "w", encoding="utf-8") as permanent_log_file:
log_file.seek(0)
permanent_log_file.write(log_file.read())
Avalon.error(_("The error log file can be found at: {}").format(log_file_path))
finally:
sys.stdout = original_stdout
sys.stderr = original_stderr
log_file.close()

View File

@@ -1,7 +1,7 @@
# Name: Video2X Configuration File
# Creator: K4YT3X
# Date Created: October 23, 2018
# Last Modified: May 9, 2020
# Last Modified: September 28, 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
@@ -18,8 +18,8 @@ waifu2x_caffe:
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_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
@@ -32,7 +32,7 @@ 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
#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
@@ -55,15 +55,16 @@ waifu2x_converter_cpp:
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
#i: null # input-path: input image path (jpg/png/webp) or directory
#o: null # output-path: output image path (jpg/png/webp) 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)
j: '1:2:2' # thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
x: false # enable tta mode
#f: png # output image format (jpg/png/webp, default=ext/png)
srmd_ncnn_vulkan:
path: '%LOCALAPPDATA%\video2x\srmd-ncnn-vulkan\srmd-ncnn-vulkan'
v: null # verbose output
@@ -76,6 +77,19 @@ srmd_ncnn_vulkan:
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
#f: png # output image format (jpg/png/webp, default=ext/png)
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
#f: png # output image format (jpg/png/webp, default=ext/png)
anime4kcpp:
path: '%LOCALAPPDATA%\video2x\anime4kcpp\CLI\Anime4KCPP_CLI\Anime4KCPP_CLI'
#input: null # File for loading (string [=./pic/p1.png])
@@ -87,58 +101,85 @@ anime4kcpp:
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: true # Video process
videoMode: false # Video process
preview: null # Preview image
preprocessing: False # Enable pre processing
postprocessing: False # Enable post processing
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
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'
ffmpeg_path: '%LOCALAPPDATA%\video2x\ffmpeg\bin'
intermediate_file_name: 'intermediate.mkv'
# step 1: extract all frames from original video
# into temporary directory
video_to_frames:
output_options:
'-qscale:v': null
'-pix_fmt': rgba64be
'-hwaccel': auto
# 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
# step 2: stitch all frames back into a video
# with only a video track
frames_to_video:
input_options:
'-qscale:v': null
'-qscale:a': null
'-f': image2
'-f': image2 # force image2 format
output_options:
'-vcodec': libx264
'-crf': 17
'-b:v': null
'-pix_fmt': null
'-hwaccel': auto
'-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
# step 3: migrate audio and subtitle tracks from original
# video into the upscaled video
migrating_tracks:
input_options: {} # empty dict, expand if necessary
output_options:
'-map':
- '0:v?'
- '1:a?'
- '1:s?'
- '1:d?'
- '1:t?'
'-c': copy
- '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'
'-hwaccel': auto
'-y': true
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
image_format: png
preserve_frames: false
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

File diff suppressed because it is too large Load Diff

View File

@@ -1,190 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.12.0, 2020-05-11T04:13:22. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{25c1e4a4-6b4a-4828-883b-6f32c3f7eba0}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
<value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.Questionable</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">8</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop (x86-windows-msvc2019-pe-64bit)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop (x86-windows-msvc2019-pe-64bit)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5450e32e-f498-4c15-a0a5-7456f3375388}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">-1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">video2x_gui</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">PythonEditor.RunConfiguration.C:/Users/k4yt3x/Documents/Projects/video2x/src/video2x_gui.py</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/k4yt3x/Documents/Projects/video2x/src/video2x_gui.py</value>
<value type="bool" key="PythonEditor.RunConfiguation.Buffered">false</value>
<value type="QString" key="PythonEditor.RunConfiguation.Interpreter">{ffc39ed5-fbe0-4af8-8b16-9a60c393bdb8}</value>
<value type="QString" key="PythonEditor.RunConfiguation.Script">C:\Users\k4yt3x\Documents\Projects\video2x\src\video2x_gui.py</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

File diff suppressed because it is too large Load Diff

View File

@@ -4,10 +4,11 @@
Name: Video2X Setup Script
Creator: K4YT3X
Date Created: November 28, 2018
Last Modified: May 8, 2020
Last Modified: December 13, 2020
Editor: BrianPetkovsek
Editor: SAT3LL
Editor: konqiDAM
Description: This script helps installing all dependencies of video2x
and generates a configuration for it.
@@ -17,8 +18,9 @@ Installation Details:
- waifu2x-caffe: %LOCALAPPDATA%\\video2x\\waifu2x-caffe
- waifu2x-cpp-converter: %LOCALAPPDATA%\\video2x\\waifu2x-converter-cpp
- waifu2x_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\waifu2x-ncnn-vulkan
- anime4kcpp: %LOCALAPPDATA%\\video2x\\anime4kcpp
- srmd_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\srmd-ncnn-vulkan
- realsr_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\realsr-ncnn-vulkan
- anime4kcpp: %LOCALAPPDATA%\\video2x\\anime4kcpp
"""
# built-in imports
@@ -27,44 +29,63 @@ 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
# Requests doesn't come with windows, therefore
# it will be installed as a dependency and imported
# later in the script.
# import requests
# 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.
VERSION = '1.8.0'
SETUP_VERSION = "2.4.1"
# global static variables
LOCALAPPDATA = pathlib.Path(os.getenv('localappdata'))
VIDEO2X_CONFIG = pathlib.Path(__file__).parent.absolute() / 'video2x.yaml'
DRIVER_OPTIONS = ['all', 'ffmpeg', 'waifu2x_caffe', 'waifu2x_converter_cpp', 'waifu2x_ncnn_vulkan', 'anime4kcpp', 'srmd_ncnn_vulkan']
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():
"""Processes CLI arguments
"""
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
# video options
general_options = parser.add_argument_group('General Options')
general_options.add_argument('-d', '--driver', help='driver to download and configure', action='store', choices=DRIVER_OPTIONS, default='all')
"""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
"""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.
@@ -76,218 +97,271 @@ class Video2xSetup:
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')
print("\nInstalling Python libraries")
self._install_python_requirements()
if self.driver == 'all':
self._install_ffmpeg()
self._install_waifu2x_caffe()
self._install_waifu2x_converter_cpp()
self._install_waifu2x_ncnn_vulkan()
self._install_anime4kcpp()
self._install_srmd_ncnn_vulkan()
elif self.driver == 'ffmpeg':
self._install_ffmpeg()
elif self.driver == 'waifu2x_caffe':
self._install_waifu2x_caffe()
elif self.driver == 'waifu2x_converter_cpp':
self._install_waifu2x_converter_cpp()
elif self.driver == 'waifu2x_ncnn_vulkan':
self._install_waifu2x_ncnn_vulkan()
elif self.driver == 'anime4kcpp':
self._install_anime4kcpp()
elif self.driver == 'srmd_ncnn_vulkan':
self._install_srmd_ncnn_vulkan()
# 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}")()
print('\nGenerating Video2X configuration file')
self._generate_config()
# install only the selected driver
else:
getattr(self, f"_install_{self.driver}")()
print('\nCleaning up temporary files')
self._cleanup()
# self._cleanup()
def _install_python_requirements(self):
""" Read requirements.txt and return its content
"""
pip_install('requirements.txt')
"""Read requirements.txt and return its content"""
pip_install("requirements.txt")
def _cleanup(self):
""" Cleanup all the temp files downloaded
"""
"""Cleanup all the temp files downloaded"""
print("\nCleaning up temporary files")
for file in self.trash:
try:
if file.is_dir():
print(f'Deleting directory: {file}')
print(f"Deleting directory: {file}")
shutil.rmtree(file)
else:
print(f'Deleting file: {file}')
print(f"Deleting file: {file}")
file.unlink()
except Exception:
print(f'Error deleting: {file}')
print(f"Error deleting: {file}")
traceback.print_exc()
def _install_ffmpeg(self):
""" Install FFMPEG
"""
print('\nInstalling FFmpeg')
"""Install FFMPEG"""
print("\nInstalling FFmpeg")
latest_release = 'https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-latest-win64-static.zip'
import patoolib
ffmpeg_zip = download(latest_release, tempfile.gettempdir())
self.trash.append(ffmpeg_zip)
latest_release = "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z"
with zipfile.ZipFile(ffmpeg_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x')
ffmpeg_7z = download(latest_release, tempfile.gettempdir())
self.trash.append(ffmpeg_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"
ffmpeg_directory = LOCALAPPDATA / "video2x" / "ffmpeg"
# (ffmpeg_directory).mkdir(parents=True, exist_ok=True)
# pyunpack.Archive(ffmpeg_7z).extractall(ffmpeg_directory)
if (ffmpeg_directory).exists():
shutil.rmtree(ffmpeg_directory)
patoolib.extract_archive(str(ffmpeg_7z), outdir=str(LOCALAPPDATA / "video2x"))
(LOCALAPPDATA / "video2x" / ffmpeg_7z.stem).rename(ffmpeg_directory)
def _install_gifski(self):
print("\nInstalling Gifski")
import requests
# Get latest release of Gifski via Github API
releases = requests.get(
"https://api.github.com/repos/ImageOptim/gifski/releases"
).json()
for release in releases:
for asset in release["assets"]:
if re.search(r"gifski-.*\.tar\.xz", asset["browser_download_url"]):
gifski_tar_xz = download(
asset["browser_download_url"], tempfile.gettempdir()
)
self.trash.append(gifski_tar_xz)
# extract and rename
with tarfile.open(gifski_tar_xz) as archive:
archive.extractall(LOCALAPPDATA / "video2x" / "gifski")
return
def _install_waifu2x_caffe(self):
""" Install waifu2x_caffe
"""
print('\nInstalling waifu2x-caffe')
"""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()
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())
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')
zipf.extractall(LOCALAPPDATA / "video2x")
def _install_waifu2x_converter_cpp(self):
""" Install waifu2x_caffe
"""
print('\nInstalling waifu2x-converter-cpp')
"""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()
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())
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')
zipf.extractall(LOCALAPPDATA / "video2x" / "waifu2x-converter-cpp")
def _install_waifu2x_ncnn_vulkan(self):
""" Install waifu2x-ncnn-vulkan
"""
print('\nInstalling waifu2x-ncnn-vulkan')
"""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()
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*\.zip', a['browser_download_url']):
waifu2x_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
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'
waifu2x_ncnn_vulkan_directory = LOCALAPPDATA / "video2x" / "waifu2x-ncnn-vulkan"
with zipfile.ZipFile(waifu2x_ncnn_vulkan_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x')
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_anime4kcpp(self):
""" Install Anime4KCPP
"""
print('\nInstalling Anime4KCPP')
import pyunpack
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_zip = download(a['browser_download_url'], tempfile.gettempdir())
self.trash.append(anime4kcpp_zip)
# extract and rename
# with py7zr.SevenZipFile(anime4kcpp_zip, mode='r') as archive:
(LOCALAPPDATA / 'video2x' / 'anime4kcpp').mkdir(parents=True, exist_ok=True)
pyunpack.Archive(anime4kcpp_zip).extractall(LOCALAPPDATA / 'video2x' / 'anime4kcpp')
(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')
"""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()
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*\.zip', a['browser_download_url']):
srmd_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
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'
srmd_ncnn_vulkan_directory = LOCALAPPDATA / "video2x" / "srmd-ncnn-vulkan"
with zipfile.ZipFile(srmd_ncnn_vulkan_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x')
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)
(LOCALAPPDATA / "video2x" / zipf.namelist()[0]).rename(
srmd_ncnn_vulkan_directory
)
def _generate_config(self):
""" Generate video2x config
"""
import yaml
def _install_realsr_ncnn_vulkan(self):
"""Install realsr-ncnn-vulkan"""
print("\nInstalling realsr-ncnn-vulkan")
import requests
# open current video2x configuration file as template
with open(VIDEO2X_CONFIG, 'r') as template:
template_dict = yaml.load(template, Loader=yaml.FullLoader)
template.close()
# 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()
# configure only the specified drivers
if self.driver == 'all':
template_dict['waifu2x_caffe']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-caffe' / 'waifu2x-caffe-cui')
template_dict['waifu2x_converter_cpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp' / 'waifu2x-converter-cpp')
template_dict['waifu2x_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan' / 'waifu2x-ncnn-vulkan')
template_dict['srmd_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'srmd-ncnn-vulkan' / 'srmd-ncnn-vulkan')
template_dict['anime4kcpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'anime4kcpp' / 'CLI' / 'Anime4KCPP_CLI' / 'Anime4KCPP_CLI')
elif self.driver == 'waifu2x_caffe':
template_dict['waifu2x_caffe']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-caffe' / 'waifu2x-caffe-cui')
elif self.driver == 'waifu2x_converter_cpp':
template_dict['waifu2x_converter_cpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp' / 'waifu2x-converter-cpp')
elif self.driver == 'waifu2x_ncnn_vulkan':
template_dict['waifu2x_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan' / 'waifu2x-ncnn-vulkan')
elif self.driver == 'srmd_ncnn_vulkan':
template_dict['srmd_ncnn_vulkan']['path'] = str(LOCALAPPDATA / 'video2x' / 'srmd-ncnn-vulkan' / 'srmd-ncnn-vulkan')
elif self.driver == 'anime4kcpp':
template_dict['anime4kcpp']['path'] = str(LOCALAPPDATA / 'video2x' / 'anime4kcpp' / 'CLI' / 'Anime4KCPP_CLI' / 'Anime4KCPP_CLI')
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)
template_dict['ffmpeg']['ffmpeg_path'] = str(LOCALAPPDATA / 'video2x' / 'ffmpeg-latest-win64-static' / 'bin')
template_dict['video2x']['video2x_cache_directory'] = None
template_dict['video2x']['preserve_frames'] = False
# 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")
# write configuration into file
with open(VIDEO2X_CONFIG, 'w') as config:
yaml.dump(template_dict, config)
# 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
"""
"""Download file to local with requests library"""
from tqdm import tqdm
import requests
@@ -301,14 +375,14 @@ def download(url, save_path, chunk_size=4096):
# get file name
file_name = None
if 'content-disposition' in stream.headers:
disposition = stream.headers['content-disposition']
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]
output_file = save_path / stream.url.split("/")[-1]
else:
output_file = save_path / file_name
@@ -317,17 +391,17 @@ def download(url, save_path, chunk_size=4096):
# 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'])
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}')
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 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:
@@ -339,74 +413,106 @@ def download(url, save_path, chunk_size=4096):
def pip_install(file):
""" Install python package via python pip module
"""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
return subprocess.run(
[sys.executable, "-m", "pip", "install", "-U", "-r", file]
).returncode
if __name__ == '__main__':
try:
# set default exit code
EXIT_CODE = 0
if __name__ != "__main__":
raise ImportError("video2x_setup cannot be imported")
# get start time
start_time = time.time()
try:
# set default exit code
EXIT_CODE = 0
# check platform
if sys.platform != 'win32':
print('This script is currently only compatible with Windows')
EXIT_CODE = 1
sys.exit(1)
# get start time
start_time = time.time()
# parse command line arguments
args = parse_arguments()
print('Video2X Setup Script')
print(f'Version: {VERSION}')
# 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')
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')
except SystemExit:
pass
print("\nScript finished successfully")
# 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
# let SystemExit signals pass through
except SystemExit as e:
raise e
# for any exception in the script
# 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")
EXIT_CODE = 1
# regardless if script finishes successfully or not
# print script execution summary
finally:
# always try cleaning up trash
try:
setup._cleanup()
except Exception:
traceback.print_exc()
print('An error has occurred')
print('Video2X Automatic Setup has failed')
print("An error occurred while trying to cleanup files")
# 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')
print("Script finished")
print(f"Time taken: {timedelta(seconds=round(time.time() - start_time))}")
EXIT_CODE = 1
# 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")
# 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))}')
input('Press [ENTER] to exit script')
sys.exit(EXIT_CODE)
sys.exit(EXIT_CODE)

246
src/video2x_setup_ubuntu.sh Executable file
View File

@@ -0,0 +1,246 @@
#!/usr/bin/bash -e
# Name: Video2X Setup Script (Ubuntu)
# Creator: K4YT3X
# Date Created: June 5, 2020
# Last Modified: September 4, 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 aria2
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
# cargo from APT might be outdate and will result in gifski components not being built successfully
# apt-fast install -y --no-install-recommends cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
source $HOME/.cargo/env
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-dev 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"
aria2c "$download_link" --dir / -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"
aria2c "$download_link" --dir / -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"
aria2c "$download_link" --dir / -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
# install the latest cmake for compiling Anime4KCPP
aria2c https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.sh --dir / -o "$TEMP/cmake.sh"
mkdir $TEMP/cmake
bash "$TEMP/cmake.sh" --prefix=$TEMP/cmake --skip-license
# build and install Anime4KCPP
apt-fast install -y --no-install-recommends libopencv-dev opencl-dev
git clone --recurse-submodules --depth=1 --progress https://github.com/TianZerL/Anime4KCPP.git $TEMP/anime4kcpp
mkdir -v $TEMP/anime4kcpp/build
cd $TEMP/anime4kcpp/build
$TEMP/cmake/bin/cmake -DBuild_GUI=OFF ..
make -j$(nproc)
mv -v $TEMP/anime4kcpp/build $INSTALLATION_PATH/video2x/src/dependencies/anime4kcpp
ln -s $INSTALLATION_PATH/video2x/src/dependencies/anime4kcpp/bin/libAnime4KCPPCore.so /usr/lib
# 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/bin/Anime4KCPP_CLI'.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 -rf $TEMP

104
src/wrappers/anime4kcpp.py Normal file → Executable file
View File

@@ -1,13 +1,16 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Waifu2x Caffe Driver
Name: Anime4KCPP Driver
Author: K4YT3X
Date Created: May 3, 2020
Last Modified: May 11, 2020
Last Modified: December 15, 2020
Editor: fire0shadow
Last Modified: December 15, 2020
Description: This class is a high-level wrapper
for waifu2x-caffe.
for Anime4KCPP.
"""
# built-in imports
@@ -15,8 +18,8 @@ import argparse
import os
import pathlib
import platform
import shlex
import subprocess
import sys
import threading
# third-party imports
@@ -24,8 +27,7 @@ from avalon_framework import Avalon
class WrapperMain:
""" Anime4K CPP wrapper
"""
"""Anime4K CPP wrapper"""
def __init__(self, driver_settings):
self.driver_settings = driver_settings
@@ -35,39 +37,55 @@ class WrapperMain:
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')
raise argparse.ArgumentTypeError(f"{value} is not between 0.0 and 1.0")
return value
@staticmethod
def parse_arguments(arguments):
# fmt: off
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('-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("--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)
# fmt: on
def load_configurations(self, upscaler):
self.driver_settings['zoomFactor'] = upscaler.scale_ratio
self.driver_settings['threads'] = upscaler.processes
# 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 set_scale_ratio(self, scale_ratio: float):
self.driver_settings["zoomFactor"] = scale_ratio
def upscale(self, input_file, output_file):
"""This is the core function for WAIFU2X class
@@ -79,31 +97,35 @@ class WrapperMain:
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
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)
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.pop('path')]
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 value is None or value is False:
if key == "path" or value is None or value is False:
continue
else:
if len(key) == 1:
execute.append(f'-{key}')
execute.append(f"-{key}")
else:
execute.append(f'--{key}')
execute.append(f"--{key}")
# true means key is an option
if value is not True:
@@ -111,6 +133,8 @@ class WrapperMain:
# 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)}')
Avalon.debug_info(
f'[upscaler] Subprocess {os.getpid()} executing: {" ".join(execute)}'
)
self.print_lock.release()
return subprocess.Popen(execute)
return subprocess.Popen(execute, stdout=sys.stdout, stderr=sys.stderr)

262
src/wrappers/ffmpeg.py Normal file → Executable file
View File

@@ -4,7 +4,7 @@
Name: Video2X FFmpeg Controller
Author: K4YT3X
Date Created: Feb 24, 2018
Last Modified: May 9, 2020
Last Modified: September 13, 2020
Description: This class handles all FFmpeg related operations.
"""
@@ -13,6 +13,7 @@ Description: This class handles all FFmpeg related operations.
import json
import pathlib
import subprocess
import sys
# third-party imports
from avalon_framework import Avalon
@@ -26,20 +27,24 @@ class Ffmpeg:
and inserting audio tracks to videos.
"""
def __init__(self, ffmpeg_settings, image_format):
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'
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.image_format = image_format
self.intermediate_file_name = pathlib.Path(self.ffmpeg_settings['intermediate_file_name'])
self.pixel_format = None
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
"""Get a dictionary of supported pixel formats
List all supported pixel formats and their
corresponding bit depth.
@@ -47,12 +52,7 @@ class Ffmpeg:
Returns:
dictionary -- JSON dict of all pixel formats to bit depth
"""
execute = [
self.ffmpeg_probe_binary,
'-v',
'quiet',
'-pix_fmts'
]
execute = [self.ffmpeg_probe_binary, "-v", "quiet", "-pix_fmts"]
# turn elements into str
execute = [str(e) for e in execute]
@@ -63,9 +63,15 @@ class Ffmpeg:
pixel_formats = {}
# record all pixel formats into dictionary
for line in subprocess.run(execute, check=True, stdout=subprocess.PIPE).stdout.decode().split('\n'):
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])
pixel_formats[" ".join(line.split()).split()[1]] = int(
" ".join(line.split()).split()[3]
)
except (IndexError, ValueError):
pass
@@ -74,8 +80,43 @@ class Ffmpeg:
return pixel_formats
def get_video_info(self, input_video):
""" Gets input video information
def get_number_of_frames(self, input_file: str, video_stream_index: int) -> int:
"""Count the number of frames in a video
Args:
input_file (str): input file path
video_stream_index (int): index number of the video stream
Returns:
int: number of frames in the video
"""
execute = [
self.ffmpeg_probe_binary,
"-v",
"quiet",
"-count_frames",
"-select_streams",
f"v:{video_stream_index}",
"-show_entries",
"stream=nb_read_frames",
"-of",
"default=nokey=1:noprint_wrappers=1",
input_file,
]
# turn elements into str
execute = [str(e) for e in execute]
Avalon.debug_info(f'Executing: {" ".join(execute)}')
return int(
subprocess.run(execute, check=True, stdout=subprocess.PIPE)
.stdout.decode()
.strip()
)
def probe_file_info(self, input_video):
"""Gets input video information
This method reads input video information
using ffprobe in dictionary
@@ -91,14 +132,14 @@ class Ffmpeg:
# 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
"-v",
"quiet",
"-print_format",
"json",
"-show_format",
"-show_streams",
"-i",
input_video,
]
# turn elements into str
@@ -106,37 +147,40 @@ class Ffmpeg:
Avalon.debug_info(f'Executing: {" ".join(execute)}')
json_str = subprocess.run(execute, check=True, stdout=subprocess.PIPE).stdout
return json.loads(json_str.decode('utf-8'))
return json.loads(json_str.decode("utf-8"))
def extract_frames(self, input_video, extracted_frames):
"""Extract every frame from original videos
def extract_frames(self, input_file, extracted_frames):
"""extract frames from video or GIF file"""
execute = [self.ffmpeg_binary]
This method extracts every frame from input video using FFmpeg
# load general options
execute.extend(self._read_configuration(phase="extract_frames"))
Arguments:
input_video {string} -- input video path
extracted_frames {string} -- video output directory
"""
execute = [
self.ffmpeg_binary
]
# load input_options
execute.extend(
self._read_configuration(phase="extract_frames", section="input_options")
)
execute.extend(self._read_configuration(phase='video_to_frames'))
# specify input file
execute.extend(["-i", input_file])
execute.extend([
'-i',
input_video
])
# load output options
execute.extend(
self._read_configuration(phase="extract_frames", section="output_options")
)
execute.extend(self._read_configuration(phase='video_to_frames', section='output_options'))
# specify output file
execute.extend(
[
extracted_frames
/ f"extracted_%0d.{self.extracted_frame_format}"
# extracted_frames / f'frame_%06d.{self.extracted_frame_format}'
]
)
execute.extend([
extracted_frames / f'extracted_%0d.{self.image_format}'
])
return self._execute(execute)
return(self._execute(execute))
def assemble_video(self, framerate, resolution, upscaled_frames):
def assemble_video(self, framerate, upscaled_frames):
"""Converts images into videos
This method converts a set of images into a video
@@ -148,74 +192,93 @@ class Ffmpeg:
"""
execute = [
self.ffmpeg_binary,
'-r',
str(framerate),
'-s',
resolution
"-r",
str(framerate)
# '-s',
# resolution
]
# read other options
execute.extend(self._read_configuration(phase='frames_to_video'))
execute.extend(self._read_configuration(phase="assemble_video"))
# read FFmpeg input options
execute.extend(self._read_configuration(phase='frames_to_video', section='input_options'))
# 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)
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)))
(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.image_format}'
])
execute.extend(
[
"-i",
upscaled_frames / f"extracted_%d.{self.extracted_frame_format}"
# upscaled_frames / f'%06d.{self.extracted_frame_format}'
]
)
# read FFmpeg output options
execute.extend(self._read_configuration(phase='frames_to_video', section='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
])
execute.extend([upscaled_frames / self.intermediate_file_name])
return(self._execute(execute))
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
"""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
]
execute = [self.ffmpeg_binary]
execute.extend(self._read_configuration(phase='migrating_tracks'))
# load general options
execute.extend(self._read_configuration(phase="migrate_streams"))
execute.extend([
'-i',
upscaled_frames / self.intermediate_file_name,
'-i',
input_video
])
# load input options
execute.extend(
self._read_configuration(phase="migrate_streams", section="input_options")
)
execute.extend(self._read_configuration(phase='migrating_tracks', section='output_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,
]
)
execute.extend([
output_video
])
# load output options
execute.extend(
self._read_configuration(phase="migrate_streams", section="output_options")
)
return(self._execute(execute))
# load output video path
execute.extend([output_video])
return self._execute(execute)
def _read_configuration(self, phase, section=None):
""" read configuration from JSON
"""read configuration from JSON
Read the configurations (arguments) from the JSON
configuration file and append them to the end of the
@@ -232,16 +295,10 @@ class Ffmpeg:
# from only that section
if section:
source = self.ffmpeg_settings[phase][section].keys()
# if pixel format is not specified, use the source pixel format
try:
if self.ffmpeg_settings[phase][section].get('-pix_fmt') is None:
self.ffmpeg_settings[phase][section]['-pix_fmt'] = self.pixel_format
except KeyError:
pass
else:
source = self.ffmpeg_settings[phase].keys()
# for each key in the section's dict
for key in source:
if section:
@@ -250,7 +307,12 @@ class Ffmpeg:
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):
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
@@ -274,17 +336,7 @@ class Ffmpeg:
return configuration
def _execute(self, execute):
""" execute command
Arguments:
execute {list} -- list of arguments to be executed
Returns:
int -- execution return code
"""
# 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)
Avalon.debug_info(f'Executing: {" ".join(execute)}')
return subprocess.Popen(execute, stdout=sys.stdout, stderr=sys.stderr)

82
src/wrappers/gifski.py Executable file
View File

@@ -0,0 +1,82 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Gifski Wrapper
Creator: K4YT3X
Date Created: May 11, 2020
Last Modified: September 13, 2020
Description: High-level wrapper for Gifski.
"""
# built-in imports
import pathlib
import subprocess
import sys
# 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,
output_width: int,
output_height: int,
) -> subprocess.Popen:
execute = [
self.gifski_settings["gifski_path"],
"-o",
output_path,
"--fps",
int(round(framerate, 0)),
"--width",
output_width,
"--height",
output_height,
]
# 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, stdout=sys.stdout, stderr=sys.stderr)

View File

@@ -0,0 +1,117 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: RealSR NCNN Vulkan Driver
Creator: K4YT3X
Date Created: May 26, 2020
Last Modified: September 21, 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 subprocess
import sys
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):
# fmt: off
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, 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")
parser.add_argument("-f", type=str, help=argparse.SUPPRESS) # help="output image format (jpg/png/webp, default=ext/png)")
return parser.parse_args(arguments)
# fmt: on
def load_configurations(self, upscaler):
# self.driver_settings['s'] = int(upscaler.scale_ratio)
self.driver_settings["j"] = "{}:{}:{}".format(
upscaler.processes, upscaler.processes, upscaler.processes
)
self.driver_settings["f"] = upscaler.extracted_frame_format.lower()
def set_scale_ratio(self, scale_ratio: int):
self.driver_settings["s"] = int(scale_ratio)
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: {" ".join(execute)}'
)
self.print_lock.release()
return subprocess.Popen(execute, stdout=sys.stdout, stderr=sys.stderr)

65
src/wrappers/srmd_ncnn_vulkan.py Normal file → Executable file
View File

@@ -4,7 +4,7 @@
Name: SRMD NCNN Vulkan Driver
Creator: K4YT3X
Date Created: April 26, 2020
Last Modified: May 11, 2020
Last Modified: September 21, 2020
Description: This class is a high-level wrapper
for srmd_ncnn_vulkan.
@@ -15,8 +15,8 @@ import argparse
import os
import pathlib
import platform
import shlex
import subprocess
import sys
import threading
# third-party imports
@@ -38,24 +38,33 @@ class WrapperMain:
@staticmethod
def parse_arguments(arguments):
# fmt: off
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')
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, 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")
parser.add_argument("-f", type=str, help=argparse.SUPPRESS) # help="output image format (jpg/png/webp, default=ext/png)")
return parser.parse_args(arguments)
# fmt: on
def load_configurations(self, upscaler):
self.driver_settings['s'] = int(upscaler.scale_ratio)
self.driver_settings['j'] = '{}:{}:{}'.format(upscaler.processes, upscaler.processes, upscaler.processes)
# self.driver_settings['s'] = int(upscaler.scale_ratio)
self.driver_settings["j"] = "{}:{}:{}".format(
upscaler.processes, upscaler.processes, upscaler.processes
)
self.driver_settings["f"] = upscaler.extracted_frame_format.lower()
def set_scale_ratio(self, scale_ratio: int):
self.driver_settings["s"] = int(scale_ratio)
def upscale(self, input_directory, output_directory):
"""This is the core function for SRMD ncnn Vulkan class
@@ -66,31 +75,35 @@ class WrapperMain:
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
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)
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.pop('path')]
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 value is None or value is False:
if key == "path" or value is None or value is False:
continue
else:
if len(key) == 1:
execute.append(f'-{key}')
execute.append(f"-{key}")
else:
execute.append(f'--{key}')
execute.append(f"--{key}")
# true means key is an option
if value is not True:
@@ -98,6 +111,8 @@ class WrapperMain:
# 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)}')
Avalon.debug_info(
f'[upscaler] Subprocess {os.getpid()} executing: {" ".join(execute)}'
)
self.print_lock.release()
return subprocess.Popen(execute)
return subprocess.Popen(execute, stdout=sys.stdout, stderr=sys.stderr)

88
src/wrappers/waifu2x_caffe.py Normal file → Executable file
View File

@@ -4,7 +4,7 @@
Name: Waifu2x Caffe Driver
Author: K4YT3X
Date Created: Feb 24, 2018
Last Modified: May 11, 2020
Last Modified: September 12, 2020
Description: This class is a high-level wrapper
for waifu2x-caffe.
@@ -13,8 +13,9 @@ for waifu2x-caffe.
# built-in imports
import argparse
import os
import shlex
import pathlib
import subprocess
import sys
import threading
# third-party imports
@@ -36,63 +37,78 @@ class WrapperMain:
@staticmethod
def parse_arguments(arguments):
# fmt: off
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', 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_file', type=str, help=argparse.SUPPRESS) # help='(required) path to input image file')
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)
# fmt: on
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.image_format
# 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
self.driver_settings["output_depth"] = 12
def set_scale_resolution(self, width: int, height: int):
self.driver_settings["scale_width"] = width
self.driver_settings["scale_height"] = height
self.driver_settings["scale_ratio"] = None
def set_scale_ratio(self, scale_ratio: float):
self.driver_settings["scale_width"] = None
self.driver_settings["scale_height"] = None
self.driver_settings["scale_ratio"] = scale_ratio
def upscale(self, input_directory, output_directory):
""" start upscaling process
"""
"""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
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.pop('path')]
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 value is None or value is False:
if key == "path" or value is None or value is False:
continue
else:
if len(key) == 1:
execute.append(f'-{key}')
execute.append(f"-{key}")
else:
execute.append(f'--{key}')
execute.append(f"--{key}")
# true means key is an option
if value is not True:
@@ -100,6 +116,8 @@ class WrapperMain:
# 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)}')
Avalon.debug_info(
f'[upscaler] Subprocess {os.getpid()} executing: {" ".join(execute)}'
)
self.print_lock.release()
return subprocess.Popen(execute)
return subprocess.Popen(execute, stdout=sys.stdout, stderr=sys.stderr)

95
src/wrappers/waifu2x_converter_cpp.py Normal file → Executable file
View File

@@ -4,7 +4,7 @@
Name: Waifu2x Converter CPP Driver
Author: K4YT3X
Date Created: February 8, 2019
Last Modified: May 11, 2020
Last Modified: September 9, 2020
Description: This class is a high-level wrapper
for waifu2x-converter-cpp.
@@ -14,8 +14,8 @@ for waifu2x-converter-cpp.
import argparse
import os
import pathlib
import shlex
import subprocess
import sys
import threading
# third-party imports
@@ -37,42 +37,47 @@ class WrapperMain:
@staticmethod
def parse_arguments(arguments):
# fmt: off
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.')
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)
# fmt: on
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.image_format.lower()
# 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 set_scale_ratio(self, scale_ratio: float):
self.driver_settings["scale-ratio"] = scale_ratio
def upscale(self, input_directory, output_directory):
""" Waifu2x Converter Driver Upscaler
"""Waifu2x Converter Driver Upscaler
This method executes the upscaling of extracted frames.
Arguments:
@@ -82,31 +87,37 @@ class WrapperMain:
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
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'
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.pop('path')]
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 value is None or value is False:
if key == "path" or value is None or value is False:
continue
else:
if len(key) == 1:
execute.append(f'-{key}')
execute.append(f"-{key}")
else:
execute.append(f'--{key}')
execute.append(f"--{key}")
# true means key is an option
if value is not True:
@@ -114,6 +125,8 @@ class WrapperMain:
# 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)}')
Avalon.debug_info(
f'[upscaler] Subprocess {os.getpid()} executing: {" ".join(execute)}'
)
self.print_lock.release()
return subprocess.Popen(execute)
return subprocess.Popen(execute, stdout=sys.stdout, stderr=sys.stderr)

67
src/wrappers/waifu2x_ncnn_vulkan.py Normal file → Executable file
View File

@@ -7,7 +7,7 @@ Date Created: June 26, 2019
Last Modified: May 11, 2020
Editor: K4YT3X
Last Modified: February 22, 2020
Last Modified: September 21, 2020
Description: This class is a high-level wrapper
for waifu2x_ncnn_vulkan.
@@ -18,8 +18,8 @@ import argparse
import os
import pathlib
import platform
import shlex
import subprocess
import sys
import threading
# third-party imports
@@ -41,27 +41,36 @@ class WrapperMain:
@staticmethod
def parse_arguments(arguments):
# fmt: off
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')
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/webp) or directory")
parser.add_argument("-o", type=str, help=argparse.SUPPRESS) # help="output image path (jpg/png/webp) or directory")
parser.add_argument("-n", type=int, choices=range(-1, 4), help="denoise level")
parser.add_argument("-s", type=int, 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")
parser.add_argument("-f", type=str, help=argparse.SUPPRESS) # help="output image format (jpg/png/webp, default=ext/png)")
return parser.parse_args(arguments)
# fmt: on
def load_configurations(self, upscaler):
self.driver_settings['s'] = int(upscaler.scale_ratio)
self.driver_settings['j'] = '{}:{}:{}'.format(upscaler.processes, upscaler.processes, upscaler.processes)
# self.driver_settings['s'] = int(upscaler.scale_ratio)
self.driver_settings["j"] = "{}:{}:{}".format(
upscaler.processes, upscaler.processes, upscaler.processes
)
self.driver_settings["f"] = upscaler.extracted_frame_format.lower()
def set_scale_ratio(self, scale_ratio: int):
self.driver_settings["s"] = int(scale_ratio)
def upscale(self, input_directory, output_directory):
"""This is the core function for WAIFU2X class
"""This is the core function for waifu2x class
Arguments:
input_directory {string} -- source directory path
@@ -69,31 +78,35 @@ class WrapperMain:
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
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)
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.pop('path')]
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 value is None or value is False:
if key == "path" or value is None or value is False:
continue
else:
if len(key) == 1:
execute.append(f'-{key}')
execute.append(f"-{key}")
else:
execute.append(f'--{key}')
execute.append(f"--{key}")
# true means key is an option
if value is not True:
@@ -101,6 +114,8 @@ class WrapperMain:
# 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)}')
Avalon.debug_info(
f'[upscaler] Subprocess {os.getpid()} executing: {" ".join(execute)}'
)
self.print_lock.release()
return subprocess.Popen(execute)
return subprocess.Popen(execute, stdout=sys.stdout, stderr=sys.stderr)