725 Commits

Author SHA1 Message Date
Salman Chishti
5909f627fb ci(*): upgrade GitHub Actions for Node 24 compatibility (#1454)
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-01-27 08:04:06 +00:00
Salman Chishti
ce07604217 ci(*): upgrade GitHub Actions to latest versions (#1455)
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-01-27 08:01:58 +00:00
k4yt3x
8a9e571114 feat(encoder): add separate audio/subtitle copy and recalculate PTS option
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-11-23 00:00:00 +00:00
k4yt3x
f3df895890 ci(build): update setup-vulkan-sdk to v1.2.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-10-15 00:00:00 +00:00
k4yt3x
d848db037a deps(rife): update librife-ncnn-vulkan to fix ncnn compatibility issues
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-10-15 00:00:00 +00:00
Michael
feb84c3cae deps(ncnn): bump ncnn to 20250503 to fix black output frames on RADV (#1410)
Signed-off-by: Michael <mwp.foss@gmail.com>
2025-08-03 08:10:57 +00:00
k4yt3x
6bf0ee527d docs(readme): add hardware requirements
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-03-26 00:00:00 +00:00
k4yt3x
4668556417 docs(book): correct the renamed CLI arguments
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-03-23 00:00:00 +00:00
k4yt3x
d6403dc1a4 docs(readme): update file server URLs
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-03-09 00:00:00 +00:00
k4yt3x
66778b7feb docs(book): add docs for setting the encoder options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-24 00:00:00 +00:00
k4yt3x
445d13b73b fix(libvideo2x): fix atomic int64_t frame_idx_ self add
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-08 00:00:00 +00:00
k4yt3x
8803cf10a4 fix(video2x): allow Real-ESRGAN noise to be -1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-08 00:00:00 +00:00
k4yt3x
3e987b9693 docs(book): update command arguments in the container usages (#1323)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-04 00:00:00 +00:00
k4yt3x
afa37f9e58 chore(models): add the Real-ESRGAN general models (#1319)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-02 00:00:00 +00:00
k4yt3x
2c5a059d39 build(arch): move PKGBUILD openmp from makedepends to depends
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-02-02 00:00:00 +00:00
lbrunkho
0585130f09 ci(dockerfile): add the missing openmp dependency (#1317) 2025-02-02 00:30:06 +00:00
k4yt3x
5d043cab3b docs(book): update Linux AppImage and Ubuntu build instructions
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-27 00:00:00 +00:00
Integral
73113feb38 docs: add archlinuxcn/video2x-qt6 to readme & linux installation guide (#1307) 2025-01-25 05:48:06 +00:00
k4yt3x
a0b8611ea2 docs(readme): update readme for 6.4.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-24 00:00:00 +00:00
k4yt3x
a96bda9b4d docs(changelog): update changelogs for 6.4.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-24 00:00:00 +00:00
k4yt3x
aecb16b467 feat(video2x): use boost::po to validate the required options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-24 00:00:00 +00:00
k4yt3x
7d10fa2814 fix(encoder): re-add PTS calculation after processing for interpolators
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-21 00:00:00 +00:00
Dawei Feng
9d4b21b4c1 feat(rife): add support for rife v4.25 & v4.26 (#1304)
* chore(deps): update rife submodule
* update: add support for rife v4.25 & v4.26
* style(*): format code with clang-format

---------

Signed-off-by: k4yt3x <i@k4yt3x.com>
Co-authored-by: k4yt3x <i@k4yt3x.com>
2025-01-21 17:37:35 +00:00
k4yt3x
947788225e fix(encoder): fix a bug that causes the wrong encoder to be selected
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-20 00:00:00 +00:00
k4yt3x
eae89cea4b feat(libvideo2x): allow processing videos without PTS information
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-18 00:00:00 +00:00
k4yt3x
43ecf9e825 build(just): make CMake generator a variable
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-18 00:00:00 +00:00
k4yt3x
0bbee7c66b chore(models): remove the Real-ESRGAN x2 Plus model as it is broken
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-17 00:00:00 +00:00
k4yt3x
54b39643a9 style(*): format source code under tools with clang-format
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-14 00:00:00 +00:00
K4YT3X
031c0a72fb docs(issue): add issue templates (#1298) 2025-01-13 23:44:47 +00:00
k4yt3x
774fd4f8c2 fix(fsutils): fix resource finding in AppImage
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-11 00:00:00 +00:00
k4yt3x
55556e60a1 build(cmake): adjust installation paths on Windows 2025-01-10 16:19:34 -05:00
k4yt3x
49ce40b05f build(cmake): always use CMake install directory variables
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
b40beef9ab build(cmake): fix ncnn layer Reshape not found
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
b4b666af3e chore(models): add the Real-ESRGAN x2 Plus model
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
8b630cf0c7 build(appimage): add AppImage build script
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
68796e630e fix(*): fix missing ncnn features
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
ae9b69ac2e docs(book): update build instructions for Linux with just
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-10 00:00:00 +00:00
k4yt3x
6ab1759e1a docs(contributing): add contributing guidelines
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-09 00:00:00 +00:00
k4yt3x
9e27aed644 style(*): set deleted object pointers to nullptr
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-09 00:00:00 +00:00
k4yt3x
1edec941c7 build(cmake): fix libvideo2x output file name
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
e7096887ed style(*): remove redundant nullptr checks on object deletion (#1288)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
Henje
8ffe1b84bd feat(encoder): copy input streams' metadata to output streams (#1284)
* feat(encoder): copy language tag for audio and subtitle streams

Containers with audio streams for different languages use a tag
to signal which track contains which language. This information is
saved in the metadata object of a stream and needs to be copied
in addition to the codec properties.

* feat(encoder): copy input streams' metadata to output streams

---------

Signed-off-by: k4yt3x <i@k4yt3x.com>
Co-authored-by: k4yt3x <i@k4yt3x.com>
2025-01-08 20:39:43 +00:00
k4yt3x
b1190d7591 build(just): add attributes and rename variables
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
6b0ad2df03 build(cmake): fix build errors on Windows
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
8687d7d175 build(cmake): reorganize CMakeLists.txt and make it compatible with Ninja
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-08 00:00:00 +00:00
k4yt3x
953147ede7 style(*): convert all uses of NULL to nullptr
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
f38452ff94 fix(logging): fix logging statements not using the logger singleton
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
7c867b1b97 build(cmake): use GNU install directories
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
1668c8a050 docs(readme): update copyright year to 2025
Signed-off-by: k4yt3x <i@k4yt3x.com>
2025-01-04 00:00:00 +00:00
k4yt3x
a9b9a71e9b style(*): add .clang-format and format all files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-31 00:00:00 +00:00
k4yt3x
c95a6a46cd feat(encoder): improve av_opt_set error message
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-30 00:00:00 +00:00
k4yt3x
a72c094588 perf(*): change multiversioning target clones to x86-64-v3 and x86-64-v4
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-30 00:00:00 +00:00
k4yt3x
7665cd217c build(cmake): remove the AVX2 and AVX-512F optimization options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-26 00:00:00 +00:00
k4yt3x
2cfdb698c9 build(container): optimize container build speed
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
39a1828a3b build(cmake): disable spdlog exceptions
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
13a480c6cf docs(readme): add the video2x AUR package information
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
b6bd26c173 build(debian): update package version to 6.3.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
Integral
517003a0ba docs(book): update Linux installation instructions (#1272)
* docs(book): update linux installation instructions
* docs(book): replace apt with apt-get

---------

Co-authored-by: K4YT3X <github@k4yt3x.com>
2024-12-23 05:00:23 +00:00
k4yt3x
588c0fbe21 docs(readme): add @Integral-Tech to the special thanks list
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
a0b2330e74 build(arch): update PKGBUILD pkgname and pkgver
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
3c342f5cd5 docs(readme): update Arch Linux package information
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
31c616d8df build(cmake): add the CMake package config and target files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-23 00:00:00 +00:00
k4yt3x
a27c795614 docs(readme): fix broken links for the Ubuntu package
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-22 00:00:00 +00:00
K4YT3X
e1e8ed864d perf: improve vectorization optimizations and add function multi-versioning (#1271)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-22 10:53:09 +00:00
Integral
f68939c478 docs(readme): add archlinuxcn link (#1270)
* docs(readme): add archlinuxcn link
* docs(readme): display the available Linux packages in a list

---------

Co-authored-by: K4YT3X <github@k4yt3x.com>
2024-12-22 10:41:20 +00:00
k4yt3x
996b0bfa78 docs(readme): update readme for 6.3.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
709cf08760 fix(encoder): decreasing PTS precision with increasing video duration (#1269)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
bf5917b084 docs(readme): add French to the list of GUI languages
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
96ebd860e3 docs(readme): add sample clips for Real-CUGAN and Real-ESRGAN
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
2afbeab2aa fix(video2x): remove redundant newline statements
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
5c4d23bc97 docs(readme): update readme for 6.3.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
20e43a9724 chore: update changelogs for version 6.3.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
k4yt3x
486c23d9f4 fix(video2x): add missing Real-CUGAN help messages
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 00:00:00 +00:00
K4YT3X
127d9e0019 feat(realcugan): add support for Real-CUGAN ncnn Vulkan (#1268)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-21 02:58:19 +00:00
k4yt3x
e1e8d64056 chore(deps): update spdlog to v1.15.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-20 00:00:00 +00:00
k4yt3x
7b8e186207 feat(logger): improve logger initialization
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-20 00:00:00 +00:00
k4yt3x
f3999a431c feat(logger): improve FFmpeg logging format
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-20 00:00:00 +00:00
K4YT3X
6676cd2439 feat(logger): add logger manager to provide unified logging (#1267)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-20 04:46:10 +00:00
k4yt3x
b8eb6de59b docs(readme): add licensing information for RIFE ncnn Vulkan
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-19 00:00:00 +00:00
K4YT3X
ae2d5d32e4 feat(ns): improve optimization flags and add namespaces (#1261)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-17 16:24:51 +00:00
k4yt3x
5884dd1ba4 fix(encoder): always use the calculated PTS with corrected math
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-16 00:00:00 +00:00
k4yt3x
33ee43a088 docs(citation): add citation information
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-15 00:00:00 +00:00
k4yt3x
7ee9d60fcf docs(readme): update readme for 6.2.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-12 00:00:00 +00:00
k4yt3x
a6dfdc7343 docs(*): update changelog and readme for 6.2.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-12 00:00:00 +00:00
k4yt3x
ca5044f09c feat(libvideo2x): add optimization for scene detection
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-12 00:00:00 +00:00
k4yt3x
0e00aca401 feat(libvideo2x): change the video processor state to an enum
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-08 00:00:00 +00:00
K4YT3X
0400cf51b0 refactor(video2x): split the CLI into multiple files; improve CLI args validation (#1247)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-04 08:06:35 +00:00
k4yt3x
adf3baf4be style(video2x): fix incorrect variable name
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-03 00:00:00 +00:00
K4YT3X
d4d1e58f8d refactor(libvideo2x): convert the video processor into a class (#1246)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-03 05:22:07 +00:00
k4yt3x
a379c7481e fix(cmake): install missing headers
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-02 00:00:00 +00:00
k4yt3x
f27d8556c0 style(libvideo2x): remove C headers
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-02 00:00:00 +00:00
K4YT3X
f8dcad3aef chore(libvideo2x)!: replace the C API with C++ API (#1245)
* chore(libvideo2x)!: replace the C API with C++ API
* fix: convert wide string to u8 for av_opt_set
* style: removed unnecessary enum and struct specifiers

Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-02 07:24:30 +00:00
k4yt3x
24d43a8478 feat(video2x): update CLI help message examples
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-01 00:00:00 +00:00
K4YT3X
627f3d84a4 feat(rife): add support for frame interpolation and RIFE (#1244)
* feat: add RIFE files and processor/interpolator abstractions
* feat: add `rife` as processor option
* feat: add frame interpolation math except first frame
* feat: complete motion interpolation and add scene detection
* feat: improve Vulkan device validation
* fix: fix casting issues and variable names
* refactor: improve error-checking; add abstractions and factories
* refactor: improve readability of the frames processor
* docs: update changelog

Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-01 09:55:56 +00:00
k4yt3x
2fc89e3883 feat(video2x): print help when no args are specified
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-26 00:00:00 +00:00
k4yt3x
073f706980 docs(readme): adjust header links in README
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-23 00:00:00 +00:00
k4yt3x
a388a12d7d docs(conduct): add code of conduct
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-23 00:00:00 +00:00
k4yt3x
937939710a docs(security): add a security policy
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-23 00:00:00 +00:00
k4yt3x
ed318f61ad docs(readme): update documentation links in the README file
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-23 00:00:00 +00:00
k4yt3x
862b7f4ae8 docs(book): fixed incorrect edit URL template
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-23 00:00:00 +00:00
k4yt3x
b20f065fe0 ci(*): formatted CI pipeline files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-22 00:00:00 +00:00
k4yt3x
149cf1ca4a docs(book): added the docs.video2x.org mdBook source files and pipeline
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-22 00:00:00 +00:00
k4yt3x
a77cf9e14f ci(build): include more paths in the pipeline's triggering conditions
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-22 00:00:00 +00:00
k4yt3x
d3de1ded96 feat(video2x): improve the CLI help message structure and clarity
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-22 00:00:00 +00:00
k4yt3x
3215c89870 feat(encoder): add support for more encoder options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-22 00:00:00 +00:00
k4yt3x
169509b7d4 refactor(*): refactored the encoder and decoder into classes
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-17 00:00:00 +00:00
k4yt3x
b520d51c6c chore: removed OpenCV dependency
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-13 00:00:00 +00:00
k4yt3x
980b44bc05 fix(libvideo2x): added missing checks around freeing memory
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-13 00:00:00 +00:00
k4yt3x
561671c4cb fix(cmake): removed the redundant REQUIRED word
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-12 00:00:00 +00:00
k4yt3x
0869d153c0 docs(readme): removed the outdated label for Colab
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-10 00:00:00 +00:00
k4yt3x
4c919de6ba fix(encoder): read pix_fmts from AVCodec->pix_fmts for old libavformat
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-10 00:00:00 +00:00
k4yt3x
e393910f21 feat(encoder): added auto selection of the most suitable output pix_fmt
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-10 00:00:00 +00:00
k4yt3x
e477123e88 fix(encoder): timestamp errors processing frames with PTS equal to 0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-10 00:00:00 +00:00
k4yt3x
c8f2acdea6 feat(libplacebo): made hardware context creation failure non-critical
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-09 00:00:00 +00:00
k4yt3x
aa8ed60e52 build(debian): added a build target for Ubuntu 22.04
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-09 00:00:00 +00:00
k4yt3x
e07beb67a4 chore(video2x): moved the CLI application to a separate directory
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-08 00:00:00 +00:00
k4yt3x
bc8ae34dde refactor(libvideo2x): extracted video frame count estimation into a function
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-08 00:00:00 +00:00
k4yt3x
6a218ebd9c docs(readme): updated README for 6.1.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-07 00:00:00 +00:00
k4yt3x
0d6a6abce2 chore(release): bump version to 6.1.1
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-07 00:00:00 +00:00
k4yt3x
943b446d26 fix(encoder): make the encoder use the right color space
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-07 00:00:00 +00:00
k4yt3x
1b81f7d1e2 ci(build): make the build pipeline only run on code changes
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-07 00:00:00 +00:00
k4yt3x
64697a9385 ci(issues): added the issues auto-labeling pipeline
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-07 00:00:00 +00:00
k4yt3x
e8b0b0ec21 docs(readme): updated installation instructions for Linux
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-06 00:00:00 +00:00
k4yt3x
05b275dd82 feat(video2x): added time remaining and processing speed to the progress bar
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-06 00:00:00 +00:00
k4yt3x
33b7c53e16 fix(encoder): fixed incorrect stream mapping for multi-stream files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-06 00:00:00 +00:00
k4yt3x
3b7921a774 docs(readme): added a badge for GitHub sponsors
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-05 00:00:00 +00:00
k4yt3x
dfb29e05b7 docs(readme): updated README for 6.1.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-05 00:00:00 +00:00
k4yt3x
3bae03f403 docs(changelog): updated the changelog for 6.1.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-05 00:00:00 +00:00
k4yt3x
9ff320721f ci(build): updated the name of the build pipeline
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-05 00:00:00 +00:00
k4yt3x
7a7558e1a8 ci(release): disabled Ubuntu 24.04 build in the release pipeline
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-05 00:00:00 +00:00
k4yt3x
ec4b51064a feat(libplacebo): added Vulkan device selection for libplacebo
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-04 00:00:00 +00:00
k4yt3x
77a06e7d92 ci(release): added Ubuntu and Windows builds to the release pipeline
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-04 00:00:00 +00:00
k4yt3x
8eda3fa2d2 build(cmake): fixed the broken RealESRGAN installation rules
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-04 00:00:00 +00:00
k4yt3x
bcbe33d5dc feat(video2x): added the --listgpus option and GPU ID validation
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-04 00:00:00 +00:00
k4yt3x
850e0fde9c build(cmake): install the char_defs.h header file 2024-11-04 03:50:41 -05:00
k4yt3x
a63b8d85b0 build(makefile): added make targets for Windows 2024-11-04 03:49:20 -05:00
k4yt3x
1d1792d10f style: added platform-dependent type aliases for char and string
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-04 00:00:00 +00:00
k4yt3x
851f13bd4d fix(libvideo2x): fixed errors in estimating the total number of frames
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-03 00:00:00 +00:00
k4yt3x
fbe3b44139 feat(video2x): improved the timer
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-03 00:00:00 +00:00
k4yt3x
d6f27b3f22 fix(libplacebo): fixed wide char string path support for GLSL shader path 2024-11-02 23:13:03 -04:00
k4yt3x
fb0e3a040d fix(video2x): fixed RealESRGAN model name parsing
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
bb74144070 fix(realesrgan): fixed RealESRGAN model name variable
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
406a97f360 fix(video2x): fixed return code fetching
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
9c491d4277 feat: improved file not found messages
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
K4YT3X
27c76189d9 Merge pull request #1208 from k4yt3x/dev
feat(*): fixed wide character string paths and rewritten the CLI
2024-11-02 01:35:27 -04:00
k4yt3x
77b3df22c1 ci(build): enabled caching for Vulkan SDK installation
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
b333f88c2f build(cmake): fixed boost build path and removed redundant librife DLL
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
8cafb29f70 build(cmake): cleaned up install directives
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
afd7c8050f chore: added missing boost lib into Makefile, Debian, PKGBUILD
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
66c623ff49 chore: fixed missing boost submodule
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
0633b3fd62 ci(build): fixed build pipeline boost dependency
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
0588908dd6 fix(video2x): fixed string conversions on Linux
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-11-02 00:00:00 +00:00
k4yt3x
b309bec1cb feat(video2x): rewritten the CLI with C++ 2024-11-01 22:20:32 -04:00
k4yt3x
94e69f9f62 fix(libvideo2x): fixed wide character string paths on Windows 2024-11-01 22:19:01 -04:00
k4yt3x
a8b952c3ad feat(libplacebo): auto-detect the buffer filter's supported options
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-31 00:00:00 +00:00
k4yt3x
c912bfaffc build(makefile): added make target for ubuntu deb package
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-31 00:00:00 +00:00
k4yt3x
f5eb195d79 chore: reorganized packaging related files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-30 00:00:00 +00:00
k4yt3x
5156d4a825 fix(video2x): fixed Anime4K shader name in the help message
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-30 00:00:00 +00:00
k4yt3x
cbffef2b23 docs(readme): updated README for 6.0.0
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-29 00:00:00 +00:00
k4yt3x
31e606bd4c chore(librealesrgan): updated librealesrgan submodule path
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-29 00:00:00 +00:00
k4yt3x
d50cf54f2a style(libvideo2x): improved resource cleaning and error handling
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-29 00:00:00 +00:00
k4yt3x
613b75ffec fix(encoder): fixed incorrect encoded video frame rate
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-28 00:00:00 +00:00
k4yt3x
9d342c51a2 fix(libplacebo): fixed libplacebo shader path formatting on Windows
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-28 00:00:00 +00:00
k4yt3x
48119a30eb feat(anime4k): added version name to Anime4K GLSL shader files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-27 00:00:00 +00:00
k4yt3x
9d09d8570f feat(anime4k): added Anime4K GAN GLSL shaders
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-27 00:00:00 +00:00
Neo_Chen (BU4AK)
ebef5f54cb fix(video2x): fixed -g option in src/video2x.c and help message for libplacebo (#1197)
* fixed -g option in src/video2x.c and help message for libplacebo
* style: sorted getopt options

---------

Signed-off-by: Neo_Chen <chenkolei@gmail.com>
Co-authored-by: K4YT3X <i@k4yt3x.com>
2024-10-26 19:16:55 +00:00
k4yt3x
747d85cf9b docs(readme): updated links for 6.0.0-beta.5
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-26 00:00:00 +00:00
k4yt3x
f89b263487 ci(release): corrected release name variable
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-26 00:00:00 +00:00
k4yt3x
ebd5e8eb3d fix(realesrgan): fixed incorrect type for ncnn::Mat elemsize
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-26 00:00:00 +00:00
k4yt3x
50d5cb16d1 docs(video2x): updated command line help messages
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-26 00:00:00 +00:00
k4yt3x
8eac1a7393 feat(libplacebo): added more modes for Anime4K v4
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-26 00:00:00 +00:00
k4yt3x
f0f3166d92 chore(models): moved model files into subdirectories
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-26 00:00:00 +00:00
k4yt3x
482e82f9c4 style(*): reduced implicit casting and other styling issues
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-25 00:00:00 +00:00
k4yt3x
58ea9e4b35 feat(cmake): removed CMake policy CMP0146 for compatibility
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-22 00:00:00 +00:00
k4yt3x
e077849a2c docs(readme): updated links for 6.0.0-beta.4
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-22 00:00:00 +00:00
k4yt3x
0fb547589d feat(*): updated Dockerfile and PKGBUILD for 6.0.0-beta.4
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-22 00:00:00 +00:00
k4yt3x
1f18b8507d feat(cmake): added installation rules for FFmpeg and OpenCV DLLs 2024-10-21 21:43:11 -04:00
k4yt3x
eb7d411f49 perf(libvideo2x): removed unnecessary read of nb_frames
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-22 00:00:00 +00:00
k4yt3x
640d9cd52b fix(encoder): fixed memory leak in the encoder
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-21 00:00:00 +00:00
K4YT3X
bc168d11ab feat(libvideo2x): use OpenCV to retrieve total frame count (#1194) 2024-10-21 23:54:22 +00:00
Owen Quinlan
e09f348890 Fix missing spdlog in docker build [Fix for #1185] (#1186)
* Fix missing spdlog in docker build
* fix: added the spdlog dependency for the Dockerfile building stage

---------

Co-authored-by: K4YT3X <i@k4yt3x.com>
2024-10-14 16:51:40 +00:00
k4yt3x
f3caf22765 docs(readme): updated links for 6.0.0-beta.3
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-14 00:00:00 +00:00
K4YT3X
cd2006b4d9 feat(*): switched to spdlog for logging and organized headers (#1183)
* feat: updated PKGBUILD description
* feat: updated workflow syntax and dependencies
* feat: switched logging to spdlog
* chore: adjusted library defaults
* ci: fixed spdlog format string issues
* docs: fixed docs for libvideo2x functions
* feat: organized header files
* fix: fixed header installation directory
* feat: link spdlog statically if compiled from source
* feat: adjusted libvideo2x log level enum names
* feat: added version.h header

Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-14 02:46:59 +00:00
k4yt3x
ecbc512711 ci(build): fixed librealesrgan library name
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-11 00:00:00 +00:00
k4yt3x
3fe1f6d544 docs(readme): updated Windows download link
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-11 00:00:00 +00:00
k4yt3x
ee4d6f360e chore(librealesrgan): updated librealesrgan submodule
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-10 00:00:00 +00:00
k4yt3x
7ae1943754 docs(readme): added EOL notice for versions 4 and 5
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-10 00:00:00 +00:00
k4yt3x
c2a4b25290 ci(build): fixed missing include in conversions.h
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-10 00:00:00 +00:00
k4yt3x
f79d4893db docs(readme): updated README for 6.0.0-beta.2
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-10 00:00:00 +00:00
K4YT3X
37c2c4c647 feat(*): added support for copying audio/subtitle streams and pause/abort (#1179)
* feat: added Makefile target for debian
* fix: fixed Dockerfile installing the wrong package
* feat: added hwaccel for encoder and decoder
* feat: added benchmark mode
* feat: removed hard-coded keyframe info
* chore: cleaned up headers and organized code
* style: cleaned up headers and includes
* feat: added a progress bar for CLI
* feat: removed atomicity requirements on processed frames
* feat: added pause and abort for CLI
* chore: updated default preset and crf settings
* feat: added support for copying audio and subtitle streams
* fix: fixed syntax issues for MSVC
* fix: fixed audio/subtitle timestamp rescaling

Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-10 07:23:13 +00:00
k4yt3x
c7fa9c10e6 docs(readme): fixed logo for GitHub light theme
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-08 00:00:00 +00:00
k4yt3x
fa1dca8708 docs(*): updated CI pipeline name and added .gitattributes
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-08 00:00:00 +00:00
K4YT3X
a7952fc493 feat(*): rewritten the project with C/C++ (#1172) 2024-10-08 02:29:00 +00:00
k4yt3x
721de8cbce chore(license): bumped copyright year to 2024
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-02-10 00:46:00 +00:00
k4yt3x
7de040bbb7 fix(dockerfile): fixed the Dockerfile to work with the latest code
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-02-09 23:36:24 +00:00
k4yt3x
b382f3973f feat(video2x): dynamically import optional dependencies
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-24 11:26:16 +00:00
k4yt3x
37bdfddf55 chore(project): add the 'all' optional dependency
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-24 10:37:32 +00:00
k4yt3x
21967209b8 chore(project): update optional dependencies and classifiers
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-24 10:31:02 +00:00
k4yt3x
b4b7cadf0d tests(*): updated test file paths and removed unused dependencies
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-24 07:33:07 +00:00
k4yt3x
7c70032fe7 fix(video2x): fixed the issue where output width/height aren't calculated if they are None
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-20 05:43:45 +00:00
k4yt3x
71821dbb56 fix(pipeline): bumped Python version in pipeline
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-16 23:10:48 +00:00
k4yt3x
22993028b4 feat(video2x): updated the variables in the Video2X class for compatibility with the GUI
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-16 18:49:29 +00:00
k4yt3x
6d934e6a98 feat(style): added formatting dependencies into pyproject.toml
Signed-off-by: k4yt3x <i@k4yt3x.com>
2023-09-16 18:47:47 +00:00
k4yt3x
78a2aafa0e moved non-project ignores out of gitignore 2023-06-07 14:24:02 +00:00
k4yt3x
e535cf7333 updated PDM build backend 2023-05-31 19:18:10 +00:00
k4yt3x
e725712be9 added no progress bar warning for FFmpeg direct process scenarios 2023-05-31 15:24:12 +00:00
k4yt3x
d66b7fa144 fixed upscaler test 2023-05-31 15:23:53 +00:00
k4yt3x
155a144a93 removed file update dates, unified role names 2023-05-30 23:18:34 +00:00
k4yt3x
275f329f7f disabled formatting for example code to keep comment indentation 2023-05-29 14:08:26 +00:00
k4yt3x
60ae71f3c5 adjusted interpolation %diff from 10% to 5% 2023-05-25 21:09:58 +00:00
k4yt3x
cc01f2d8e2 refactored interpolator 2023-05-25 18:44:54 +00:00
k4yt3x
5255e20283 fixed incorrect interpolator choices; reduced libfdk_aac cutoff freq 2023-05-25 18:43:53 +00:00
k4yt3x
c746773980 added Anime4K v4 (GLSL) support via FFmpeg & libplacebo 2023-05-09 08:30:02 +00:00
k4yt3x
afc0df30cd fixed CI logo 2023-05-09 08:07:34 +00:00
k4yt3x
bb759197d8 ignored data dir 2023-05-09 08:04:19 +00:00
k4yt3x
b4570cc106 bumped year to 2023 2023-05-09 08:02:47 +00:00
k4yt3x
66f4c17294 changed license-expression to license so PDM can build the package 2022-11-13 01:14:47 +00:00
k4yt3x
30048ae304 removed the slim Docker image since it does not build properly 2022-10-07 16:19:43 +00:00
k4yt3x
84b730497b Revert "added rich console patch for Google Colab"
This reverts commit db0b87597d.
2022-09-04 21:56:40 +00:00
k4yt3x
db0b87597d added rich console patch for Google Colab 2022-09-04 21:41:57 +00:00
k4yt3x
102340e2be updated Pillow version requirements 2022-09-04 21:32:27 +00:00
k4yt3x
85437a8481 removed the walrus operator to remain compatible with Python 3.7 2022-09-04 00:06:46 +00:00
k4yt3x
176ae90bbb removed fps_mode since it causes incompatibility issues 2022-08-28 19:23:49 +00:00
k4yt3x
44238aed35 bumped vulkan image version to 1.3-470 2022-08-28 19:18:37 +00:00
k4yt3x
045e643867 pinned opencv-python to 4.5.5.64 due to bug #676 in version 4.6.0.66 2022-08-28 19:18:17 +00:00
k4yt3x
c92805e7bc added realcugan-ncnn-vulkan's license 2022-08-28 16:02:12 +00:00
k4yt3x
899fe3ae2d added realcugan-ncnn-vulkan into licenses section 2022-08-28 16:01:23 +00:00
k4yt3x
a75c2a50ca bumped version to 5.0.0-beta6 2022-08-28 16:01:07 +00:00
K4YT3X
508d6ea4d0 Merge pull request #695 from k4yt3x/feat/decouple 2022-08-28 11:51:51 -04:00
K4YT3X
8976dd8199 Merge branch 'master' into feat/decouple 2022-08-28 11:17:39 -04:00
k4yt3x
29a55e633c fixed the issue where the encoder cannot exit 2022-08-28 15:03:16 +00:00
k4yt3x
f7d6dc41b3 changed FFmpeg vsync to fps_mode 2022-08-28 03:44:27 +00:00
K4YT3X
d236131134 Merge pull request #644 from plambe/master
Fixed interpolation algorithms list
2022-05-08 17:17:12 -04:00
plambeto
d669654142 Fixed interpolation algorithms list 2022-05-08 21:16:09 +03:00
k4yt3x
4b0ab5382c added kill method to encoder 2022-05-01 08:46:33 +00:00
k4yt3x
737646a248 made processor objects a class var 2022-05-01 08:45:56 +00:00
k4yt3x
9fc0aa787e moved main to __main__; changed _run to use the new encoder and processor 2022-05-01 08:44:33 +00:00
k4yt3x
a041a60d87 added processor skeleton class 2022-05-01 08:43:13 +00:00
k4yt3x
020fb2dc80 updated value unpacking 2022-05-01 08:42:13 +00:00
k4yt3x
9a27960bf7 added decoder thread 2022-05-01 08:34:31 +00:00
k4yt3x
862b811517 moved main to __main__ 2022-05-01 08:34:00 +00:00
k4yt3x
e01d24c164 broken the upscaler into descrete parts 2022-04-28 14:33:33 +00:00
k4yt3x
0a052a3a72 simplified the encoder 2022-04-27 22:28:14 +00:00
k4yt3x
f3eaa47ec6 changed decoder from a thread into an iterator 2022-04-27 22:27:48 +00:00
K4YT3X
3f457907b6 Merge pull request #634 from snixon/checking_output
Adding check for valid output path
2022-04-13 23:33:52 -04:00
K4YT3X
a1d750e7ca combined output dir check with the previous section 2022-04-14 03:33:22 +00:00
Steve Nixon
22f656b800 Adding check for valid output path 2022-04-11 22:47:50 -07:00
k4yt3x
8eeba71ece added configs for flake8 and isort 2022-04-09 18:43:36 +00:00
k4yt3x
afca10a17b fixed #627 env vars lost in Popen processes 2022-04-09 18:40:43 +00:00
K4YT3X
f976bdc1c9 Merge pull request #629 from snixon/ffmpeg_subs_crash
ffmpeg can crash if source title has subtitles
2022-04-09 05:16:27 -04:00
Steve Nixon
51c0c38b34 ffmpeg can crash when a title has subs 2022-04-05 23:26:31 -07:00
k4yt3x
f2b2e11c41 bumped RealCUGAN to 1.0.2 2022-04-06 03:54:14 +00:00
k4yt3x
865e3bd193 fixed Flake8 issues 2022-04-06 03:39:32 +00:00
k4yt3x
e0dc8237f5 pinned pdm-pep517 version to >=0.12 2022-04-02 18:04:47 +00:00
k4yt3x
bbc1b57445 changed license field to license-expression (PEP 639) 2022-04-02 05:36:22 +00:00
k4yt3x
ebbe4570d5 check bools explicitly 2022-04-02 05:29:54 +00:00
k4yt3x
bcb2e97f89 fixed console script error 2022-04-01 07:52:28 +00:00
k4yt3x
ba29349e65 added licensing info for pynput 2022-04-01 07:21:18 +00:00
k4yt3x
1b67f373d1 removed UESR nobody as it breaks permissions 2022-04-01 06:51:27 +00:00
k4yt3x
7215ee1921 fixed release pipeline ref quoting 2022-04-01 06:27:15 +00:00
k4yt3x
65c0d32a51 updated the Dockerfiles and the pipeline for 5.0.0-beta5 2022-04-01 06:23:46 +00:00
k4yt3x
268460fd17 added pynput as dependency; fixed hotkey in headless env; disabled FFmpeg stdin 2022-03-21 21:46:08 +00:00
k4yt3x
d72ecb332a fixed variable name error 2022-03-21 03:43:48 +00:00
k4yt3x
8ba56e58c2 added pause function 2022-03-21 03:28:19 +00:00
k4yt3x
fa485b6cdd restricted Vulkan ICD files in Dockerfile 2022-03-21 00:21:00 +00:00
k4yt3x
625b340f3d added RealCUGAN 2022-03-19 17:45:03 +00:00
k4yt3x
fa3bd38217 fixed minor flake8 formatting issues 2022-03-18 23:14:20 +00:00
k4yt3x
0fca5c8e9a added cuda drivers to cuda Dockerfile; updated slim Dockerfile for current version 2022-03-18 23:10:40 +00:00
k4yt3x
237f6336ec sorted encoder input and updated vsync to cft from 1 2022-03-05 21:30:01 +00:00
k4yt3x
083af60c6f sorted imports using isort 2022-03-01 21:11:50 +00:00
k4yt3x
f7756886e7 changed progress bar color 2022-02-28 17:33:16 +00:00
k4yt3x
6e72df66fc added colored threat id for interp 2022-02-28 06:56:16 +00:00
k4yt3x
2bfcb13976 fixed fail to exit upon ^C 2022-02-28 06:49:41 +00:00
k4yt3x
49e0375eee updated PDM dependencies 2022-02-28 06:45:56 +00:00
k4yt3x
4459f4d3be redirected subprocess outputs into Rich console 2022-02-28 01:54:52 +00:00
k4yt3x
c0fe81bd2e improved main function return handling 2022-02-27 06:21:46 +00:00
k4yt3x
8cb64d3b70 install rife directly from PyPI; changed setuptools to pdm 2022-02-27 02:39:48 +00:00
k4yt3x
0b154a715c changed builder from setuptools to pdm 2022-02-27 02:38:56 +00:00
k4yt3x
05031b2b5a fixed GHA release workflow hook 2022-02-19 04:59:45 +00:00
k4yt3x
2510c8fa28 bumped script versions to beta4 2022-02-19 03:21:47 +00:00
k4yt3x
f17d75539c fixed dockerfile label syntax 2022-02-19 01:49:23 +00:00
k4yt3x
82512ef10c updated CI to build multiple versions of containers 2022-02-17 05:43:12 +00:00
k4yt3x
ad479e53b8 renamed Dockerfiles for CI 2022-02-17 05:42:48 +00:00
k4yt3x
a356bfeaff fixed workflow container image name 2022-02-17 05:08:22 +00:00
k4yt3x
dee8e23485 changed get tag command 2022-02-17 04:59:24 +00:00
k4yt3x
1fa0821057 changed container build pipeline to release 2022-02-17 04:36:26 +00:00
k4yt3x
b5ecffba81 added container build workflow 2022-02-17 04:22:27 +00:00
k4yt3x
672c9b8652 bumped version to 5.0.0-beta4 2022-02-17 03:52:04 +00:00
k4yt3x
9f73e75f17 added audio, subtitles, data, and attachments copying 2022-02-17 03:51:55 +00:00
k4yt3x
ef1a8f3e41 added extra args for run scripts 2022-02-17 03:50:38 +00:00
k4yt3x
04f409ef80 updated discussion group heading 2022-02-17 02:01:06 +00:00
k4yt3x
51c8693dce fixed legeal info print 2022-02-16 03:02:26 +00:00
k4yt3x
bb572e2468 fixed argparse help bug 2022-02-16 02:56:35 +00:00
k4yt3x
c07fafc0e9 bumped version to 5.0.0-beta3 2022-02-15 07:02:53 +00:00
k4yt3x
595b179d3c updated Library link 2022-02-15 05:49:24 +00:00
k4yt3x
c865d494a1 updated run source script paths 2022-02-15 02:30:22 +00:00
k4yt3x
f4acb2188d renamed container run scripts 2022-02-15 00:59:40 +00:00
k4yt3x
01d4006c75 changed -d to -a 2022-02-15 00:55:54 +00:00
k4yt3x
a7f0f34751 terminology change: driver -> algorithm 2022-02-15 00:54:17 +00:00
k4yt3x
b6b1bf9f0e added two container debugging scripts 2022-02-15 00:52:28 +00:00
k4yt3x
5d7a53a2fc added Python and shell examples 2022-02-15 00:52:21 +00:00
k4yt3x
b32e0ec132 updated containers documentation path 2022-02-15 00:06:56 +00:00
k4yt3x
6378a36d91 remove encoded images from memory to prevent exhaustion 2022-02-13 03:47:27 +00:00
k4yt3x
0d0fd70a24 redirected STDOUT and STDERR to prevent output from breaking the progress bar 2022-02-12 23:51:30 +00:00
K4YT3X
7c0e9c45d8 Merge pull request #598 from mayiflex/master
Update README.md
2022-02-12 20:24:07 +00:00
k4yt3x
7b60041529 replaced tqdm with rich.progress; enhanced error handling 2022-02-12 09:08:28 +00:00
k4yt3x
6ffd6282e0 removed tqdm files from project 2022-02-12 09:08:05 +00:00
mayiflex
c37e7f0d72 Update README.md
Fixed hyperlink to the Collab Notebook with instructions
2022-02-12 09:58:54 +01:00
k4yt3x
ca1e593874 let setup read version from init 2022-02-12 06:45:59 +00:00
k4yt3x
bfb0f339e2 fixed log format issue 2022-02-12 06:45:33 +00:00
k4yt3x
3690337092 fixed FFmpeg memory exhaustion issue by limiting the queue size 2022-02-12 05:14:00 +00:00
k4yt3x
6c129a1c7a fixed a typo in release link 2022-02-11 22:28:50 +00:00
k4yt3x
2b539c15f7 updated setup licensing and classification info 2022-02-11 22:28:34 +00:00
k4yt3x
53456cd442 updated gitignore 2022-02-11 06:59:44 +00:00
k4yt3x
e1f4cdd71d updated licensing info in source files 2022-02-11 06:55:07 +00:00
k4yt3x
ab6d2e3c9e reorganized README sections and docs 2022-02-11 01:33:04 +00:00
k4yt3x
f69c95a608 completed the Telegram group's description 2022-02-10 03:50:50 +00:00
k4yt3x
c103e45076 updated release information 2022-02-10 03:47:31 +00:00
k4yt3x
240d722fda updated the Dockerfiles to use full URL 2022-02-10 03:26:01 +00:00
k4yt3x
14f3cd1e16 removed Docker badge since we no longer use Docker Hub 2022-02-08 07:02:49 +00:00
k4yt3x
f4cc178dcd removed outdated CodeQL workflow 2022-02-08 07:02:34 +00:00
k4yt3x
ad825bd2ba removed git checkout from CodeQL workflow 2022-02-08 06:53:45 +00:00
k4yt3x
151733c8f8 updated README and legal/licensing info 2022-02-08 06:49:57 +00:00
K4YT3X
544a7081ed Merge pull request #593 from k4yt3x/5.0.0-beta
5.0.0 beta
2022-02-08 05:30:28 +00:00
k4yt3x
4b3bde1615 updated license to AGPL 3.0 2022-02-08 05:21:55 +00:00
k4yt3x
b38cef2de2 removed outdated issue templates 2022-02-08 05:21:36 +00:00
k4yt3x
b27da8a61a updated funding info 2022-02-08 05:21:13 +00:00
k4yt3x
5e4170b0b7 fixed CI pipeline build stage 2022-02-08 05:06:26 +00:00
k4yt3x
b3539d4aa8 removed Gifski wrapper which is no longer being used 2022-02-08 05:01:20 +00:00
k4yt3x
d09efc4748 rewritten the CI pipeline for 5.0.0 2022-02-07 01:07:04 +00:00
k4yt3x
dc532ff184 updated video2x package information 2022-02-04 22:01:45 +00:00
k4yt3x
1fbb2f22f3 removed files for Jenkins website 2022-02-04 21:46:21 +00:00
k4yt3x
339815f74c added the CUDA-based Dockerfile as default 2022-02-04 21:00:38 +00:00
k4yt3x
fa6dc88faa updated metadata in the Alpine Dockerfile 2022-02-04 21:00:23 +00:00
k4yt3x
ce344caa72 renamed the Alpine-based Dockerfile 2022-02-04 20:56:58 +00:00
k4yt3x
d8aed8065b added OpenCV file open check 2022-02-02 15:20:03 +00:00
k4yt3x
6b83734382 added new requirements items 2022-02-02 15:19:14 +00:00
k4yt3x
2b52d4aa45 changed Rife dependency path 2022-02-02 15:18:32 +00:00
k4yt3x
a515886ad8 updated the setup.cfg to include new dependencies 2022-02-02 15:17:46 +00:00
k4yt3x
a7629db518 rewritten the Dockerfile for 5.0.0 2022-02-02 15:17:27 +00:00
K4YT3X
ba336e9c75 renamed SRMD and RealSR classes per Python conventions 2021-08-17 14:43:49 +00:00
K4YT3X
736771b1c8 added *-ncnn-vulkan dependencies into requirements.txt 2021-08-17 14:41:59 +00:00
K4YT3X
f9f736bec1 removed add_help=False and redundant numpy import 2021-08-17 14:40:31 +00:00
K4YT3X
535681f3cd renamed RIFE to Rife per Python conventions 2021-08-17 14:39:50 +00:00
K4YT3X
f283a12a0b fixed another upscaler diff threshold calculation error 2021-07-06 02:19:38 +00:00
K4YT3X
ac80de9399 fixed upscaler diff threshold bug 2021-07-06 01:27:32 +00:00
K4YT3X
7eabac2175 committing changes for 5.0.0-beta 2021-07-06 00:56:56 +00:00
K4YT3X
e870399af1 moved src to video2x for PyPI 2021-07-06 00:56:12 +00:00
K4YT3X
37d567f208 Merge pull request #480 from Presc/master
Update README.md
2021-03-14 04:17:13 +00:00
K4YT3X
7b9e811c99 Updated Bad Apple demo links with 120FPS versions' links 2021-03-14 04:16:32 +00:00
Prescot
0d97a11015 Update README.md
Updated old bad apple demo link to new updated version.
2021-03-13 14:20:18 +00:00
K4YT3X
079a2aa64b Merge pull request #471 from PeterDaveHello/fix-docker-build
Fix sources.list path in Dockerfile, cc #470
2021-02-24 16:57:20 +00:00
Peter Dave Hello
9cdddd2e41 Fix sources.list path in Dockerfile, cc #470 2021-02-25 00:30:40 +08:00
K4YT3X
26d82e1582 Merge pull request #470 from PeterDaveHello/fix-docker-build
Fix Docker image build by using Ubuntu old-release apt repository
2021-02-23 21:45:12 +00:00
Peter Dave Hello
c4e73cfbc7 Fix Docker image build by using Ubuntu old-release apt repository
Ubuntu 19.10 is EOL, but due to Nvidia library compatibility issue, the
base image of the Dockerfile wasn't upgraded to newer Ubuntu yet, and a
standard apt repository site won't be reachable in this case, which
makes the Docker image not able to be built. Before the base image
upgrade, a workaround to use old-releases apt repository can make the
image be able to be built again.
2021-02-23 20:13:37 +08:00
K4YT3X
2fffeeadf1 Merge pull request #453 from FrostyTheDumDum/master
Update README.md
2021-01-29 18:01:10 +00:00
Frosty!
25155b3029 Update README.md 2021-01-29 16:37:54 +05:30
K4YT3X
26795c5561 fixed issue #427 2021-01-23 17:01:38 -05:00
K4YT3X
5543382d03 fixed issue 443 2021-01-23 16:48:29 -05:00
K4YT3X
dc51b8b04c attempting to fix #442 2021-01-23 16:33:40 -05:00
K4YT3X
cde02be32b updated license dates 2021-01-23 16:33:19 -05:00
K4YT3X
9213e3e13a set default fallback locale for gettext 2021-01-07 00:35:58 -05:00
K4YT3X
b41f1f7e6c corrected ncnn Vulkan drivers' names 2021-01-07 00:34:18 -05:00
K4YT3X
7201c036d5 Merge branch 'master' of github.com:k4yt3x/video2x 2020-12-29 01:25:27 -05:00
K4YT3X
da532d8e13 renamed image file names and added workflow diagrams 2020-12-29 01:25:17 -05:00
K4YT3X
f97ed080e1 updated Video2X banner files 2020-12-20 21:32:10 -05:00
K4YT3X
d67f55c824 updated Video2X banner to be compatible with GitHub's new dark theme 2020-12-21 02:31:40 +00:00
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
k4yt3x
5cf3271aad added Bad Apple!! to demo videos 2020-05-11 16:24:09 -04:00
k4yt3x
bcbead4d96 updated CLI usages 2020-05-11 06:57:16 -04:00
k4yt3x
a3d0465e44 updated GUI screenshot 2020-05-11 05:32:39 -04:00
k4yt3x
995fdec5c8 updated sample video URLs 2020-05-11 05:18:00 -04:00
k4yt3x
5c3ea51ccb updated demo video links 2020-05-11 05:13:06 -04:00
k4yt3x
a24b321088 updated translations 2020-05-11 04:41:05 -04:00
k4yt3x
a83249c670 fixed waifu2x-caffe pixel format check typo 2020-05-11 04:38:33 -04:00
k4yt3x
ab2f982a84 fixed waifu2x-caffe parsing error 2020-05-11 04:33:38 -04:00
k4yt3x
91401977da added frame preview, redesigned driver instance initiation and argument parsing 2020-05-11 04:17:21 -04:00
k4yt3x
99971bceb1 adjusted GUI dimensions 2020-05-10 00:59:16 -04:00
k4yt3x
0c6de8af16 re-added CLI usages 2020-05-09 23:31:34 -04:00
k4yt3x
4def30f516 added prerequisites in README 2020-05-09 23:22:36 -04:00
k4yt3x
8d553ac575 added a link for download builds 2020-05-09 23:14:24 -04:00
k4yt3x
e1a1cf578b moved badges below the icon 2020-05-09 23:13:12 -04:00
k4yt3x
4015617152 updated README for recent code updates 2020-05-09 23:12:37 -04:00
k4yt3x
648bf4fd3d added video2x banner files 2020-05-09 23:12:20 -04:00
k4yt3x
e3ed08ff40 updated logo files 2020-05-09 22:20:40 -04:00
k4yt3x
90f807655a better about and error dialog 2020-05-09 20:27:04 -04:00
k4yt3x
ab77d62c71 updated config file comments 2020-05-09 20:13:08 -04:00
k4yt3x
a64fabae87 added more GUI options for waifu2x-converter-cpp 2020-05-09 20:10:12 -04:00
k4yt3x
26558c6159 changed some wording in upscaler 2020-05-09 19:40:18 -04:00
k4yt3x
4fbbb20258 updated zh_CN translation files 2020-05-09 19:40:07 -04:00
k4yt3x
4659a9a9f5 changed gitignore to include translation files 2020-05-09 19:39:51 -04:00
k4yt3x
4c48af4fa4 output intermediate video-only file if stream migration fails 2020-05-09 19:30:24 -04:00
k4yt3x
4a6f90a1f0 fixing temp directory loading problem attempt 2 2020-05-09 05:49:59 -04:00
k4yt3x
2d9c5fe751 fixed custom cache path loading issues 2020-05-09 05:39:40 -04:00
k4yt3x
bef3861d3c fixed some spelling errors in waifu2x-caffe 2020-05-09 05:39:19 -04:00
k4yt3x
bcb54b6d2c yielding multithreading control to srmd/waifu2x-ncnn-vulkan, fixing FFmpeg framerate detection 2020-05-09 04:54:28 -04:00
k4yt3x
e82a26d44f deleted some unused imports 2020-05-09 02:23:21 -04:00
k4yt3x
14f7f34ee3 build script displays v2x version when building 2020-05-09 01:11:03 -04:00
k4yt3x
11ba334f16 added more comments and ffmpeg Video2X signature 2020-05-09 01:01:12 -04:00
k4yt3x
c451b14bd7 fixed waifu2x-converter-cpp path error 2020-05-09 00:54:57 -04:00
k4yt3x
80623a6bb7 fixed waifu2x-converter-cpp constraints 2020-05-09 00:47:12 -04:00
k4yt3x
a5dd87a72c updated build script to read version from args 2020-05-08 22:35:10 -04:00
k4yt3x
9b20ef89c9 fixed Anime4KCPP execution issues 2020-05-08 22:34:53 -04:00
k4yt3x
91efe2d684 updated zh_CN translation 2020-05-08 22:12:33 -04:00
k4yt3x
0d9d5c4f43 fixed progress monitor error, enhanced GUI error display 2020-05-08 22:12:24 -04:00
k4yt3x
e0e42b11c8 update qtcreator file 2020-05-08 20:29:08 -04:00
k4yt3x
790bb54598 redesigned UI progress display 2020-05-08 20:28:46 -04:00
k4yt3x
f2943802cb upgraded input QLineEdit to QTableView 2020-05-08 17:37:16 -04:00
k4yt3x
d12f2a3888 deleted blank lines 2020-05-08 17:32:36 -04:00
k4yt3x
871d6386a8 added file drag and drop to GUI 2020-05-07 21:11:33 -04:00
k4yt3x
589a68caf7 removed some obsolete items from gitignore 2020-05-07 19:59:04 -04:00
k4yt3x
afacc48e1e added qtcreator project file 2020-05-07 19:58:51 -04:00
k4yt3x
4a3553607b deleted some empty lines with indentations in the project 2020-05-07 19:55:33 -04:00
k4yt3x
988600a769 fixed checkbox return value type error 2020-05-07 19:50:40 -04:00
k4yt3x
36aa3bf1d4 GUI resolve driver paths into absolute paths 2020-05-07 16:31:05 -04:00
k4yt3x
9dde3c66f1 build script 1.0.1: building into directory with name of version 2020-05-07 16:30:36 -04:00
k4yt3x
e9c1c22788 better exception handling, soft task interruption, GUI stop button, GUI folder processing, better argument checks 2020-05-07 15:58:22 -04:00
k4yt3x
134e8b7080 uncommented some keys unmanaged by v2x 2020-05-07 10:03:42 -04:00
k4yt3x
a295b4a54f finished adding comments for all drivers 2020-05-07 09:58:25 -04:00
k4yt3x
c198082190 updated new Anime4KCPP parameters 2020-05-07 09:38:13 -04:00
k4yt3x
8f2dc43af3 updated UI for newest Anime4KCPP 2020-05-07 09:33:37 -04:00
k4yt3x
b0ce8f3ff9 added environment variable expansion support, updated for newest Anime4KCPP 2020-05-07 09:33:12 -04:00
k4yt3x
0b1f7b8422 replaced absolute paths with environment variables, updated for newest Anime4KCPP 2020-05-07 09:32:51 -04:00
k4yt3x
def20650e2 added environment variable expansion support 2020-05-07 09:32:15 -04:00
k4yt3x
7489376404 fixed srmd-ncnn-vulkan path not added issue in the setup script 2020-05-07 09:02:42 -04:00
k4yt3x
826279ce09 fixing image captions 2020-05-06 20:48:19 -04:00
k4yt3x
88d2cd9e14 updated README screenshots and added image captions 2020-05-06 20:40:35 -04:00
k4yt3x
31728ff625 added PowerShell automatic build script 2020-05-06 20:20:51 -04:00
k4yt3x
3168737fd4 added time elapsed, time remaining and speed rate 2020-05-06 20:20:38 -04:00
k4yt3x
5fbc195740 unified config path case 2020-05-06 20:19:49 -04:00
K4YT3X
40d0d79141 added a patreon badge 2020-05-06 20:03:49 +00:00
k4yt3x
37a0966bad added binary path loading and error dialog system 2020-05-06 15:36:55 -04:00
k4yt3x
baf4c5815f added pyqt5 into requirements 2020-05-06 14:30:59 -04:00
k4yt3x
d25a478e64 added automatic constraint update upon driver selection 2020-05-06 14:27:21 -04:00
K4YT3X
ba723c6216 enable sponsorships 2020-05-06 17:46:35 +00:00
k4yt3x
11ea8a7a21 added config descriptions for some drivers 2020-05-06 13:24:32 -04:00
k4yt3x
3bce37416b GUI 2.0 design and basic functionalities finished 2020-05-06 13:24:10 -04:00
k4yt3x
e3cfe13b5c fixed some bugs in GUI 2020-05-06 11:01:14 -04:00
k4yt3x
81d8ce78cb updated default values 2020-05-06 10:40:04 -04:00
k4yt3x
89fa91c8c5 updated GUI UI file for new settings 2020-05-06 10:39:47 -04:00
k4yt3x
c8dbb90f5b added waifu2x-caffe and waifu2x-converter-cpp settings to GUI 2020-05-06 10:39:34 -04:00
k4yt3x
685120011b added Waifu2x-Extension-GUI into the related projects section 2020-05-06 04:57:43 -04:00
k4yt3x
82da40327b updated Video2X GUI screenshot 2020-05-06 04:48:04 -04:00
k4yt3x
9b4fb3258a video2x GUI 2.0.0: completely redesigned and rewritten with PyQt5 2020-05-06 04:45:48 -04:00
k4yt3x
f00a10aa91 added image files and project files 2020-05-06 04:44:36 -04:00
k4yt3x
93e8f36ffb fixed a typo 2020-05-06 00:12:49 -04:00
k4yt3x
f10e59099c deprecated JSON config file 2020-05-06 00:12:31 -04:00
k4yt3x
82715ade18 addressed srmd-ncnn-vulkan and waifu2x-ncnn-vulkan model path issues 2020-05-05 02:49:10 -04:00
K4YT3X
63de63e594 added master branch version badge 2020-05-05 06:29:03 +00:00
K4YT3X
8daeb862a4 updated README terminal screenshot 2020-05-05 06:26:39 +00:00
k4yt3x
be0d1f1d08 added some badges 2020-05-05 02:22:37 -04:00
k4yt3x
ec1327b5d8 updated README for version 4.0.0 2020-05-05 01:51:24 -04:00
k4yt3x
5b3e5604cc fixed srmd-ncnn-vulkan binary path issue 2020-05-05 01:12:12 -04:00
k4yt3x
a2fc71d6c5 fixed Anime4KCPP upscaling bug 2020-05-05 01:11:50 -04:00
k4yt3x
ab684bcd48 updated default Anime4KCPP path 2020-05-05 01:11:37 -04:00
k4yt3x
d26b406813 setup script 1.8.0: added Anime4KCPP setup support 2020-05-05 01:11:26 -04:00
k4yt3x
133b837b15 added language zh_CN 2020-05-04 20:25:43 -04:00
k4yt3x
9aebc77883 removing default values for model directories for multi-platform support 2020-05-04 20:25:32 -04:00
k4yt3x
b8472f155a added internationalization support 2020-05-04 20:25:12 -04:00
k4yt3x
19e6d241d5 fixing driver argument TypeError 2020-05-04 17:19:48 -04:00
k4yt3x
89860f22cb 4.0.0 new argument parsing mechanism and project structure 2020-05-04 17:12:41 -04:00
k4yt3x
88299d404a removed anime4k support and added Anime4KCPP support; cleaned up the program 2020-05-03 19:20:23 -04:00
k4yt3x
0f1639ed62 adding Anime4KCPP support 2020-05-03 19:19:19 -04:00
k4yt3x
3b6462d1da removing support for Anime4K (Java) 2020-05-03 19:19:00 -04:00
k4yt3x
43a2078330 moving wrappers into a sub-directory 2020-05-03 19:18:39 -04:00
k4yt3x
b1e844dcad updated README for setup script 1.7.0 2020-04-26 20:12:42 -04:00
k4yt3x
becce32d3e setup script 1.7.0: added support for srmd-ncnn-vulkan 2020-04-26 20:12:06 -04:00
k4yt3x
d2ddf32527 updated README for 3.2.0 2020-04-26 20:04:37 -04:00
k4yt3x
7224c53997 3.2.0 added SRMD NCNN Vulkan support 2020-04-26 20:01:37 -04:00
k4yt3x
2ed9bd4da6 updated configuration files for SRMD NCNN Vulkan 2020-04-26 20:00:01 -04:00
k4yt3x
38c52cdfd2 updated JSON config file to match YAML 2020-04-26 19:40:21 -04:00
k4yt3x
80579d3fa9 updated absolutify paths function 2020-04-26 13:40:22 -04:00
k4yt3x
47f94dfd6c updated Anime4K ZIP file download URL 2020-04-24 00:22:39 -04:00
k4yt3x
c470dde5da fixing issue #220 2020-04-04 06:24:40 -04:00
k4yt3x
c532ac3c88 updated file modification dates and editor information 2020-03-23 09:05:24 -04:00
K4YT3X
f50ceecd62 Merge pull request #214 from 28598519a/master
Fix k4yt3x#211 bug
2020-03-23 08:55:16 -04:00
劃破黑夜
2ba0e951f9 Fix k4yt3x#211 bug 2020-03-17 22:01:56 +08:00
k4yt3x
5753ea8f52 updated readme for version 3.1.0 2020-02-26 22:31:51 -05:00
k4yt3x
09db8bedd0 3.1.0 switched to multi-processing and added KeyboardInterrupt support 2020-02-26 05:28:48 -05:00
k4yt3x
6a100b1526 removed multi-threading in favor of muti-processing 2020-02-26 05:27:57 -05:00
k4yt3x
a2150a8dbc fixing progress bar error due to string case mismatch 2020-02-22 02:31:39 -05:00
k4yt3x
78ded08ed5 changed default number of threads to 1 2020-02-21 23:16:22 -05:00
k4yt3x
5db2cfd2a3 added anime4k instructions 2020-01-12 03:32:25 -05:00
k4yt3x
652b9f34bd fixing #180 bug2 attempt 2 2020-01-04 17:03:16 -05:00
k4yt3x
f3c50ea728 fixing #180 bug2 2020-01-04 16:59:51 -05:00
k4yt3x
880087241d updated waifu2x-ncnn-vulkan path key for new config structure 2020-01-04 16:56:08 -05:00
k4yt3x
067e17290a 1.6.1 changed driver paths to 3.0.0 config style 2020-01-04 16:49:13 -05:00
k4yt3x
fc675e7899 updated copyright date 2020-01-04 16:48:37 -05:00
K4YT3X
2d81270e44 Set theme jekyll-theme-slate 2019-12-22 06:00:02 +00:00
K4YT3X
3ace2447c2 Create CNAME 2019-12-22 05:48:39 +00:00
K4YT3X
30b0e2c7bf Delete CNAME 2019-12-22 05:48:25 +00:00
k4yt3x
d54fea0310 enables available memory warning for Linux platform 2019-12-19 23:03:58 -05:00
k4yt3x
332055a4e5 fixed temp directory cleaning problem on exit 2019-12-11 22:20:01 -05:00
k4yt3x
19e17b1a8f updated platform information 2019-12-11 21:59:38 -05:00
k4yt3x
9e745fb747 video2x_gui 1.1.3: fixed driver path key name 2019-12-11 21:59:20 -05:00
K4YT3X
fd5edead7e Merge pull request #171 from YOUSIKI/master
Check platform correctly
2019-11-30 19:56:08 +00:00
YOUSIKI
aa7c0b3f12 Check platform correctly
Continue if running on win32.
Exit if running on other platforms.
2019-11-30 22:56:34 +08:00
k4yt3x
65cc4c6afb Merge branch '3.0.0' 2019-11-26 04:14:13 -05:00
k4yt3x
bd2da021bd updated README for 3.0.0 2019-11-26 04:12:04 -05:00
k4yt3x
7e888db7b2 formatted YAML file 2019-11-26 04:10:01 -05:00
k4yt3x
7726a86e35 added platform check, made PermissionError more obvious 2019-11-26 04:03:03 -05:00
K4YT3X
a0595136ab Create CNAME 2019-11-18 06:43:00 +00:00
K4YT3X
5c93a5a73b Delete CNAME 2019-11-18 06:42:54 +00:00
K4YT3X
7b9b87fa9b Create CNAME 2019-11-17 05:41:13 +00:00
k4yt3x
cb255da65c added missing sys library import 2019-11-16 02:54:25 -05:00
k4yt3x
d503325a62 changed YAML load to FullLoader to make it WIndows-compatible 2019-11-16 02:52:33 -05:00
k4yt3x
954233c238 changed default config path from JSON to YAML 2019-11-16 01:51:01 -05:00
k4yt3x
95416f68a8 make the GUI script YAML-compatible 2019-11-16 01:50:41 -05:00
k4yt3x
dce778b3bf 1.1.2 fixed repeated output file extensions 2019-11-15 22:40:48 -05:00
k4yt3x
c537dd726c changed YAML loader to Windows compatible FullLoader 2019-11-15 22:40:19 -05:00
k4yt3x
b1918a4a8a fixed pixel_formats print bug and subprocess execution bug 2019-11-15 02:39:27 -05:00
k4yt3x
7ae9618785 updated file modification date 2019-11-15 02:38:39 -05:00
k4yt3x
eb3d29103c fixed anime4k path key 2019-11-15 02:38:11 -05:00
k4yt3x
a188f6ebda 1.6.0 added support for YAML, better exception handling 2019-11-15 02:04:12 -05:00
k4yt3x
fd67dfca11 docstring modifications, added JDK warning 2019-11-15 02:03:44 -05:00
k4yt3x
b1f29f1098 fixed NCNN Vulkan driver argument error 2019-11-15 01:09:55 -05:00
k4yt3x
fe7c0c840d fixed type error for waifu2x-ncnn-vulkan argument 2019-10-24 21:33:05 -04:00
k4yt3x
dc2410d4da renaming variables, using YAML to replace JSON 2019-10-19 21:53:12 -04:00
k4yt3x
91ac512d57 remove .exe extension for Linux compatibility 2019-10-19 21:52:31 -04:00
k4yt3x
732288f075 renamed waifu2x_settings to driver_settings 2019-10-19 21:52:11 -04:00
k4yt3x
e812c228c3 updated file permissions 2019-10-19 21:51:18 -04:00
k4yt3x
9841fa9577 converted JSON config into YAML 2019-10-19 21:45:44 -04:00
k4yt3x
5391f59847 renamed bin to src since python isn't binary 2019-10-19 21:40:00 -04:00
231 changed files with 36657 additions and 2902 deletions

8
.clang-format Normal file
View File

@@ -0,0 +1,8 @@
BasedOnStyle: Chromium
AlignAfterOpenBracket: BlockIndent
AllowShortEnumsOnASingleLine: false
BinPackArguments: false
BreakStringLiterals: false
ColumnLimit: 100
IndentWidth: 4
InsertBraces: true

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
models/** linguist-vendored

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: k4yt3x
patreon: k4yt3x

View File

@@ -1,32 +0,0 @@
---
name: Bug report
about: Use this template if you believe you've encountered a bug.
title: ''
labels: bug
assignees: K4YT3X
---
## Environment Information
|Module|Version|
|-|-|
|`Video2X`||
|`FFmpeg`||
|`waifu2x-caffe`||
|`waifu2x-converter-cpp`||
|`waifu2x-ncnn-vulkan`||
## Symptom
Briefly describe what's going on.
## Screenshots or Error Messages
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:
```
```

39
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,39 @@
---
name: Bug report
about: Report a bug in the program
title: "<Bug summary>"
labels: type:Bug
assignees: ''
---
**Describe the bug**
A clear and concise description of the bug.
**To Reproduce**
Steps to reproduce the behavior:
1. Do this...
2. Do that...
3. See error here...
**Expected behavior**
A clear and concise description of what you expected to happen.
**Actual behavior**
A clear and concise description of what actually happened.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS: `e.g., Windows 11 24H2 or Arch Linux`
- GPU: `e.g., NVIDIA GeForce RTX 4090`
- Video2X Version: `e.g., 6.3.1`
**Full command**
If applicable, add the full command you used to run the program.
**Additional context**
Add any other context about the problem here.

View File

@@ -1,16 +1,20 @@
---
name: Feature request
about: Request a new feature to be added
title: ''
labels: enhancement
assignees: K4YT3X
about: Request a feature to be added or suggest an idea
title: "<Feature summary>"
labels: type:Enhancement
assignees: ''
---
## Description
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Briefly describe the feature you want to be added into `video2x`.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
## Sources
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
Paste links to descriptions of related documentations, websites and etc. here.
**Additional context**
Add any other context or screenshots about the feature request here.

179
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,179 @@
name: Build
on:
push:
paths:
- ".github/workflows/build.yml"
- "include/**"
- "src/**"
- "tools/**"
- "third_party/**"
- "CMakeLists.txt"
pull_request:
paths:
- ".github/workflows/build.yml"
- "include/**"
- "src/**"
- "tools/**"
- "third_party/**"
- "CMakeLists.txt"
workflow_dispatch:
jobs:
ubuntu:
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install dependencies
run: |
git submodule update --init --recursive
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options-dev
- name: Build Video2X
run: |
mkdir -p /tmp/build /tmp/install
cmake -B /tmp/build -S . -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DINSTALL_BIN_DESTINATION=. -DINSTALL_INCLUDE_DESTINATION=include \
-DINSTALL_LIB_DESTINATION=. -DINSTALL_MODEL_DESTINATION=. \
-DCMAKE_INSTALL_PREFIX=/tmp/install
cmake --build /tmp/build --config Debug --target install
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: video2x-nightly-linux-amd64
path: /tmp/install
windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.4.304.1
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools, SPIRV-Headers
vulkan-use-cache: true
- name: Install dependencies
shell: pwsh
run: |
$ffmpegVersion = "7.1"
$ncnnVersion = "20241226"
git submodule update --init --recursive
curl -Lo ffmpeg-shared.zip "https://github.com/GyanD/codexffmpeg/releases/download/$ffmpegVersion/ffmpeg-$ffmpegVersion-full_build-shared.zip"
Expand-Archive -Path ffmpeg-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ffmpeg-$ffmpegVersion-full_build-shared" -NewName ffmpeg-shared
curl -Lo ncnn-shared.zip "https://github.com/Tencent/ncnn/releases/download/$ncnnVersion/ncnn-$ncnnVersion-windows-vs2022-shared.zip"
Expand-Archive -Path ncnn-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ncnn-$ncnnVersion-windows-vs2022-shared" -NewName ncnn-shared
- name: Build Video2X
shell: pwsh
run: |
cmake -S . -B build `
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF -DVIDEO2X_USE_EXTERNAL_BOOST=OFF `
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=build/video2x_install
cmake --build build --config Debug --parallel --target install
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: video2x-nightly-windows-amd64
path: build/video2x_install
container:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build the Docker image
with:
registry: ghcr.io
dockerfile: packaging/docker/Dockerfile
image: video2x
tags: latest
pushImage: false
appimage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install dependencies
run: |
git submodule update --init --recursive
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential cmake clang pkg-config ninja-build curl file fuse \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options1.83-dev \
libboost-program-options1.83.0 \
libspdlog-dev
- name: Build Video2X
run: |
cmake -G Ninja -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DNCNN_BUILD_SHARED_LIBS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DNCNN_AVX512=OFF \
-DCMAKE_INSTALL_PREFIX=AppDir/usr
cmake --build build --config Release --target install --parallel
- name: Build AppImage
run: |
sudo curl -Lo /usr/local/bin/linuxdeploy \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
sudo chmod +x /usr/local/bin/linuxdeploy
LD_LIBRARY_PATH=AppDir/usr/lib linuxdeploy \
--appdir AppDir \
--executable AppDir/usr/bin/video2x \
--exclude-library "libvulkan.so.1" \
--desktop-file packaging/appimage/video2x.desktop \
--icon-file packaging/appimage/video2x.png \
--output appimage
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: Video2X-x86_64.AppImage
path: Video2X-x86_64.AppImage

49
.github/workflows/docs.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Docs
on:
push:
branches:
- master
paths:
- "docs/book/**"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install mdBook
run: |
version="$(curl https://api.github.com/repos/rust-lang/mdBook/releases/latest | jq -r '.tag_name')"
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/$version/mdbook-$version-x86_64-unknown-linux-musl.tar.gz" | tar -xz
sudo mv mdbook /usr/local/bin/
- name: Build Docs with mdBook
run: mdbook build -d "$PWD/build/docs/book" docs/book
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: "build/docs/book"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

52
.github/workflows/issues.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Issues
on:
issues:
types:
- opened
- reopened
- closed
jobs:
label_issues:
runs-on: ubuntu-latest
steps:
- name: Remove all 'state:' labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
REPO=${{ github.repository }}
EXISTING_LABELS=$(gh issue view $ISSUE_NUMBER --repo $REPO --json labels --jq '.labels[].name')
for label in $EXISTING_LABELS; do
if [[ $label == state:* ]]; then
gh issue edit $ISSUE_NUMBER --remove-label "$label" --repo $REPO
fi
done
- name: Add 'state:Backlog' label on issue opened or reopened
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
LABEL_NAME="state:Backlog"
REPO=${{ github.repository }}
ISSUE_NUMBER=${{ github.event.issue.number }}
if gh label list --repo $REPO | grep -q "$LABEL_NAME"; then
gh issue edit $ISSUE_NUMBER --add-label "$LABEL_NAME" --repo $REPO
fi
- name: Add 'state:Done' label on issue closed
if: ${{ github.event.action == 'closed' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
LABEL_NAME="state:Done"
REPO=${{ github.repository }}
ISSUE_NUMBER=${{ github.event.issue.number }}
if gh label list --repo $REPO | grep -q "$LABEL_NAME"; then
gh issue edit $ISSUE_NUMBER --add-label "$LABEL_NAME" --repo $REPO
fi

166
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,166 @@
name: Release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
setup:
name: Setup
if: github.event.base_ref == 'refs/heads/master'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Get version
id: get_version
run: echo version=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
ubuntu-2404:
# GitHub Actions' ubuntu-24.04 runner does not have enough RAM
if: false
name: Build Ubuntu 24.04 release
needs:
- setup
runs-on: ubuntu-24.04
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install dependencies
run: |
git submodule update --init --recursive
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options-dev
- name: Build Video2X
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DCMAKE_INSTALL_PREFIX=build/video2x-linux-ubuntu-2404-amd64/usr
cmake --build build --config Release --target install --parallel
mkdir -p build/video2x-linux-ubuntu-2404-amd64/DEBIAN
cp packaging/debian/control build/video2x-linux-ubuntu-2404-amd64/DEBIAN/control
dpkg-deb --build build/video2x-linux-ubuntu-2404-amd64
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: video2x-linux-ubuntu-2404-amd64
path: build/video2x-linux-ubuntu-2404-amd64.deb
windows:
# Disabled because it takes too long to build
if: false
name: Build Windows release
needs:
- setup
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.4.304.1
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools, SPIRV-Headers
vulkan-use-cache: true
- name: Install dependencies
shell: pwsh
run: |
$ffmpegVersion = "7.1"
$ncnnVersion = "20240820"
git submodule update --init --recursive
curl -Lo ffmpeg-shared.zip "https://github.com/GyanD/codexffmpeg/releases/download/$ffmpegVersion/ffmpeg-$ffmpegVersion-full_build-shared.zip"
Expand-Archive -Path ffmpeg-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ffmpeg-$ffmpegVersion-full_build-shared" -NewName ffmpeg-shared
curl -Lo ncnn-shared.zip "https://github.com/Tencent/ncnn/releases/download/$ncnnVersion/ncnn-$ncnnVersion-windows-vs2022-shared.zip"
Expand-Archive -Path ncnn-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ncnn-$ncnnVersion-windows-vs2022-shared" -NewName ncnn-shared
- name: Build Video2X
shell: pwsh
run: |
cmake -S . -B build `
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF -DVIDEO2X_USE_EXTERNAL_BOOST=OFF `
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/video2x_install
cmake --build build --config Release --parallel --target install
- name: Compress artifacts
run: |
Compress-Archive -Path build/video2x_install/* -DestinationPath build/video2x-windows-amd64.zip
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: video2x-windows-amd64
path: build/video2x-windows-amd64.zip
container:
name: Build and upload container
needs:
- setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push the Docker image
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
dockerfile: packaging/docker/Dockerfile
image: video2x
tags: latest, ${{ needs.setup.outputs.version }}
create-release:
name: Create release
needs:
- setup
# - ubuntu-2404
# - windows
- container
runs-on: ubuntu-latest
# outputs:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
# - name: Download artifacts
# uses: actions/download-artifact@v7
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ needs.setup.outputs.version }}
name: ${{ needs.setup.outputs.version }}
draft: true
prerelease: false

164
.gitignore vendored
View File

@@ -1,113 +1,77 @@
# Runtime files
upscaled/
frames/
waifu2x-caffe/
testvid.mp4
# Data files
data/
# PyCharm
.idea/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
# Built-binaries
bin/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Prerequisites
*.d
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Object files
*.o
*.ko
*.obj
*.elf
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Linker output
*.ilk
*.map
*.exp
# Translations
*.mo
*.pot
# Precompiled Headers
*.gch
*.pch
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Libraries
*.lib
*.a
*.la
*.lo
# Flask stuff:
instance/
.webassets-cache
# Shared objects (inc. Windows DLLs)
*.dll
#*.so
*.so.*
*.dylib
# Scrapy stuff:
.scrapy
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Sphinx documentation
docs/_build/
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# PyBuilder
target/
# Kernel Module Compile Results
#*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
# Jupyter Notebook
.ipynb_checkpoints
# clang tooling compilation databases
.cache/
*.plist
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# CMake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json

18
.gitmodules vendored Normal file
View File

@@ -0,0 +1,18 @@
[submodule "third_party/ncnn"]
path = third_party/ncnn
url = https://github.com/Tencent/ncnn.git
[submodule "third_party/spdlog"]
path = third_party/spdlog
url = https://github.com/gabime/spdlog.git
[submodule "third_party/boost"]
path = third_party/boost
url = https://github.com/boostorg/boost.git
[submodule "third_party/librealesrgan_ncnn_vulkan"]
path = third_party/librealesrgan_ncnn_vulkan
url = https://github.com/k4yt3x/librealesrgan-ncnn-vulkan.git
[submodule "third_party/librealcugan_ncnn_vulkan"]
path = third_party/librealcugan_ncnn_vulkan
url = https://github.com/k4yt3x/librealcugan-ncnn-vulkan.git
[submodule "third_party/librife_ncnn_vulkan"]
path = third_party/librife_ncnn_vulkan
url = https://github.com/k4yt3x/librife-ncnn-vulkan.git

338
.justfile Normal file
View File

@@ -0,0 +1,338 @@
# Use PowerShell to run recipes on Windows
set windows-shell := ['pwsh', '-Command']
# Default build directory, generator, and C++ compiler
bindir := "build"
generator := "Ninja"
cxx := "clang++"
# Test video and output paths
test_video := "data/standard-test.mp4"
test_output := "data/output.mp4"
[unix]
[group('build')]
build:
cmake -G '{{generator}}' -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER={{cxx}} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DVIDEO2X_ENABLE_NATIVE=ON
cmake --build {{bindir}} --config Release --parallel --target install
[windows]
[group('build')]
build:
cmake -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DCMAKE_INSTALL_BINDIR="." \
-DCMAKE_INSTALL_LIBDIR="." \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_INSTALL_DATADIR="." \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DVIDEO2X_USE_EXTERNAL_BOOST=OFF
cmake --build {{bindir}} --config Release --parallel --target install
[unix]
[group('build')]
static:
cmake -G '{{generator}}' -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER={{cxx}} \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DVIDEO2X_USE_EXTERNAL_BOOST=OFF
cmake --build {{bindir}} --config Release --parallel --target install
[unix]
[group('build')]
debug:
cmake -G '{{generator}}' -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER={{cxx}} \
-DCMAKE_BUILD_TYPE=Debug
cmake --build {{bindir}} --config Debug --parallel
[windows]
[group('build')]
debug:
cmake -S . -B {{bindir}} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX={{bindir}}/video2x-install \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DVIDEO2X_USE_EXTERNAL_BOOST=OFF
cmake --build {{bindir}} --config Debug --parallel
[unix]
[group('build')]
debian:
apt-get update
apt-get install -y --no-install-recommends \
build-essential cmake clang pkg-config ninja-build \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libspdlog-dev \
libboost-program-options-dev
cmake -G '{{generator}}' -B /tmp/build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DCMAKE_CXX_COMPILER={{cxx}} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/tmp/install \
-DINSTALL_BIN_DESTINATION=. \
-DINSTALL_INCLUDE_DESTINATION=include \
-DINSTALL_LIB_DESTINATION=. \
-DINSTALL_MODEL_DESTINATION=.
cmake --build /tmp/build --config Release --target install --parallel
[unix]
[group('build')]
ubuntu2404:
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential cmake pkg-config ninja-build \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options-dev
cmake -G '{{generator}}' -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
cmake --build build --config Release --target install --parallel
mkdir -p video2x-linux-ubuntu-amd64/DEBIAN
cp packaging/debian/control.ubuntu2404 video2x-linux-ubuntu-amd64/DEBIAN/control
dpkg-deb --build video2x-linux-ubuntu-amd64
[unix]
[group('build')]
ubuntu2204:
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntuhandbook1/ffmpeg7
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential cmake ninja-build \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options-dev
cmake -G '{{generator}}' -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=video2x-linux-ubuntu-amd64/usr
cmake --build build --config Release --target install --parallel
mkdir -p video2x-linux-ubuntu-amd64/DEBIAN
cp packaging/debian/control.ubuntu2204 video2x-linux-ubuntu-amd64/DEBIAN/control
dpkg-deb --build video2x-linux-ubuntu-amd64
[unix]
[group('build')]
appimage:
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential cmake clang pkg-config ninja-build curl file fuse \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options1.83-dev \
libboost-program-options1.83.0 \
libspdlog-dev
cmake -G '{{generator}}' -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DNCNN_BUILD_SHARED_LIBS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DNCNN_AVX512=OFF \
-DCMAKE_INSTALL_PREFIX=AppDir/usr
cmake --build build --config Release --target install --parallel
rm -rf AppDir/usr/share/video2x/models/rife/rife \
AppDir/usr/share/video2x/models/rife/rife-HD \
AppDir/usr/share/video2x/models/rife/rife-UHD \
AppDir/usr/share/video2x/models/rife/rife-anime \
AppDir/usr/share/video2x/models/rife/rife-v2 \
AppDir/usr/share/video2x/models/rife/rife-v2.3 \
AppDir/usr/share/video2x/models/rife/rife-v2.4 \
AppDir/usr/share/video2x/models/rife/rife-v3.0 \
AppDir/usr/share/video2x/models/rife/rife-v3.1
curl -Lo /usr/local/bin/linuxdeploy \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x /usr/local/bin/linuxdeploy
LD_LIBRARY_PATH=AppDir/usr/lib linuxdeploy \
--appdir AppDir \
--executable AppDir/usr/bin/video2x \
--exclude-library "libvulkan.so.1" \
--desktop-file packaging/appimage/video2x.desktop \
--icon-file packaging/appimage/video2x.png \
--output appimage
[unix]
[group('misc')]
clean:
rm -vrf {{bindir}} data/output*.* heaptrack*.zst valgrind.log
[windows]
[group('misc')]
clean:
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path build,data/output*.*
[unix]
[group('test')]
test-realesrgan:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3
[unix]
[group('test')]
test-realcugan:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realcugan -s 4 -n 0 --realcugan-model models-se
[unix]
[group('test')]
test-libplacebo:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a
[unix]
[group('test')]
test-rife:
LD_LIBRARY_PATH={{bindir}} {{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p rife -m 4 --rife-model rife-v4.6
[unix]
[group('test')]
memcheck-realesrgan:
LD_LIBRARY_PATH={{bindir}} valgrind \
--tool=memcheck \
--leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--show-reachable=yes \
--verbose --log-file="valgrind.log" \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realesrgan -s 2 --realesrgan-model realesr-animevideov3 \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
memcheck-realcugan:
LD_LIBRARY_PATH={{bindir}} valgrind \
--tool=memcheck \
--leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--show-reachable=yes \
--verbose --log-file="valgrind.log" \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realcugan -s 2 -n 0 --realcugan-model models-se \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
memcheck-libplacebo:
LD_LIBRARY_PATH={{bindir}} valgrind \
--tool=memcheck \
--leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--show-reachable=yes \
--verbose --log-file="valgrind.log" \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
memcheck-rife:
LD_LIBRARY_PATH={{bindir}} valgrind \
--tool=memcheck \
--leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--show-reachable=yes \
--verbose --log-file="valgrind.log" \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p rife -m 4 --rife-model rife-v4.6 \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
heaptrack-realesrgan:
LD_LIBRARY_PATH={{bindir}} HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realesrgan -s 4 --realesrgan-model realesr-animevideov3 \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
heaptrack-realcugan:
LD_LIBRARY_PATH={{bindir}} HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p realcugan -s 4 -n 0 --realcugan-model models-se \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
heaptrack-libplacebo:
LD_LIBRARY_PATH={{bindir}} HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p libplacebo -w 1920 -h 1080 --libplacebo-shader anime4k-v4-a \
-e preset=veryfast -e crf=30
[unix]
[group('test')]
heaptrack-rife:
LD_LIBRARY_PATH={{bindir}} HEAPTRACK_ENABLE_DEBUGINFOD=1 heaptrack \
{{bindir}}/video2x \
-i {{test_video}} -o {{test_output}} \
-p rife -m 4 --rife-model rife-v4.6 \
-e preset=veryfast -e crf=30

140
CHANGELOG.md Normal file
View File

@@ -0,0 +1,140 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Option to recalculate the PTS.
- Real-ESRGAN models `realesr-general-x4v3` and `realesr-general-wdn-x4v3` (#1319).
- (Video2X Qt6) Korean translation.
### Changed
- Separate audio and subtitle stream copying options.
## [6.4.0] - 2025-01-24
### Added
- Multi-versioning to critical functions to enhance performance in generic architecture builds.
- RIFE models `v4.25` and `v4.26` (#1304).
- Support for processing videos without PTS information (#1278).
- The feature to copy input streams' metadata to the output streams (#1282).
- (Video2X Qt6) German translation (#1279).
- (Video2X Qt6) Option to remove finished tasks from the queue.
- (Video2X Qt6) Option to specify actions after processing is complete.
- (Video2X Qt6) Support for adding and removing tasks during processing (#1281).
- (Video2X Qt6) The feature to automatically set codec to PNG for images (#1204).
- (Video2X Qt6) The preferences dialog.
### Changed
- Improve the CMake optimization flags and option names.
- (Video2X Qt6) Embed translation files in the executable to avoid missing resources (#1250).
- (Video2X Qt6) Redesign the main window UI to improve usability.
### Fixed
- A bug that causes the wrong encoder to be selected.
- (Video2X Qt6) Incorrect font used for the Japanese translation (#1276).
## [6.3.1] - 2024-12-21
### Fixed
- The issue of decreasing PTS precision with increasing video duration (#1269).
- (Video2X Qt6) Errors restoring Real-CUGAN configs in the Edit Task dialog.
- (Video2X Qt6) The incorrect comparison of version numbers.
## [6.3.0] - 2024-12-20
### Added
- A logger manager to provide unified logging across the application.
- Support for Real-CUGAN ncnn Vulkan (#1198).
- (Video2X Qt6) A check to ensure the required VC++ Redistributable version is installed.
- (Video2X Qt6) A configuration manager to save user preferences like the last selected language.
- (Video2X Qt6) A new logging widget to display logs in the UI.
- (Video2X Qt6) Custom options `crf=20` and `preset=slow` to the default encoder options.
- (Video2X Qt6) French translation.
- (Video2X Qt6) The ability to check for available updates and prompt the user to update.
- (Video2X Qt6) Tooltips for processor and encoder options.
### Changed
- Improve optimization flags and add namespaces for better code organization.
- (Video2X Qt6) Add processor names to processed videos instead of `.processed`.
- (Video2X Qt6) The output video suffix from auto-generated to `.mkv`.
### Fixed
- Make the encoder always use the calculated PTS with corrected math.
- (Video2X Qt6) The issue where task configs are being restored incorrectly in the UI.
## [6.2.0] - 2024-12-11
### Added
- Automatic selection of the most suitable pixel format for the output video.
- Frame interpolation processing mode.
- More `AVCodecContext` options.
- Support for RIFE ncnn Vulkan.
- Support for specifying arbitrary `AVOptions` for the encoder (#1232).
- (Video2X Qt6) Visual C++ Redistributable version check to the installer.
### Changed
- Improve CLI argument validation.
- Improve error handling and error messages.
- Improve the CLI help message structure and clarity.
- (Video2X Qt6) Improve the UI with a complete redesign.
### Removed
- The C API for easier maintenance and development.
### Fixed
- Timestamp errors processing frames with PTS equal to 0 (#1222).
## [6.1.1] - 2024-11-07
### Added
- Time remaining, and processing speed to the status bar.
### Fixed
- Stream mapping for cases where the video stream is not the first stream in the input file (#1217).
- The encoder using the wrong color space for the output video.
## [6.1.0] - 2024-11-04
### Added
- A better timer that gets paused when the processing is paused.
- Detection for the validity of the provided GPU ID.
- The `--listgpus` option to list available Vulkan GPU devices.
- Vulkan device selection for libplacebo.
- (Video2X Qt6) Status bar and processing statistics.
### Changed
- Automatically detect if options `colorspace` and `range` are supported by the buffer filter.
- Resource file missing error messages.
- Rewritten the CLI with C++.
### Fixed
- Wide character string paths support on Windows systems without UTF-8 support enabled (#1201).
## [6.0.0] - 2024-10-29
### Added
- The initial release of the 6.0.0 version of Video2X.

16
CITATION.cff Normal file
View File

@@ -0,0 +1,16 @@
cff-version: 1.2.0
title: Video2X
abstract: >-
Video2X is a A machine learning-based video super resolution and frame interpolation framework.
message: Please cite this software using these metadata.
type: software
authors:
- name: K4YT3X
date-released: 2018-02-24
url: https://video2x.org
repository-code: https://github.com/k4yt3x/video2x
license: AGPL-3.0
keywords:
- machine learning
- super resolution
- frame interpolation

495
CMakeLists.txt Normal file
View File

@@ -0,0 +1,495 @@
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(video2x VERSION 6.4.0 LANGUAGES CXX)
include(CMakePackageConfigHelpers)
include(ExternalProject)
include(GNUInstallDirs)
# The FindBoost module is removed in CMake 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
# Set the default build type to Release if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Build options
option(BUILD_SHARED_LIBS "Build libvideo2x as a shared library" ON)
option(VIDEO2X_BUILD_CLI "Build the video2x command line interface executable" ON)
option(VIDEO2X_USE_EXTERNAL_NCNN "Use the system-provided ncnn library" ON)
option(VIDEO2X_USE_EXTERNAL_SPDLOG "Use the system-provided spdlog library" ON)
option(VIDEO2X_USE_EXTERNAL_BOOST "Use the system-provided Boost library" ON)
option(VIDEO2X_ENABLE_NATIVE "Enable optimizations for the native architecture" OFF)
option(VIDEO2X_ENABLE_X86_64_V4 "Enable x86-64-v4 (AVX-512) optimizations" OFF)
option(VIDEO2X_ENABLE_X86_64_V3 "Enable x86-64-v3 (AVX2) optimizations" OFF)
# Enable extra compiler warnings
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/W4 /permissive-)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wconversion -Wshadow)
endif()
# Set the default optimization flags for Release builds
if(CMAKE_BUILD_TYPE STREQUAL "Release")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/Ox /Ot /GL /DNDEBUG)
add_link_options(/LTCG /OPT:REF /OPT:ICF)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-O3 -ffunction-sections -fdata-sections)
add_link_options(-Wl,-s -flto -Wl,--gc-sections)
endif()
endif()
# Enable the requested architecture-specific optimizations
if(VIDEO2X_ENABLE_NATIVE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/arch:NATIVE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-march=native)
endif()
elseif(VIDEO2X_ENABLE_X86_64_V4)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/arch:AVX512)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-march=x86-64-v4)
endif()
elseif(VIDEO2X_ENABLE_X86_64_V3)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/arch:AVX2)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-march=x86-64-v3)
endif()
endif()
# Generate the version header file
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/libvideo2x/version.h"
@ONLY
)
# Add the libvideo2x shared library
add_library(libvideo2x
src/avutils.cpp
src/conversions.cpp
src/decoder.cpp
src/encoder.cpp
src/filter_libplacebo.cpp
src/filter_realcugan.cpp
src/filter_realesrgan.cpp
src/fsutils.cpp
src/interpolator_rife.cpp
src/libplacebo.cpp
src/libvideo2x.cpp
src/logger_manager.cpp
src/processor_factory.cpp
)
# Set the C++ standard to C++17
target_compile_features(libvideo2x PRIVATE cxx_std_17)
# Set the shared library output name and disable C++ extensions
set_target_properties(libvideo2x PROPERTIES
PREFIX ""
OUTPUT_NAME libvideo2x
CXX_EXTENSIONS OFF
)
# Include directories for the shared library
target_include_directories(libvideo2x PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_SOURCE_DIR}/include/libvideo2x"
"${PROJECT_SOURCE_DIR}/third_party/librealesrgan_ncnn_vulkan/src"
"${PROJECT_SOURCE_DIR}/third_party/librealcugan_ncnn_vulkan/src"
"${PROJECT_SOURCE_DIR}/third_party/librife_ncnn_vulkan/src"
)
# Add the export definition for the exported symbols
target_compile_definitions(libvideo2x PRIVATE LIBVIDEO2X_EXPORTS)
# Set debug compile options
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(libvideo2x PRIVATE $<$<CONFIG:Debug>:/Zi /Od /MDd>)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(libvideo2x PRIVATE
$<$<NOT:$<PLATFORM_ID:Windows>>:-fPIC>
$<$<CONFIG:Debug>:-g -O0>
)
endif()
# FFmpeg
if(WIN32)
set(ffmpeg_base_path "${PROJECT_SOURCE_DIR}/third_party/ffmpeg-shared")
target_include_directories(libvideo2x SYSTEM PRIVATE "${ffmpeg_base_path}/include")
target_link_libraries(libvideo2x PRIVATE
"${ffmpeg_base_path}/lib/avcodec.lib"
"${ffmpeg_base_path}/lib/avfilter.lib"
"${ffmpeg_base_path}/lib/avformat.lib"
"${ffmpeg_base_path}/lib/avutil.lib"
"${ffmpeg_base_path}/lib/swscale.lib"
)
else()
# Use pkg-config to find FFmpeg libraries
find_package(PkgConfig REQUIRED)
# Find and configure FFmpeg libraries
pkg_check_modules(libavcodec REQUIRED libavcodec)
pkg_check_modules(libavfilter REQUIRED libavfilter)
pkg_check_modules(libavformat REQUIRED libavformat)
pkg_check_modules(libavutil REQUIRED libavutil)
pkg_check_modules(libswscale REQUIRED libswscale)
# Apply include directories and libraries directly to the target
target_include_directories(libvideo2x SYSTEM PRIVATE
${libavcodec_INCLUDE_DIRS}
${libavfilter_LIBRARIES}
${libavformat_INCLUDE_DIRS}
${libavutil_INCLUDE_DIRS}
${libswscale_INCLUDE_DIRS}
)
target_link_libraries(libvideo2x PRIVATE
${libavcodec_LIBRARIES}
${libavfilter_LIBRARIES}
${libavformat_LIBRARIES}
${libavutil_LIBRARIES}
${libswscale_LIBRARIES}
)
endif()
# ncnn
if(VIDEO2X_USE_EXTERNAL_NCNN)
find_package(ncnn REQUIRED)
else()
if(WIN32)
# Use the pre-built shared ncnn library on Windows
set(ncnn_base_path "${PROJECT_SOURCE_DIR}/third_party/ncnn-shared/x64")
add_library(ncnn SHARED IMPORTED)
set_target_properties(ncnn PROPERTIES
IMPORTED_LOCATION "${ncnn_base_path}/bin/ncnn.dll"
IMPORTED_IMPLIB "${ncnn_base_path}/lib/ncnn.lib"
INTERFACE_INCLUDE_DIRECTORIES "${ncnn_base_path}/include/ncnn"
)
else()
option(NCNN_INSTALL_SDK "" ON)
option(SKIP_GLSLANG_INSTALL "" OFF)
option(NCNN_PIXEL_ROTATE "" OFF)
option(NCNN_PIXEL_AFFINE "" OFF)
option(NCNN_PIXEL_DRAWING "" OFF)
option(NCNN_VULKAN "" ON)
option(NCNN_VULKAN_ONLINE_SPIRV "" ON)
option(NCNN_BUILD_BENCHMARK "" OFF)
option(NCNN_BUILD_TESTS "" OFF)
option(NCNN_BUILD_TOOLS "" OFF)
option(NCNN_BUILD_EXAMPLES "" OFF)
option(NCNN_DISABLE_RTTI "" ON)
option(NCNN_DISABLE_EXCEPTION "" ON)
option(NCNN_INT8 "" OFF)
option(NCNN_BUILD_SHARED_LIBS "" OFF)
option(WITH_LAYER_absval "" OFF)
option(WITH_LAYER_argmax "" OFF)
option(WITH_LAYER_batchnorm "" OFF)
option(WITH_LAYER_bias "" OFF)
option(WITH_LAYER_bnll "" OFF)
option(WITH_LAYER_concat "" ON)
option(WITH_LAYER_convolution "" ON)
option(WITH_LAYER_crop "" ON)
option(WITH_LAYER_deconvolution "" ON)
option(WITH_LAYER_dropout "" OFF)
option(WITH_LAYER_eltwise "" ON)
option(WITH_LAYER_elu "" OFF)
option(WITH_LAYER_embed "" OFF)
option(WITH_LAYER_exp "" OFF)
option(WITH_LAYER_flatten "" ON)
option(WITH_LAYER_innerproduct "" ON)
option(WITH_LAYER_input "" ON)
option(WITH_LAYER_log "" OFF)
option(WITH_LAYER_lrn "" OFF)
option(WITH_LAYER_memorydata "" ON)
option(WITH_LAYER_mvn "" OFF)
option(WITH_LAYER_pooling "" ON)
option(WITH_LAYER_power "" OFF)
option(WITH_LAYER_prelu "" ON)
option(WITH_LAYER_proposal "" OFF)
option(WITH_LAYER_reduction "" ON)
option(WITH_LAYER_relu "" ON)
option(WITH_LAYER_reshape "" ON)
option(WITH_LAYER_roipooling "" OFF)
option(WITH_LAYER_scale "" ON)
option(WITH_LAYER_sigmoid "" ON)
option(WITH_LAYER_slice "" ON)
option(WITH_LAYER_softmax "" OFF)
option(WITH_LAYER_split "" ON)
option(WITH_LAYER_spp "" OFF)
option(WITH_LAYER_tanh "" OFF)
option(WITH_LAYER_threshold "" OFF)
option(WITH_LAYER_tile "" OFF)
option(WITH_LAYER_rnn "" OFF)
option(WITH_LAYER_lstm "" OFF)
option(WITH_LAYER_binaryop "" ON)
option(WITH_LAYER_unaryop "" ON)
option(WITH_LAYER_convolutiondepthwise "" OFF)
option(WITH_LAYER_padding "" ON)
option(WITH_LAYER_squeeze "" OFF)
option(WITH_LAYER_expanddims "" OFF)
option(WITH_LAYER_normalize "" OFF)
option(WITH_LAYER_permute "" OFF)
option(WITH_LAYER_priorbox "" OFF)
option(WITH_LAYER_detectionoutput "" OFF)
option(WITH_LAYER_interp "" ON)
option(WITH_LAYER_deconvolutiondepthwise "" OFF)
option(WITH_LAYER_shufflechannel "" OFF)
option(WITH_LAYER_instancenorm "" OFF)
option(WITH_LAYER_clip "" ON)
option(WITH_LAYER_reorg "" OFF)
option(WITH_LAYER_yolodetectionoutput "" OFF)
option(WITH_LAYER_quantize "" OFF)
option(WITH_LAYER_dequantize "" OFF)
option(WITH_LAYER_yolov3detectionoutput "" OFF)
option(WITH_LAYER_psroipooling "" OFF)
option(WITH_LAYER_roialign "" OFF)
option(WITH_LAYER_packing "" ON)
option(WITH_LAYER_requantize "" OFF)
option(WITH_LAYER_cast "" ON)
option(WITH_LAYER_hardsigmoid "" OFF)
option(WITH_LAYER_selu "" OFF)
option(WITH_LAYER_hardswish "" OFF)
option(WITH_LAYER_noop "" OFF)
option(WITH_LAYER_pixelshuffle "" ON)
option(WITH_LAYER_deepcopy "" OFF)
option(WITH_LAYER_mish "" OFF)
option(WITH_LAYER_statisticspooling "" OFF)
option(WITH_LAYER_swish "" OFF)
option(WITH_LAYER_gemm "" OFF)
option(WITH_LAYER_groupnorm "" OFF)
option(WITH_LAYER_layernorm "" OFF)
option(WITH_LAYER_softplus "" OFF)
option(WITH_LAYER_gru "" OFF)
option(WITH_LAYER_multiheadattention "" OFF)
option(WITH_LAYER_gelu "" OFF)
option(WITH_LAYER_convolution1d "" OFF)
option(WITH_LAYER_pooling1d "" OFF)
option(WITH_LAYER_convolutiondepthwise1d "" OFF)
option(WITH_LAYER_convolution3d "" OFF)
option(WITH_LAYER_convolutiondepthwise3d "" OFF)
option(WITH_LAYER_pooling3d "" OFF)
option(WITH_LAYER_matmul "" OFF)
option(WITH_LAYER_deconvolution1d "" OFF)
option(WITH_LAYER_deconvolutiondepthwise1d "" OFF)
option(WITH_LAYER_deconvolution3d "" OFF)
option(WITH_LAYER_deconvolutiondepthwise3d "" OFF)
option(WITH_LAYER_einsum "" OFF)
option(WITH_LAYER_deformableconv2d "" OFF)
option(WITH_LAYER_gridsample "" ON)
add_subdirectory(third_party/ncnn)
endif()
endif()
target_link_libraries(libvideo2x PRIVATE ncnn)
# spdlog
if(VIDEO2X_USE_EXTERNAL_SPDLOG)
find_package(spdlog REQUIRED)
target_include_directories(libvideo2x SYSTEM PRIVATE ${spdlog_INCLUDE_DIRS})
target_link_libraries(libvideo2x PRIVATE spdlog::spdlog)
else()
# spdlog exceptions are incompatible with ncnn
option(SPDLOG_NO_EXCEPTIONS "" ON)
option(SPDLOG_INSTALL "" ON)
add_subdirectory(third_party/spdlog)
target_link_libraries(libvideo2x PRIVATE spdlog::spdlog_header_only)
endif()
# Add Real-ESRGAN, Real-CUGAN, and RIFE
option(USE_SYSTEM_NCNN "" ${VIDEO2X_USE_EXTERNAL_NCNN})
add_subdirectory(third_party/librealesrgan_ncnn_vulkan/src)
add_subdirectory(third_party/librealcugan_ncnn_vulkan/src)
add_subdirectory(third_party/librife_ncnn_vulkan/src)
# Prevent the min and max macros from causing error C2589 on Windows
if(WIN32)
target_compile_definitions(librealesrgan-ncnn-vulkan PRIVATE -DNOMINMAX)
target_compile_definitions(librealcugan-ncnn-vulkan PRIVATE -DNOMINMAX)
target_compile_definitions(librife-ncnn-vulkan PRIVATE -DNOMINMAX)
endif()
# Link the shared library to the ncnn-Vulkan libraries
target_link_libraries(libvideo2x PRIVATE
librealesrgan-ncnn-vulkan
librealcugan-ncnn-vulkan
librife-ncnn-vulkan
)
# Common installation rules for libvideo2x and models
install(TARGETS libvideo2x
EXPORT Video2XTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libvideo2x"
)
# Install the header files from the include directory
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/libvideo2x/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libvideo2x"
FILES_MATCHING PATTERN "*.h"
)
# Install the generated version.h file
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/libvideo2x/version.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libvideo2x"
)
# Export targets and create CMake package config
install(EXPORT Video2XTargets
FILE Video2XTargets.cmake
NAMESPACE Video2X::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Video2X"
)
# Generate the CMake package config file
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Video2XConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/Video2XConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Video2X"
)
# Install the CMake package config file
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Video2XConfig.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Video2X"
)
# Install the model files
if(WIN32)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/models" DESTINATION "${CMAKE_INSTALL_DATADIR}")
else()
install(DIRECTORY "${CMAKE_SOURCE_DIR}/models" DESTINATION "${CMAKE_INSTALL_DATADIR}/video2x")
endif()
# Install the FFmpeg and ncnn shared libraries
if(WIN32)
file(GLOB ffmpeg_dlls "${ffmpeg_base_path}/bin/*.dll")
install(FILES ${ffmpeg_dlls} DESTINATION "${CMAKE_INSTALL_BINDIR}")
if(NOT VIDEO2X_USE_EXTERNAL_BOOST)
install(FILES "${ncnn_base_path}/bin/ncnn.dll" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
endif()
# Build the video2x CLI executable
if(VIDEO2X_BUILD_CLI)
add_executable(video2x
tools/video2x/src/argparse.cpp
tools/video2x/src/newline_safe_sink.cpp
tools/video2x/src/timer.cpp
tools/video2x/src/validators.cpp
tools/video2x/src/video2x.cpp
tools/video2x/src/vulkan_utils.cpp
)
# Set the C++ standard to C++17
target_compile_features(video2x PRIVATE cxx_std_17)
# Set the shared library output name and disable C++ extensions
set_target_properties(video2x PROPERTIES
OUTPUT_NAME video2x
CXX_EXTENSIONS OFF
)
# Include directories for the executable
target_include_directories(video2x PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/include"
"${PROJECT_SOURCE_DIR}/tools/video2x/include"
)
# Link the executable with the shared library
target_link_libraries(video2x PRIVATE libvideo2x)
# Set debug compile options
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(video2x PRIVATE $<$<CONFIG:Debug>:/Zi /Od /MDd>)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(video2x PRIVATE $<$<CONFIG:Debug>:-g -O0>)
endif()
# FFmpeg
if(WIN32)
target_include_directories(video2x SYSTEM PRIVATE
"${PROJECT_SOURCE_DIR}/third_party/ffmpeg-shared/include"
)
target_link_libraries(video2x PRIVATE
"${ffmpeg_base_path}/lib/avcodec.lib"
"${ffmpeg_base_path}/lib/avutil.lib"
)
else()
# FFmpeg libraries have already been found
# Apply include directories and libraries directly to the target
target_include_directories(video2x SYSTEM PRIVATE
${libavcodec_INCLUDE_DIRS}
${libavutil_INCLUDE_DIRS}
)
target_link_libraries(video2x PRIVATE ${libavcodec_LIBRARIES} ${libavutil_LIBRARIES})
endif()
# spdlog
# spdlog targets has already been added
if(VIDEO2X_USE_EXTERNAL_SPDLOG)
target_include_directories(video2x SYSTEM PRIVATE ${spdlog_INCLUDE_DIRS})
target_link_libraries(video2x PRIVATE spdlog::spdlog)
else()
target_link_libraries(video2x PRIVATE spdlog::spdlog_header_only)
endif()
# Vulkan
find_package(Vulkan REQUIRED)
target_link_libraries(video2x PRIVATE Vulkan::Vulkan)
# Boost
if(VIDEO2X_USE_EXTERNAL_BOOST)
find_package(Boost REQUIRED COMPONENTS program_options)
else()
option(Boost_USE_STATIC_LIBS "" ON)
option(Boost_USE_STATIC_RUNTIME "" ON)
option(Boost_COMPONENTS program_options)
add_subdirectory(third_party/boost)
target_include_directories(video2x SYSTEM PRIVATE
${PROJECT_SOURCE_DIR}/third_party/boost/libs/program_options/include
)
# Suppress the -Wsign-conversion warnings for Boost.Nowide
if (TARGET boost_nowide AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(boost_nowide PRIVATE -Wno-error=sign-conversion)
endif()
endif()
target_link_libraries(video2x PRIVATE Boost::program_options)
# Install the video2x executable
install(TARGETS video2x RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
# Install the Boost DLL
if(WIN32 AND NOT VIDEO2X_USE_EXTERNAL_BOOST)
set(boost_base_path
"${CMAKE_BINARY_DIR}/third_party/boost/libs/program_options/${CMAKE_BUILD_TYPE}"
)
# Different build types have different DLL names
if(CMAKE_BUILD_TYPE STREQUAL Release)
set(boost_dll_path "${boost_base_path}/boost_program_options-vc143-mt-x64-1_86.dll")
else()
set(boost_dll_path "${boost_base_path}/boost_program_options-vc143-mt-gd-x64-1_86.dll")
endif()
install(FILES "${boost_dll_path}" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
endif()

20
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,20 @@
# Code of Conduct
## Our Goal
Our goal is to create a respectful and inclusive environment for everyone involved in our project.
## Our Standards
- **Respect Others**: Treat everyone with respect, regardless of their background or beliefs.
- **Resolve Peacefully**: Address disagreements constructively and aim for peaceful resolutions.
- **Report Problems**: If you witness or experience any issues, report them to [github@k4yt3x.com](mailto:github@k4yt3x.com).
## Enforcement
- **Confidentiality**: Reports will be handled confidentially.
- **Action**: The project team will review and address reported issues promptly and appropriately.
## Contact
For any questions or concerns, please contact us at [github@k4yt3x.com](mailto:github@k4yt3x.com).

114
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,114 @@
# Contributing to Video2X
Thank you for considering contributing to Video2X. This document outlines the guidelines for contributing to ensure a smooth and effective development process. Should you have any questions or require assistance, please do not hesitate to reach out to the project maintainers.
## Commit Messages
Commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. This helps maintain a consistent and informative project history.
### Commit Message Format
```text
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
#### Common Types
- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation updates
- **perf**: Performance improvements that do not affect the code's behavior
- **style**: Changes that do not affect the code's functionality (e.g., formatting)
- **refactor**: Code changes that neither fix a bug nor add a feature
- **test**: Adding or modifying tests
- **chore**: Maintenance or other non-functional updates
#### Common Scopes
Including a scope is optional but is strongly encouraged. One commit should only address changes to a single module or component. If a change must affect multiple modules, use `*` as the scope.
- **avutils**: The audio/video utilities
- **conversions**: The video format conversion utilities
- **decoder**: The video decoder module
- **encoder**: The video encoder module
- **fsutils**: The file system utilities
- **logging**: Any logging-related changes
- **libplacebo**: The libplacebo filter
- **realesrgan**: The Real-ESRGAN filter
- **realcugan**: The Real-CUGAN filter
- **rife**: The RIFE frame interpolator
- **video2x**: The Video2X command-line interface
#### Example
```
feat(encoder): add support for specifying video pixel format
Add the `pix_fmt` field to the `EncoderConfig` struct to allow users to specify the pixel format for encoding.
Closes #12345
```
## Documentation of Changes
All changes must be documented in the `CHANGELOG.md` file. The changelog must adhere to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.
### Example Changelog Entry
```markdown
## [Unreleased]
### Added
- Support for specifying video pixel format in the encoder module (#12345).
### Fixed
- A memory leak in the video encoder module (#23456).
```
## Coding Standards
All code contributions must strictly follow the coding standards outlined in this section. These standards help maintain code quality, readability, and consistency throughout the project. Before submitting any code changes, ensure your code adheres to these guidelines.
### C++ Code Style
C++ code must follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html). This ensures consistency and readability across the codebase. Additionally:
- Use smart pointers (`std::unique_ptr`, `std::shared_ptr`) instead of raw pointers wherever possible.
- Use `#pragma once` for header guards.
- Use `#include` directives in the following order:
1. Related header files
2. C++ standard library headers
3. Third-party library headers
4. Project-specific headers
- Never check pointers with implicit conversion to `bool`; always perform an explicit comparison with `nullptr`.
- Always set pointers to `nullptr` after freeing the associated memory.
### Code Formatting
All C++ code must be formatted using `clang-format` with the project's `.clang-format` configuration file before submitting a pull request. This helps maintain a uniform code style.
## Submitting a Pull Request
1. **Fork the repository**: Create a personal fork of the project.
2. **Create a branch**: Create a new branch for your changes:
```bash
git checkout -b <type>/<scope>
```
3. **Write code**: Make your changes, ensuring they adhere to the coding standards and are properly documented.
4. **Document changes**: Update `CHANGELOG.md` with your changes.
5. **Commit changes**: Write clear and descriptive commit messages using the Conventional Commits format.
6. **Push changes**: Push your branch to your fork:
```bash
git push origin <type>/<scope>
```
7. **Open a pull request**: Submit your pull request to the `master` branch of the original repository. Include a clear description of the changes made and reference any relevant issues.
## Code Reviews
All pull requests will undergo a code review. Please expect feedback from the maintainers after you submit the pull request. We may need further information or changes before merging your pull request.

147
LICENSE
View File

@@ -1,23 +1,21 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
@@ -72,7 +60,7 @@ modification follow.
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
@@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found.
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Affero General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

20
NOTICE Normal file
View File

@@ -0,0 +1,20 @@
Video2X
Copyright (C) 2018-2024 K4YT3X and contributors.
This product depends on FFmpeg, which is available under the GNU Lesser General Public License 2.1.
The source code can be found at https://github.com/FFmpeg/FFmpeg.
This product depends on Anime4K, which is available under the MIT License.
The source code can be found at https://github.com/bloc97/Anime4K.
This product depends on Real-ESRGAN ncnn Vulkan, which is available under the MIT License.
The source code can be found at https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan.
This product depends on Real-CUGAN ncnn Vulkan, which is available under the MIT License.
The source code can be found at https://github.com/nihui/realcugan-ncnn-vulkan.
This product depends on RIFE ncnn Vulkan, which is available under the MIT License.
The source code can be found at https://github.com/nihui/rife-ncnn-vulkan.
This product depends on ncnn, which is available under the BSD 3-Clause License.
The source code can be found at https://github.com/Tencent/ncnn.

338
README.md
View File

@@ -1,265 +1,157 @@
# Video2X Lossless Video Enlarger
<p align="center">
<img src="https://github.com/user-attachments/assets/5cd63373-e806-474f-94ec-6e04963bf90f"
alt="Video2X: A machine learning-based video super resolution and frame interpolation framework."/>
</br>
<img src="https://img.shields.io/github/v/release/k4yt3x/video2x?style=flat-square"/>
<img src="https://img.shields.io/github/downloads/k4yt3x/video2x/total?style=flat-square"/>
<img src="https://img.shields.io/github/license/k4yt3x/video2x?style=flat-square"/>
<img src="https://img.shields.io/github/sponsors/k4yt3x?style=flat-square&link=https%3A%2F%2Fgithub.com%2Fsponsors%2Fk4yt3x"/>
<img src="https://img.shields.io/badge/dynamic/json?color=%23e85b46&label=Patreon&query=data.attributes.patron_count&suffix=%20patrons&url=https%3A%2F%2Fwww.patreon.com%2Fapi%2Fcampaigns%2F4507807&style=flat-square"/>
</p>
### Official Discussion Group (Telegram): https://t.me/video2x
## 🌟 Version 6.0.0
## Download Builds
Video2X 6.0.0 highlights:
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.
- Complete rewrite of the Video2X project in C/C++.
- Faster and more efficient architecture.
- Cross-platform support for Windows and Linux.
- Vastly improved output quality.
- New GUI and installer for easy setup on Windows.
The **`full`** package provides all packages that will possibly be needed by `Video2X`, including `FFmpeg`, `waifu2x-caffe`, `waifu2x-converter-cpp`, `waifu2x-ncnn-vulkan`, and `Anime4K`. The config file (`video2x.json`) is also already configured for the environment. All you need to do is just to launch `video2x.exe`.
<details>
<summary>Click to see more details</summary>
The **`light`** package provides only the most basic functions of `Video2X`. Only `video2x.exe`, `video2x_setup.exe` and `video2x.json` are included. To setup dependencies (e.g. `FFmpeg` and `Waifu2X`) automatically, simply launch `video2x_setup.exe`.
Version 6.0.0 is a complete rewrite of this project in C/C++. It:
## Prerequisites
- genuinely works this time, with much less hassle compared to the 5.0.0 beta;
- is blazing fast, thanks to the new optimized pipeline and the efficiency of C/C++;
- is cross-platform, available now for both Windows and Linux;
- offers significantly better output quality with Anime4K v4, Real-ESRGAN, Real-CUGAN, and RIFE;
- supports two modes: filtering (upscaling) and frame interpolation;
- supports Anime4K v4 and all custom MPV-compatible GLSL shaders;
- supports Real-ESRGAN, Real-CUGAN, and RIFE (all models) via ncnn and Vulkan;
- requires zero additional disk space during processing, just space for the final output.
Component names that are **bolded** can be automatically downloaded and configured with the `video2x_setup.py` script.
</details>
1. Operating System: Windows
2. AMD GPU / Nvidia GPU
3. AMD GPU driver / Nvidia GPU driver / Nvidia CUDNN
4. [**FFmpeg**](https://ffmpeg.zeranoe.com/builds/)
5. One of the following drivers
- [**waifu2x-caffe**](https://github.com/lltcggie/waifu2x-caffe/releases)
- [**waifu2x-converter-cpp**](https://github.com/DeadSix27/waifu2x-converter-cpp/releases)
- [**waifu2x-ncnn-vulkan**](https://github.com/nihui/waifu2x-ncnn-vulkan)
- [**Anime4K**](https://github.com/bloc97/Anime4K)
![6.4.0-screenshot](https://github.com/user-attachments/assets/9b1cc8a7-2903-4d2c-80a2-8d81f007e45b)
## Recent Changes
## 🖥️ Hardware Requirements
### 2.10.0 (August 16, 2019)
Your system must meet the minimum hardware requirements below to run Video2X.
- **Added support for [Anime4K](https://github.com/bloc97/Anime4K)**
- **CPU**
- The precompiled binaries require CPUs with AVX2 support.
- **Intel**: Haswell (Q2 2013) or newer
- **AMD**: Excavator (Q2 2015) or newer
- **GPU**
- The GPU must support Vulkan.
- **NVIDIA**: Kepler (GTX 600 series, Q2 2012) or newer
- **AMD**: GCN 1.0 (Radeon HD 7000 series, Q1 2012) or newer
- **Intel**: HD Graphics 4000 (Q2 2012) or newer
### 2.9.0 (July 27, 2019)
## [🪟 Install on Windows](https://docs.video2x.org/installing/windows-qt6.html)
- Changed file handling method from `os` to `pathlib`
- Removed f_string dependency and support for legacy versions of Python
- Organized file import statements
**[Download the Latest Windows Installer Executable (6.4.0)](https://github.com/k4yt3x/video2x/releases/download/6.4.0/video2x-qt6-windows-amd64-installer.exe)**
### 2.8.1 (July 9, 2019)
You can download the latest Windows release on the [releases page](https://github.com/k4yt3x/video2x/releases/latest). For basic GUI usage, refer to the [documentation](https://docs.video2x.org/running/desktop.html). If you're unable to download directly from GitHub, try the [mirror site](https://files.k4yt3x.com). The GUI currently supports the following languages:
- Added automatic pixel format detection
- Added automatic color bit depth detection
- English (United States)
- 简体中文(中国)
- 日本語(日本)
- Português (Portugal)
- Français (France)
- Deutsch (Deutschland)
### 2.8.0 (June 25, 2019)
## [🐧 Install on Linux](https://docs.video2x.org/installing/linux.html)
- **Added support for [waifu2x-ncnn-vulkan](https://github.com/nihui/waifu2x-ncnn-vulkan)**
Video2X packages are available for the Linux distros listed below. A universal AppImage is also available for other distros. If you'd like to build it from source code, refer to the [PKGBUILD](packaging/arch/PKGBUILD) file for a general overview of the required dependencies and commands.
### Setup Script 1.5.0 (August 16, 2019)
- Arch Linux: AUR packages, maintained by [@K4YT3X](https://github.com/k4yt3x).
- [aur/video2x](https://aur.archlinux.org/packages/video2x)
- [aur/video2x-git](https://aur.archlinux.org/packages/video2x-git)
- [aur/video2x-qt6](https://aur.archlinux.org/packages/video2x-qt6)
- [aur/video2x-qt6-git](https://aur.archlinux.org/packages/video2x-qt6-git)
- Arch Linux (Chinese Mainland): archlinuxcn packages, maintained by [@Integral-Tech](https://github.com/Integral-Tech).
- [archlinuxcn/video2x](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x)
- [archlinuxcn/video2x-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-git)
- [archlinuxcn/video2x-qt6](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6)
- [archlinuxcn/video2x-qt6-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6-git)
- Other distros: `Video2X-x86_64.AppImage` on the [releases page](https://github.com/k4yt3x/video2x/releases/latest).
- Added automatic installation support for `Anime4K`
## [📦 Container Image](https://docs.video2x.org/running/container.html)
## Description
Video2X [container images](https://github.com/k4yt3x/video2x/pkgs/container/video2x) are available on the GitHub Container Registry for easy deployment on Linux and macOS. If you already have Docker/Podman installed, only one command is needed to start upscaling a video. For more information on how to use Video2X's Docker image, please refer to the [documentation](https://docs.video2x.org/running/container.html).
Video2X is an automation software based on waifu2x image enlarging engine. It extracts frames from a video, enlarge it by a number of times without losing any details or quality, keeping lines smooth and edges sharp.
## [📔 Google Colab](https://colab.research.google.com/drive/1gWEwcA9y57EsxwOjmLNmNMXPsafw0kGo)
For short: **Video2X enlarges your video without losing details**
You can use Video2X on [Google Colab](https://colab.research.google.com/) **for free** if you don't have a powerful GPU of your own. You can borrow a powerful GPU (NVIDIA T4, L4, or A100) on Google's server for free for a maximum of 12 hours per session. **Please use the free resource fairly** and do not create sessions back-to-back and run upscaling 24/7. This might result in you getting banned. You can get [Colab Pro/Pro+](https://colab.research.google.com/signup/pricing) if you'd like to use better GPUs and get longer runtimes. Usage instructions are embedded in the [Colab Notebook](https://colab.research.google.com/drive/1gWEwcA9y57EsxwOjmLNmNMXPsafw0kGo).
Watch for the sharper edges in this screenshot around the shadows:
## [💬 Telegram Discussion Group](https://t.me/video2x)
![preview](https://user-images.githubusercontent.com/21986859/49412428-65083280-f73a-11e8-8237-bb34158a545e.png)
Join our Telegram discussion group to ask any questions you have about Video2X, chat directly with the developers, or discuss super resolution, frame interpolation technologies, or the future of Video2X in general.
**You can also watch the YouTube video Demo: https://www.youtube.com/watch?v=PG94iPoeoZk**
## [📖 Documentation](https://docs.video2x.org/)
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.
Comprehensive documentation for Video2X is available at [https://docs.video2x.org/](https://docs.video2x.org/). It offers detailed instructions on how to [build](https://docs.video2x.org/building/index.html), [install](https://docs.video2x.org/installing/index.html), [use](https://docs.video2x.org/running/index.html), and [develop](https://docs.video2x.org/developing/index.html) with this program.
## Screenshot
## 📽️ Video Demos (Outdated)
![video2x_gui](https://user-images.githubusercontent.com/21986859/63219691-ee478400-c166-11e9-8c15-dcf59228bd96.png)
![Spirited Away Demo](https://user-images.githubusercontent.com/21986859/49412428-65083280-f73a-11e8-8237-bb34158a545e.png)\
_Upscale demo: Spirited Away's movie trailer_
![screenshot](https://user-images.githubusercontent.com/21986859/40265170-39c0caae-5b01-11e8-8371-8b6c24769639.png)
- **Spirited Away**: [YouTube](https://youtu.be/mGEfasQl2Zo) | [Bilibili](https://www.bilibili.com/video/BV1V5411471i/)
- 360P to 4K
- The [original video](https://www.youtube.com/watch?v=ByXuk9QqQkk)'s copyright belongs to 株式会社スタジオジブリ
- **Bad Apple!!**: [YouTube](https://youtu.be/A81rW_FI3cw) | [Bilibili](https://www.bilibili.com/video/BV16K411K7ue)
- 384P 30 FPS to 4K 120 FPS with waifu2x and DAIN
- The [original video](https://www.nicovideo.jp/watch/sm8628149)'s copyright belongs to あにら
- **The Pet Girl of Sakurasou**: [YouTube](https://youtu.be/M0vDI1HH2_Y) | [Bilibili](https://www.bilibili.com/video/BV14k4y167KP/)
- 240P 29.97 to 1080P 60 FPS with waifu2x and DAIN
- The original video's copyright belongs to ASCII Media Works
---
### Standard Test Clip
## Documentations
The following clip can be used to test if your setup works properly. This is also the standard clip used for running performance benchmarks.
### [Video2X Wiki](https://github.com/k4yt3x/video2x/wiki)
- [Standard Test Clip (240P)](https://files.k4yt3x.com/resources/videos/standard-test.mp4) 4.54 MiB
- [Real-CUGAN Upscaled Sample (1704P)](https://files.k4yt3x.com/resources/videos/standard-realcugan.mp4) 3.5 MiB
- [Real-ESRGAN Upscaled Sample (1704P)](https://files.k4yt3x.com/resources/videos/standard-realesrgan.mp4) 3.1 MiB
- [waifu2x Upscaled Sample (1080P)](https://files.k4yt3x.com/resources/videos/standard-waifu2x.mp4) 4.54 MiB
- [Ground Truth (1080P)](https://files.k4yt3x.com/resources/videos/standard-original.mp4) 22.2 MiB
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.
The original clip came from the anime "さくら荘のペットな彼女."\
Copyright of this clip belongs to 株式会社アニプレックス.
### [Step-By-Step Tutorial](https://github.com/k4yt3x/video2x/wiki/Step-By-Step-Tutorial)
## ⚖️ License
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.
This project is licensed under [GNU AGPL version 3](https://www.gnu.org/licenses/agpl-3.0.txt).\
Copyright (C) 2018-2025 K4YT3X and [contributors](https://github.com/k4yt3x/video2x/graphs/contributors).
### [Waifu2X Drivers](https://github.com/k4yt3x/video2x/wiki/Waifu2X-Drivers)
![AGPLv3](https://www.gnu.org/graphics/agplv3-155x51.png)
Go to the [Waifu2X Drivers](https://github.com/k4yt3x/video2x/wiki/Waifu2X-Drivers) wiki page if you want to see a detailed description on the different types of `waifu2x` 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`.
This project includes or depends on these following projects:
### [Q&A](https://github.com/k4yt3x/video2x/wiki/Q&A)
| Project | License |
| ------------------------------------------------------------------------------------- | --------------- |
| [FFmpeg/FFmpeg](https://www.ffmpeg.org/) | LGPLv2.1, GPLv2 |
| [Tencent/ncnn](https://github.com/Tencent/ncnn) | BSD 3-Clause |
| [bloc97/Anime4K](https://github.com/bloc97/Anime4K) | MIT License |
| [nihui/realcugan-ncnn-vulkan](https://github.com/nihui/realcugan-ncnn-vulkan) | MIT License |
| [nihui/rife-ncnn-vulkan](https://github.com/nihui/rife-ncnn-vulkan) | MIT License |
| [xinntao/Real-ESRGAN-ncnn-vulkan](https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan) | MIT License |
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.
More licensing information can be found in the [NOTICE](NOTICE) file.
---
## 🌺 Special Thanks
## Quick Start
Special thanks to the following individuals for their significant contributions to the project, listed in alphabetical order.
### Prerequisites
- **Python 3**
Download: https://www.python.org/downloads/windows/
- **FFmpeg Windows Build**
Download: https://ffmpeg.org/download.html
- **waifu2x-caffe** (for Nvidia CUDA/CUDNN)
Download: https://github.com/lltcggie/waifu2x-caffe/releases
- **waifu2x-converter-cpp** (required for AMD, OpenCL and OpenGL processing)
Download: https://github.com/DeadSix27/waifu2x-converter-cpp/releases
- **waifu2x-ncnn-vulkan**
Download: https://github.com/nihui/waifu2x-ncnn-vulkan/releases
- **Anime4K**
Download: https://github.com/bloc97/Anime4K/releases
### Installing Dependencies
First, clone the video2x repository.
```shell
git clone https://github.com/k4yt3x/video2x.git
cd video2x/bin
```
Then you may run the `video2x_setup.py` script to install and configure the dependencies automatically. This script is designed and tested on Windows 10.
This script will install the newest version of `ffmpeg`, any one or all `waifu2x-caffe`, `waifu2x-converter-cpp`, and `waifu2x-ncnn-vulkan` to `%LOCALAPPDATA%\\video2x` and all required python libraries.
```shell
python video2x_setup.py
```
Alternatively, you can also install the dependencies manually. Please refer to the prerequisites section to see what's needed.
Then you'll need to install python dependencies before start using video2x. Install simply by executing the following command.
```shell
pip install -r requirements.txt
```
**Note that all command line arguments/options overwrite configuration file settings.**
### 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 Original (240P) 1.7MB](https://files.flexio.org/Resources/Videos/sample_input.mp4)
- [Sample Video Upscaled (1080P) 4.8MB](https://files.flexio.org/Resources/Videos/sample_output.mp4)
Clip is from anime "さくら荘のペットな彼女". Copyright belongs to "株式会社アニプレックス (Aniplex Inc.)". Will delete immediately if use of clip is in violation of copyright.
### Nvidia CUDA (waifu2x-caffe)
Enlarge the video to 1920x1080 using CUDA. You may also use the `-r/--ratio` option.
```shell
python video2x.py -i sample_input.mp4 -o sample_output.mp4 -m gpu --width=1920 --height=1080
```
### Nvidia CUDNN
Enlarge the video to 1920x1080 using CUDNN. You may also use the `-r/--ratio` option.
```shell
python video2x.py -i sample_input.mp4 -o sample_output.mp4 -m cudnn --width=1920 --height=1080
```
### AMD or Nvidia (waifu2x-converter-cpp OpenCL)
Enlarge the video by 2 times using OpenCL. Note that `waifu2x-converter-cpp` doesn't support width and height. You'll also have to explicitly specify that the driver to be used is `waifu2x_converter`.
```shell
python video2x.py -i sample_input.mp4 -o sample_output.mp4 -m gpu -r 2 -d waifu2x_converter
```
### AMD or Nvidia (waifu2x-ncnn-vulkan Vulkan)
```shell
python video2x.py -i sample_input.mp4 -o sample_output.mp4 -m gpu -r 2 -d waifu2x_ncnn_vulkan
```
### CPU
Enlarge the video to 1920x1080 using the CPU. You may also use the `-r/--ratio` option. **waifu2x-based upscalers potentially run much slower than using a GPU, but Anime4K is more CPU-dependant**. The configuration file for this method is similar to the previous methods.
```shell
python video2x.py -i sample_input.mp4 -o sample_output.mp4 -m cpu --width=1920 --height=1080
```
---
# Full Usage
## General Options
### -h, --help
show this help message and exit
## File Options
### -i INPUT, --input INPUT
Source video file/directory (default: None)
### -o OUTPUT, --output OUTPUT
Output video file/directory (default: None)
## Upscaling Options
### -m {cpu,gpu,cudnn}, --method {cpu,gpu,cudnn}
Upscaling method (default: gpu)
### -d {waifu2x_caffe,waifu2x_converter}, --driver {waifu2x_caffe,waifu2x_converter}
Waifu2x driver (default: waifu2x_caffe)
### -y MODEL_DIR, --model_dir MODEL_DIR
Folder containing model JSON files
### -t THREADS, --threads THREADS
Number of threads to use for upscaling (default: 5)
### -c CONFIG, --config CONFIG
Video2X config file location (default: video2x\bin\video2x.json)
### -b, --batch
Enable batch mode (select all default values to questions)
## Scaling Options
### --width WIDTH
Output video width
### --height HEIGHT
Output video height
### -r RATIO, --ratio RATIO
Scaling ratio
---
## License
Licensed under the GNU General Public License Version 3 (GNU GPL v3)
https://www.gnu.org/licenses/gpl-3.0.txt
![GPLv3 Icon](https://www.gnu.org/graphics/gplv3-127x51.png)
(C) 2018-2019 K4YT3X
## Credits
This project relies on the following software and projects.
- [FFmpeg]('https://www.ffmpeg.org/')
- [waifu2x-caffe](https://github.com/lltcggie/waifu2x-caffe)
- [waifu2x-converter-cpp](https://github.com/DeadSix27/waifu2x-converter-cpp)
- [waifu2x-ncnn-vulkan](https://github.com/nihui/waifu2x-ncnn-vulkan)
- [Anime4K](https://github.com/bloc97/Anime4K)
## Special Thanks
Appreciations given to the following code contributors:
- @BrianPetkovsek
- @SAT3LL
## Related Resources
- [Dandere2x](https://github.com/CardinalPanda/dandere2x): `Dandere2x` is a lossy video upscaler also built around `waifu2x`, but with video compression techniques to shorten the time needed to process a video.
- [@ArchieMeng](https://github.com/archiemeng)
- [@BrianPetkovsek](https://github.com/BrianPetkovsek)
- [@Integral-Tech](https://github.com/Integral-Tech)
- [@ddouglas87](https://github.com/ddouglas87)
- [@lhanjian](https://github.com/lhanjian)
- [@nihui](https://github.com/nihui)
- [@sat3ll](https://github.com/sat3ll)

14
SECURITY.md Normal file
View File

@@ -0,0 +1,14 @@
# Security Policy
## Reporting a Vulnerability
- **Email**: Send vulnerability reports via email to [github@k4yt3x.com](mailto:github@k4yt3x.com).
- **Details**: Include description, impact, reproduction steps, and proof-of-concept if applicable.
- **Confidentiality**: Do not disclose vulnerabilities publicly until a fix is released.
## Response Process
1. **Acknowledge**: We will acknowledge receipt within 48 hours.
2. **Assess**: Initial assessment and response within 7 days.
3. **Fix**: Develop and release a patch promptly.
4. **Credit**: Acknowledge contributors unless anonymity is requested.

View File

@@ -1,92 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Anime4K Driver
Author: K4YT3X
Date Created: August 15, 2019
Last Modified: August 15, 2019
Description: This class is a high-level wrapper
for Anime4k.
"""
# built-in imports
import subprocess
import threading
# third-party imports
from avalon_framework import Avalon
class Anime4k:
"""This class communicates with Anime4K 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, waifu2x_settings):
self.waifu2x_settings = waifu2x_settings
self.print_lock = threading.Lock()
def upscale(self, input_directory, output_directory, scale_ratio, upscaler_exceptions, push_strength=None, push_grad_strength=None):
""" Anime4K wrapper
Arguments:
file_in {string} -- input file path
file_out {string} -- output file path
Keyword Arguments:
scale {int} -- scale ratio (default: {None})
push_strength {int} -- residual push strength (default: {None})
push_grad_strength {int} -- residual gradient push strength (default: {None})
Returns:
subprocess.Popen.returncode -- command line return value of execution
"""
try:
# return value is the sum of all execution return codes
return_value = 0
# get a list lof all image files in input_directory
extracted_frame_files = [f for f in input_directory.iterdir() if str(f).lower().endswith('.png') or str(f).lower().endswith('.jpg')]
# upscale each image in input_directory
for image in extracted_frame_files:
execute = [
self.waifu2x_settings['java_path'],
'-jar',
self.waifu2x_settings['anime4k_path'],
str(image.absolute()),
str(output_directory / image.name),
str(scale_ratio)
]
# optional arguments
kwargs = [
'push_strength',
'push_grad_strength'
]
# if optional argument specified, append value to execution list
for arg in kwargs:
if locals()[arg] is not None:
execute.extend([locals([arg])])
self.print_lock.acquire()
Avalon.debug_info(f'Executing: {execute}', )
self.print_lock.release()
return_value += subprocess.run(execute, check=True).returncode
# print thread exiting message
self.print_lock.acquire()
Avalon.debug_info(f'[upscaler] Thread {threading.current_thread().name} exiting')
self.print_lock.release()
# return command execution return code
return return_value
except Exception as e:
upscaler_exceptions.append(e)

View File

@@ -1,28 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Video2X Exceptions
Dev: K4YT3X
Date Created: December 13, 2018
Last Modified: July 27, 2019
"""
class ArgumentError(Exception):
def __init__(self, message):
super().__init__(message)
class StreamNotFoundError(Exception):
def __init__(self, message):
super().__init__(message)
class UnrecognizedDriverError(Exception):
def __init__(self, message):
super().__init__(message)
class UnsupportedPixelError(Exception):
def __init__(self, message):
super().__init__(message)

View File

@@ -1,287 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Video2X FFmpeg Controller
Author: K4YT3X
Date Created: Feb 24, 2018
Last Modified: August 15, 2019
Description: This class handles all FFmpeg related operations.
"""
# built-in imports
import json
import pathlib
import subprocess
# third-party imports
from avalon_framework import Avalon
class Ffmpeg:
"""This class communicates with FFmpeg
This class deals with FFmpeg. It handles extracting
frames, stripping audio, converting images into videos
and inserting audio tracks to videos.
"""
def __init__(self, ffmpeg_settings, image_format):
self.ffmpeg_settings = ffmpeg_settings
self.ffmpeg_path = pathlib.Path(self.ffmpeg_settings['ffmpeg_path'])
self.ffmpeg_binary = self.ffmpeg_path / 'ffmpeg.exe'
self.ffmpeg_probe_binary = self.ffmpeg_path / 'ffprobe.exe'
self.image_format = image_format
self.pixel_format = None
def get_pixel_formats(self):
""" Get a dictionary of supported pixel formats
List all supported pixel formats and their
corresponding bit depth.
Returns:
dictionary -- JSON dict of all pixel formats to bit depth
"""
execute = [
self.ffmpeg_probe_binary,
'-v',
'quiet',
'-pix_fmts'
]
# turn elements into str
execute = [str(e) for e in execute]
Avalon.debug_info(f'Executing: {" ".join(execute)}')
# initialize dictionary to store pixel formats
pixel_formats = {}
# record all pixel formats into dictionary
for line in subprocess.run(execute, check=True, stdout=subprocess.PIPE).stdout.decode().split('\n'):
try:
pixel_formats[' '.join(line.split()).split()[1]] = int(' '.join(line.split()).split()[3])
except (IndexError, ValueError):
pass
# print pixel formats for debugging
Avalon.debug_info(pixel_formats)
return pixel_formats
def get_video_info(self, input_video):
""" Gets input video information
This method reads input video information
using ffprobe in dictionary
Arguments:
input_video {string} -- input video file path
Returns:
dictionary -- JSON text of input video information
"""
# this execution command needs to be hard-coded
# since video2x only strictly recignizes this one format
execute = [
self.ffmpeg_probe_binary,
'-v',
'quiet',
'-print_format',
'json',
'-show_format',
'-show_streams',
'-i',
input_video
]
# turn elements into str
execute = [str(e) for e in execute]
Avalon.debug_info(f'Executing: {" ".join(execute)}')
json_str = subprocess.run(execute, check=True, stdout=subprocess.PIPE).stdout
return json.loads(json_str.decode('utf-8'))
def extract_frames(self, input_video, extracted_frames):
"""Extract every frame from original videos
This method extracts every frame from input video using FFmpeg
Arguments:
input_video {string} -- input video path
extracted_frames {string} -- video output directory
"""
execute = [
self.ffmpeg_binary
]
execute.extend(self._read_configuration(phase='video_to_frames'))
execute.extend([
'-i',
input_video
])
execute.extend(self._read_configuration(phase='video_to_frames', section='output_options'))
execute.extend([
extracted_frames / f'extracted_%0d.{self.image_format}'
])
self._execute(execute)
def convert_video(self, framerate, resolution, upscaled_frames):
"""Converts images into videos
This method converts a set of images into a video
Arguments:
framerate {float} -- target video framerate
resolution {string} -- target video resolution
upscaled_frames {string} -- source images directory
"""
execute = [
self.ffmpeg_binary,
'-r',
str(framerate),
'-s',
resolution
]
# read other options
execute.extend(self._read_configuration(phase='frames_to_video'))
# read FFmpeg input options
execute.extend(self._read_configuration(phase='frames_to_video', section='input_options'))
# WORKAROUND FOR WAIFU2X-NCNN-VULKAN
# Dev: SAT3LL
# rename all .png.png suffixes to .png
import re
regex = re.compile(r'\.png\.png$', re.IGNORECASE)
for frame_name in upscaled_frames.iterdir():
(upscaled_frames / frame_name).rename(upscaled_frames / regex.sub('.png', str(frame_name)))
# END WORKAROUND
# append input frames path into command
execute.extend([
'-i',
upscaled_frames / f'extracted_%d.{self.image_format}'
])
# read FFmpeg output options
execute.extend(self._read_configuration(phase='frames_to_video', section='output_options'))
# specify output file location
execute.extend([
upscaled_frames / 'no_audio.mp4'
])
self._execute(execute)
def migrate_audio_tracks_subtitles(self, input_video, output_video, upscaled_frames):
""" Migrates audio tracks and subtitles from input video to output video
Arguments:
input_video {string} -- input video file path
output_video {string} -- output video file path
upscaled_frames {string} -- directory containing upscaled frames
"""
execute = [
self.ffmpeg_binary
]
execute.extend(self._read_configuration(phase='migrating_tracks'))
execute.extend([
'-i',
upscaled_frames / 'no_audio.mp4',
'-i',
input_video
])
execute.extend(self._read_configuration(phase='migrating_tracks', section='output_options'))
execute.extend([
output_video
])
self._execute(execute)
def _read_configuration(self, phase, section=None):
""" read configuration from JSON
Read the configurations (arguments) from the JSON
configuration file and append them to the end of the
FFmpeg command.
Arguments:
execute {list} -- list of arguments to be executed
phase {str} -- phase of operation
"""
configuration = []
# if section is specified, read configurations or keys
# from only that section
if section:
source = self.ffmpeg_settings[phase][section].keys()
# 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 key in source:
if section:
value = self.ffmpeg_settings[phase][section][key]
else:
value = self.ffmpeg_settings[phase][key]
# null or None means that leave this option out (keep default)
if value is None or value is False or isinstance(value, dict):
continue
# if the value is a list, append the same argument and all values
elif isinstance(value, list):
for subvalue in value:
configuration.append(key)
if value is not True:
configuration.append(str(subvalue))
# otherwise the value is typical
else:
configuration.append(key)
# true means key is an option
if value is True:
continue
configuration.append(str(value))
return configuration
def _execute(self, execute):
""" 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.run(execute, shell=True, check=True).returncode

View File

@@ -1,76 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Video2X Image Cleaner
Author: BrianPetkovsek
Author: K4YT3X
Date Created: March 24, 2019
Last Modified: July 27, 2019
Description: This class is to remove the extracted frames
that have already been upscaled.
"""
# built-in imports
import threading
import time
class ImageCleaner(threading.Thread):
""" Video2X Image Cleaner
This class creates an object that keeps track of extracted
frames that has already been upscaled and are not needed
anymore. It then deletes them to save disk space.
Extends:
threading.Thread
"""
def __init__(self, input_directory, output_directory, threads):
threading.Thread.__init__(self)
self.input_directory = input_directory
self.output_directory = output_directory
self.threads = threads
self.running = False
def run(self):
""" Run image cleaner
"""
self.running = True
while self.running:
self.remove_upscaled_frames()
time.sleep(1)
def stop(self):
""" Stop the image cleaner
"""
self.running = False
self.join()
def remove_upscaled_frames(self):
""" remove frames that have already been upscaled
This method compares the files in the extracted frames
directory with the upscaled frames directory, and removes
the frames that has already been upscaled.
"""
# list all images in the extracted frames
output_frames = [f for f in self.output_directory.iterdir() if f.is_file()]
# compare and remove frames downscaled images that finished being upscaled
# within each thread's extracted frames directory
for thread_id in range(self.threads):
dir_path = self.input_directory / str(thread_id)
# for each file within all the directories
for file in dir_path.iterdir():
file_path = dir_path / file
# if file also exists in the output directory, then the file
# has already been processed, thus not needed anymore
if file_path.is_file() and file in output_frames:
file_path.unlink(file)
output_frames.remove(file)

View File

@@ -1,6 +0,0 @@
avalon_framework
colorama
GPUtil
psutil
requests
tqdm

View File

@@ -1,369 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Video2X Upscaler
Author: K4YT3X
Date Created: December 10, 2018
Last Modified: August 21, 2019
Dev: SAT3LL
Licensed under the GNU General Public License Version 3 (GNU GPL v3),
available at: https://www.gnu.org/licenses/gpl-3.0.txt
(C) 2018-2019 K4YT3X
"""
# local imports
from anime4k import Anime4k
from exceptions import *
from ffmpeg import Ffmpeg
from image_cleaner import ImageCleaner
from waifu2x_caffe import Waifu2xCaffe
from waifu2x_converter import Waifu2xConverter
from waifu2x_ncnn_vulkan import Waifu2xNcnnVulkan
# built-in imports
from fractions import Fraction
import contextlib
import copy
import pathlib
import re
import shutil
import tempfile
import threading
import time
import traceback
# third-party imports
from avalon_framework import Avalon
from tqdm import tqdm
AVAILABLE_DRIVERS = ['waifu2x_caffe', 'waifu2x_converter', 'waifu2x_ncnn_vulkan', 'anime4k']
class Upscaler:
""" An instance of this class is a upscaler that will
upscale all images in the given directory.
Raises:
Exception -- all exceptions
ArgumentError -- if argument is not valid
"""
def __init__(self, input_video, output_video, method, waifu2x_settings, ffmpeg_settings):
# mandatory arguments
self.input_video = input_video
self.output_video = output_video
self.method = method
self.waifu2x_settings = waifu2x_settings
self.ffmpeg_settings = ffmpeg_settings
# optional arguments
self.waifu2x_driver = 'waifu2x_caffe'
self.scale_width = None
self.scale_height = None
self.scale_ratio = None
self.model_dir = None
self.threads = 5
self.video2x_cache_directory = pathlib.Path(tempfile.gettempdir()) / 'video2x'
self.image_format = 'png'
self.preserve_frames = False
def create_temp_directories(self):
"""create temporary directory
"""
self.extracted_frames = pathlib.Path(tempfile.mkdtemp(dir=self.video2x_cache_directory))
Avalon.debug_info(f'Extracted frames are being saved to: {self.extracted_frames}')
self.upscaled_frames = pathlib.Path(tempfile.mkdtemp(dir=self.video2x_cache_directory))
Avalon.debug_info(f'Upscaled frames are being saved to: {self.upscaled_frames}')
def cleanup_temp_directories(self):
"""delete temp directories when done
"""
if not self.preserve_frames:
for directory in [self.extracted_frames, self.upscaled_frames]:
try:
# avalon framework cannot be used if python is shutting down
# therefore, plain print is used
print(f'Cleaning up cache directory: {directory}')
shutil.rmtree(directory)
except (OSError, FileNotFoundError):
print(f'Unable to delete: {directory}')
traceback.print_exc()
def _check_arguments(self):
# check if arguments are valid / all necessary argument
# values are specified
if not self.input_video:
raise ArgumentError('You need to specify the video to process')
elif (not self.scale_width or not self.scale_height) and not self.scale_ratio:
raise ArgumentError('You must specify output video width and height or upscale factor')
elif not self.output_video:
raise ArgumentError('You need to specify the output video name')
elif not self.method:
raise ArgumentError('You need to specify the enlarging processing unit')
def _progress_bar(self, extracted_frames_directories):
""" This method prints a progress bar
This method prints a progress bar by keeping track
of the amount of frames in the input directory
and the output directory. This is originally
suggested by @ArmandBernard.
"""
# get number of extracted frames
self.total_frames = 0
for directory in extracted_frames_directories:
self.total_frames += len([f for f in directory.iterdir() if str(f)[-4:] == f'.{self.image_format}'])
with tqdm(total=self.total_frames, ascii=True, desc='Upscaling Progress') as progress_bar:
# tqdm update method adds the value to the progress
# bar instead of setting the value. Therefore, a delta
# needs to be calculated.
previous_cycle_frames = 0
while not self.progress_bar_exit_signal:
with contextlib.suppress(FileNotFoundError):
self.total_frames_upscaled = len([f for f in self.upscaled_frames.iterdir() if str(f)[-4:] == f'.{self.image_format}'])
delta = self.total_frames_upscaled - previous_cycle_frames
previous_cycle_frames = self.total_frames_upscaled
# if upscaling is finished
if self.total_frames_upscaled >= self.total_frames:
return
# adds the delta into the progress bar
progress_bar.update(delta)
time.sleep(1)
def _upscale_frames(self):
""" Upscale video frames with waifu2x-caffe
This function upscales all the frames extracted
by ffmpeg using the waifu2x-caffe binary.
Arguments:
w2 {Waifu2x Object} -- initialized waifu2x object
"""
# progress bar thread exit signal
self.progress_bar_exit_signal = False
# create a container for exceptions in threads
# if this thread is not empty, then an exception has occured
self.upscaler_exceptions = []
# initialize waifu2x driver
drivers = AVAILABLE_DRIVERS
if self.waifu2x_driver not in drivers:
raise UnrecognizedDriverError(f'Unrecognized waifu2x driver: {self.waifu2x_driver}')
# it's easier to do multi-threading with waifu2x_converter
# the number of threads can be passed directly to waifu2x_converter
if self.waifu2x_driver == 'waifu2x_converter':
w2 = Waifu2xConverter(self.waifu2x_settings, self.model_dir)
progress_bar = threading.Thread(target=self._progress_bar, args=([self.extracted_frames],))
progress_bar.start()
w2.upscale(self.extracted_frames, self.upscaled_frames, self.scale_ratio, self.threads, self.image_format, self.upscaler_exceptions)
for image in [f for f in self.upscaled_frames.iterdir() if f.is_file()]:
renamed = re.sub(f'_\[.*-.*\]\[x(\d+(\.\d+)?)\]\.{self.image_format}', f'.{self.image_format}', str(image))
(self.upscaled_frames / image).rename(self.upscaled_frames / renamed)
self.progress_bar_exit_signal = True
progress_bar.join()
return
# drivers that are to be multi-threaded by video2x
else:
# create a container for all upscaler threads
upscaler_threads = []
# list all images in the extracted frames
frames = [(self.extracted_frames / f) for f in self.extracted_frames.iterdir() if f.is_file]
# if we have less images than threads,
# create only the threads necessary
if len(frames) < self.threads:
self.threads = len(frames)
# create a directory for each thread and append directory
# name into a list
thread_pool = []
thread_directories = []
for thread_id in range(self.threads):
thread_directory = self.extracted_frames / str(thread_id)
thread_directories.append(thread_directory)
# delete old directories and create new directories
if thread_directory.is_dir():
shutil.rmtree(thread_directory)
thread_directory.mkdir(parents=True, exist_ok=True)
# append directory path into list
thread_pool.append((thread_directory, thread_id))
# evenly distribute images into each directory
# until there is none left in the directory
for image in frames:
# move image
image.rename(thread_pool[0][0] / image.name)
# rotate list
thread_pool = thread_pool[-1:] + thread_pool[:-1]
# create threads and start them
for thread_info in thread_pool:
# create a separate w2 instance for each thread
if self.waifu2x_driver == 'waifu2x_caffe':
w2 = Waifu2xCaffe(copy.deepcopy(self.waifu2x_settings), self.method, self.model_dir, self.bit_depth)
if self.scale_ratio:
thread = threading.Thread(target=w2.upscale,
args=(thread_info[0],
self.upscaled_frames,
self.scale_ratio,
False,
False,
self.image_format,
self.upscaler_exceptions))
else:
thread = threading.Thread(target=w2.upscale,
args=(thread_info[0],
self.upscaled_frames,
False,
self.scale_width,
self.scale_height,
self.image_format,
self.upscaler_exceptions))
# if the driver being used is waifu2x_ncnn_vulkan
elif self.waifu2x_driver == 'waifu2x_ncnn_vulkan':
w2 = Waifu2xNcnnVulkan(copy.deepcopy(self.waifu2x_settings))
thread = threading.Thread(target=w2.upscale,
args=(thread_info[0],
self.upscaled_frames,
self.scale_ratio,
self.upscaler_exceptions))
# if the driver being used is anime4k
elif self.waifu2x_driver == 'anime4k':
w2 = Anime4k(copy.deepcopy(self.waifu2x_settings))
thread = threading.Thread(target=w2.upscale,
args=(thread_info[0],
self.upscaled_frames,
self.scale_ratio,
self.upscaler_exceptions))
# create thread
thread.name = thread_info[1]
# add threads into the pool
upscaler_threads.append(thread)
# start progress bar in a different thread
progress_bar = threading.Thread(target=self._progress_bar, args=(thread_directories,))
progress_bar.start()
# create the clearer and start it
Avalon.debug_info('Starting upscaled image cleaner')
image_cleaner = ImageCleaner(self.extracted_frames, self.upscaled_frames, len(upscaler_threads))
image_cleaner.start()
# start all threads
for thread in upscaler_threads:
thread.start()
# wait for threads to finish
for thread in upscaler_threads:
thread.join()
# upscaling done, kill the clearer
Avalon.debug_info('Killing upscaled image cleaner')
image_cleaner.stop()
self.progress_bar_exit_signal = True
if len(self.upscaler_exceptions) != 0:
raise(self.upscaler_exceptions[0])
def run(self):
"""Main controller for Video2X
This function controls the flow of video conversion
and handles all necessary functions.
"""
# parse arguments for waifu2x
# check argument sanity
self._check_arguments()
# convert paths to absolute paths
self.input_video = self.input_video.absolute()
self.output_video = self.output_video.absolute()
# initialize objects for ffmpeg and waifu2x-caffe
fm = Ffmpeg(self.ffmpeg_settings, self.image_format)
# extract frames from video
fm.extract_frames(self.input_video, self.extracted_frames)
Avalon.info('Reading video information')
video_info = fm.get_video_info(self.input_video)
# analyze original video with ffprobe and retrieve framerate
# width, height = info['streams'][0]['width'], info['streams'][0]['height']
# find index of video stream
video_stream_index = None
for stream in video_info['streams']:
if stream['codec_type'] == 'video':
video_stream_index = stream['index']
break
# exit if no video stream found
if video_stream_index is None:
Avalon.error('Aborting: No video stream found')
raise StreamNotFoundError('no video stream found')
# get average frame rate of video stream
framerate = float(Fraction(video_info['streams'][video_stream_index]['avg_frame_rate']))
fm.pixel_format = video_info['streams'][video_stream_index]['pix_fmt']
# get a dict of all pixel formats and corresponding bit depth
pixel_formats = fm.get_pixel_formats()
try:
self.bit_depth = pixel_formats[fm.pixel_format]
except KeyError:
Avalon.error(f'Unsupported pixel format: {fm.pixel_format}')
raise UnsupportedPixelError(f'unsupported pixel format {fm.pixel_format}')
Avalon.info(f'Framerate: {framerate}')
# width/height will be coded width/height x upscale factor
if self.scale_ratio:
original_width = video_info['streams'][video_stream_index]['width']
original_height = video_info['streams'][video_stream_index]['height']
self.scale_width = int(self.scale_ratio * original_width)
self.scale_height = int(self.scale_ratio * original_height)
# upscale images one by one using waifu2x
Avalon.info('Starting to upscale extracted images')
self._upscale_frames()
Avalon.info('Upscaling completed')
# frames to Video
Avalon.info('Converting extracted frames into video')
# use user defined output size
fm.convert_video(framerate, f'{self.scale_width}x{self.scale_height}', self.upscaled_frames)
Avalon.info('Conversion completed')
# migrate audio tracks and subtitles
Avalon.info('Migrating audio tracks and subtitles to upscaled video')
fm.migrate_audio_tracks_subtitles(self.input_video, self.output_video, self.upscaled_frames)

View File

@@ -1,102 +0,0 @@
{
"waifu2x_caffe": {
"waifu2x_caffe_path": "C:\\Users\\K4YT3X\\AppData\\Local\\video2x\\waifu2x-caffe\\waifu2x-caffe-cui.exe",
"input_extention_list": null,
"output_extention": null,
"mode": "noise_scale",
"scale_ratio": null,
"scale_width": null,
"scale_height": null,
"noise_level": 3,
"process": "gpu",
"crop_size": 128,
"output_quality": -1,
"output_depth": 8,
"batch_size": 1,
"gpu": 0,
"tta": 0,
"input_path": null,
"output_path": null,
"model_dir": null,
"crop_w": null,
"crop_h": null
},
"waifu2x_converter": {
"waifu2x_converter_path": "C:\\Users\\K4YT3X\\AppData\\Local\\video2x\\waifu2x-converter-cpp",
"output-format": null,
"png-compression": null,
"image-quality": null,
"block-size": null,
"disable-gpu": null,
"force-OpenCL": null,
"processor": null,
"jobs": null,
"model-dir": null,
"scale-ratio": null,
"noise-level": 3,
"mode": "noise-scale",
"silent": true,
"output": null,
"input": null
},
"waifu2x_ncnn_vulkan": {
"waifu2x_ncnn_vulkan_path": "C:\\Users\\K4YT3X\\AppData\\Local\\video2x\\waifu2x-ncnn-vulkan\\waifu2x-ncnn-vulkan.exe",
"v": null,
"i": null,
"o": null,
"n": 2,
"s": 2,
"t": 400,
"m": "models-cunet",
"g": 0,
"j": "1:2:2"
},
"anime4k": {
"anime4k_path": "C:\\Users\\K4YT3X\\AppData\\Local\\video2x\\anime4k\\Anime4K.jar",
"java_path": "C:\\Program Files\\Java\\jdk-12.0.2\\bin\\java.exe"
},
"ffmpeg": {
"ffmpeg_path": "C:\\Users\\K4YT3X\\AppData\\Local\\video2x\\ffmpeg-latest-win64-static\\bin",
"video_to_frames": {
"output_options": {
"-qscale:v": null,
"-pix_fmt": "rgba64be"
},
"-hwaccel": "auto",
"-y": true
},
"frames_to_video": {
"input_options": {
"-qscale:v": null,
"-qscale:a": null,
"-f": "image2"
},
"output_options": {
"-vcodec": "libx264",
"-crf": 17,
"-b:v": null,
"-pix_fmt": null
},
"-hwaccel": "auto",
"-y": true
},
"migrating_tracks": {
"output_options": {
"-map": [
"0:v:0?",
"1?",
"-1:v?"
],
"-c": "copy",
"-pix_fmt": null
},
"-hwaccel": "auto",
"-y": true
}
},
"video2x": {
"video2x_cache_directory": null,
"image_format": "png",
"preserve_frames": false
}
}

View File

@@ -1,445 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
__ __ _ _ ___ __ __
\ \ / / (_) | | |__ \ \ \ / /
\ \ / / _ __| | ___ ___ ) | \ V /
\ \/ / | | / _` | / _ \ / _ \ / / > <
\ / | | | (_| | | __/ | (_) | / /_ / . \
\/ |_| \__,_| \___| \___/ |____| /_/ \_\
Name: Video2X Controller
Author: K4YT3X
Date Created: Feb 24, 2018
Last Modified: August 29, 2019
Dev: BrianPetkovsek
Dev: SAT3LL
Licensed under the GNU General Public License Version 3 (GNU GPL v3),
available at: https://www.gnu.org/licenses/gpl-3.0.txt
(C) 2018-2019 K4YT3X
Video2X is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Video2X is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Description: Video2X is an automation software based on waifu2x image
enlarging engine. It extracts frames from a video, enlarge it by a
number of times without losing any details or quality, keeping lines
smooth and edges sharp.
"""
# local imports
from exceptions import *
from upscaler import AVAILABLE_DRIVERS
from upscaler import Upscaler
# built-in imports
import argparse
import contextlib
import json
import pathlib
import re
import shutil
import sys
import tempfile
import time
import traceback
# third-party imports
from avalon_framework import Avalon
import GPUtil
import psutil
VERSION = '2.10.0'
LEGAL_INFO = f'''Video2X Version: {VERSION}
Author: K4YT3X
License: GNU GPL v3
Github Page: https://github.com/k4yt3x/video2x
Contact: k4yt3x@k4yt3x.com'''
LOGO = r'''
__ __ _ _ ___ __ __
\ \ / / (_) | | |__ \ \ \ / /
\ \ / / _ __| | ___ ___ ) | \ V /
\ \/ / | | / _` | / _ \ / _ \ / / > <
\ / | | | (_| | | __/ | (_) | / /_ / . \
\/ |_| \__,_| \___| \___/ |____| /_/ \_\
'''
# each thread might take up to 2.5 GB during initialization.
# (system memory, not to be confused with GPU memory)
SYS_MEM_PER_THREAD = 2.5
GPU_MEM_PER_THREAD = 3.5
def process_arguments():
"""Processes CLI arguments
This function parses all arguments
This allows users to customize options
for the output video.
"""
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
# video options
file_options = parser.add_argument_group('File Options')
file_options.add_argument('-i', '--input', type=pathlib.Path, help='source video file/directory', action='store')
file_options.add_argument('-o', '--output', type=pathlib.Path, help='output video file/directory', action='store')
# upscaler options
upscaler_options = parser.add_argument_group('Upscaler Options')
upscaler_options.add_argument('-m', '--method', help='upscaling method', action='store', default='gpu', choices=['cpu', 'gpu', 'cudnn'])
upscaler_options.add_argument('-d', '--driver', help='upscaling driver', action='store', default='waifu2x_caffe', choices=AVAILABLE_DRIVERS)
upscaler_options.add_argument('-y', '--model_dir', type=pathlib.Path, help='directory containing model JSON files', action='store')
upscaler_options.add_argument('-t', '--threads', help='number of threads to use for upscaling', action='store', type=int, default=1)
upscaler_options.add_argument('-c', '--config', type=pathlib.Path, help='video2x config file location', action='store', default=pathlib.Path(sys.argv[0]).parent.absolute() / 'video2x.json')
upscaler_options.add_argument('-b', '--batch', help='enable batch mode (select all default values to questions)', action='store_true')
# scaling options
scaling_options = parser.add_argument_group('Scaling Options')
scaling_options.add_argument('--width', help='output video width', action='store', type=int)
scaling_options.add_argument('--height', help='output video height', action='store', type=int)
scaling_options.add_argument('-r', '--ratio', help='scaling ratio', action='store', type=float)
# extra options
extra_options = parser.add_argument_group('Extra Options')
extra_options.add_argument('-v', '--version', help='display version, lawful information and exit', action='store_true')
# parse arguments
return parser.parse_args()
def print_logo():
"""print video2x logo"""
print(LOGO)
print(f'\n{"Video2X Video Enlarger".rjust(40, " ")}')
print(f'\n{Avalon.FM.BD}{f"Version {VERSION}".rjust(36, " ")}{Avalon.FM.RST}\n')
def check_memory():
""" Check usable system memory
Warn the user if insufficient memory is available for
the number of threads that the user have chosen.
"""
memory_status = []
# get system available memory
system_memory_available = psutil.virtual_memory().available / (1024 ** 3)
memory_status.append(('system', system_memory_available))
# check if Nvidia-smi is available
# GPUtil requires nvidia-smi.exe to interact with GPU
if args.method == 'gpu' or args.method == 'cudnn':
if not (shutil.which('nvidia-smi') or
pathlib.Path(r'C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe').is_file()):
# Nvidia System Management Interface not available
Avalon.warning('Nvidia-smi not available, skipping available memory check')
Avalon.warning('If you experience error \"cudaSuccess out of memory\", try reducing number of threads you\'re using')
else:
with contextlib.suppress(ValueError):
# "0" is GPU ID. Both waifu2x drivers use the first GPU available, therefore only 0 makes sense
gpu_memory_available = (GPUtil.getGPUs()[0].memoryTotal - GPUtil.getGPUs()[0].memoryUsed) / 1024
memory_status.append(('GPU', gpu_memory_available))
# go though each checkable memory type and check availability
for memory_type, memory_available in memory_status:
if memory_type == 'system':
mem_per_thread = SYS_MEM_PER_THREAD
else:
mem_per_thread = GPU_MEM_PER_THREAD
# if user doesn't even have enough memory to run even one thread
if memory_available < mem_per_thread:
Avalon.warning(f'You might have insufficient amount of {memory_type} memory available to run this program ({memory_available} GB)')
Avalon.warning('Proceed with caution')
if args.threads > 1:
if Avalon.ask('Reduce number of threads to avoid crashing?', default=True, batch=args.batch):
args.threads = 1
# if memory available is less than needed, warn the user
elif memory_available < (mem_per_thread * args.threads):
Avalon.warning(f'Each waifu2x-caffe thread will require up to {SYS_MEM_PER_THREAD} GB of system memory')
Avalon.warning(f'You demanded {args.threads} threads to be created, but you only have {round(memory_available, 4)} GB {memory_type} memory available')
Avalon.warning(f'{mem_per_thread * args.threads} GB of {memory_type} memory is recommended for {args.threads} threads')
Avalon.warning(f'With your current amount of {memory_type} memory available, {int(memory_available // mem_per_thread)} threads is recommended')
# ask the user if he / she wants to change to the recommended
# number of threads
if Avalon.ask('Change to the recommended value?', default=True, batch=args.batch):
args.threads = int(memory_available // mem_per_thread)
else:
Avalon.warning('Proceed with caution')
def read_config(config_file):
""" Reads configuration file
Returns a dictionary read by JSON.
"""
with open(config_file, 'r') as raw_config:
config = json.load(raw_config)
return config
def absolutify_paths(config):
""" Check to see if paths to binaries are absolute
This function checks if paths to binary files are absolute.
If not, then absolutify the path.
Arguments:
config {dict} -- configuration file dictionary
Returns:
dict -- configuration file dictionary
"""
current_directory = pathlib.Path(sys.argv[0]).parent.absolute()
# check waifu2x-caffe path
if not re.match('^[a-z]:', config['waifu2x_caffe']['waifu2x_caffe_path'], re.IGNORECASE):
config['waifu2x_caffe']['waifu2x_caffe_path'] = current_directory / config['waifu2x_caffe']['waifu2x_caffe_path']
# check waifu2x-converter-cpp path
if not re.match('^[a-z]:', config['waifu2x_converter']['waifu2x_converter_path'], re.IGNORECASE):
config['waifu2x_converter']['waifu2x_converter_path'] = current_directory / config['waifu2x_converter']['waifu2x_converter_path']
# check waifu2x_ncnn_vulkan path
if not re.match('^[a-z]:', config['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path'], re.IGNORECASE):
config['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path'] = current_directory / config['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path']
# check anime4k path
if not re.match('^[a-z]:', config['anime4k']['anime4k_path'], re.IGNORECASE):
config['anime4k']['anime4k_path'] = current_directory / config['anime4k']['anime4k_path']
# check ffmpeg path
if not re.match('^[a-z]:', config['ffmpeg']['ffmpeg_path'], re.IGNORECASE):
config['ffmpeg']['ffmpeg_path'] = current_directory / config['ffmpeg']['ffmpeg_path']
# check video2x cache path
if config['video2x']['video2x_cache_directory']:
if not re.match('^[a-z]:', config['video2x']['video2x_cache_directory'], re.IGNORECASE):
config['video2x']['video2x_cache_directory'] = current_directory / config['video2x']['video2x_cache_directory']
return config
# /////////////////// Execution /////////////////// #
# this is not a library
if __name__ != '__main__':
Avalon.error('This file cannot be imported')
raise ImportError(f'{__file__} cannot be imported')
# print video2x logo
print_logo()
# process CLI arguments
args = process_arguments()
# display version and lawful informaition
if args.version:
print(LEGAL_INFO)
exit(0)
# arguments sanity check
if not args.input:
Avalon.error('You must specify input video file/directory path')
raise ArgumentError('input video path not specified')
if not args.output:
Avalon.error('You must specify output video file/directory path')
raise ArgumentError('output video path not specified')
if (args.driver in ['waifu2x_converter', 'waifu2x_ncnn_vulkan', 'anime4k']) and args.width and args.height:
Avalon.error('Selected driver accepts only scaling ratio')
raise ArgumentError('selected driver supports only scaling ratio')
if args.driver == 'waifu2x_ncnn_vulkan' and (args.ratio > 2 or not args.ratio.is_integer()):
Avalon.error('Scaling ratio must be 1 or 2 for waifu2x_ncnn_vulkan')
raise ArgumentError('scaling ratio must be 1 or 2 for waifu2x_ncnn_vulkan')
if (args.width or args.height) and args.ratio:
Avalon.error('You can only specify either scaling ratio or output width and height')
raise ArgumentError('both scaling ration and width/height specified')
if (args.width and not args.height) or (not args.width and args.height):
Avalon.error('You must specify both width and height')
raise ArgumentError('only one of width or height is specified')
# check available memory if driver is waifu2x-based
if args.driver in ['waifu2x_caffe', 'waifu2x_converter', 'waifu2x_ncnn_vulkan']:
check_memory()
# anime4k runs significantly faster with more threads
if args.driver == 'anime4k' and args.threads <= 1:
Avalon.warning('Anime4K runs significantly faster with more threads')
if Avalon.ask('Use more threads of Anime4K?', True):
while True:
try:
threads = Avalon.gets('Amount of threads to use [5]: ')
args.threads = int(threads)
break
except ValueError:
if threads == '':
args.threads = 5
break
else:
Avalon.error(f'{threads} is not a valid integer')
# read configurations from JSON
config = read_config(args.config)
config = absolutify_paths(config)
# load waifu2x configuration
if args.driver == 'waifu2x_caffe':
waifu2x_settings = config['waifu2x_caffe']
if not pathlib.Path(waifu2x_settings['waifu2x_caffe_path']).is_file():
Avalon.error('Specified waifu2x-caffe directory doesn\'t exist')
Avalon.error('Please check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['waifu2x_caffe_path'])
elif args.driver == 'waifu2x_converter':
waifu2x_settings = config['waifu2x_converter']
if not pathlib.Path(waifu2x_settings['waifu2x_converter_path']).is_dir():
Avalon.error('Specified waifu2x-converter-cpp directory doesn\'t exist')
Avalon.error('Please check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['waifu2x_converter_path'])
elif args.driver == 'waifu2x_ncnn_vulkan':
waifu2x_settings = config['waifu2x_ncnn_vulkan']
if not pathlib.Path(waifu2x_settings['waifu2x_ncnn_vulkan_path']).is_file():
Avalon.error('Specified waifu2x_ncnn_vulkan directory doesn\'t exist')
Avalon.error('Please check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['waifu2x_ncnn_vulkan_path'])
elif args.driver == 'anime4k':
waifu2x_settings = config['anime4k']
if not pathlib.Path(waifu2x_settings['anime4k_path']).is_file():
Avalon.error('Specified anime4k directory doesn\'t exist')
Avalon.error('Please check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['anime4k_path'])
# read FFmpeg configuration
ffmpeg_settings = config['ffmpeg']
# load video2x settings
image_format = config['video2x']['image_format'].lower()
preserve_frames = config['video2x']['preserve_frames']
# load cache directory
if isinstance(config['video2x']['video2x_cache_directory'], str):
video2x_cache_directory = pathlib.Path(config['video2x']['video2x_cache_directory'])
else:
video2x_cache_directory = pathlib.Path(tempfile.gettempdir()) / 'video2x'
if video2x_cache_directory.exists() and not video2x_cache_directory.is_dir():
Avalon.error('Specified cache directory is a file/link')
raise FileExistsError('Specified cache directory is a file/link')
elif not video2x_cache_directory.exists():
# if destination file is a file or a symbolic link
Avalon.warning(f'Specified cache directory {video2x_cache_directory} does not exist')
# try creating the cache directory
if Avalon.ask('Create directory?', default=True, batch=args.batch):
try:
video2x_cache_directory.mkdir(parents=True, exist_ok=True)
Avalon.info(f'{video2x_cache_directory} created')
# there can be a number of exceptions here
# PermissionError, FileExistsError, etc.
# therefore, we put a catch-them-all here
except Exception as e:
Avalon.error(f'Unable to create {video2x_cache_directory}')
Avalon.error('Aborting...')
raise e
else:
raise FileNotFoundError('Could not create cache directory')
# start execution
try:
# start timer
begin_time = time.time()
# if input specified is a single file
if args.input.is_file():
# upscale single video file
Avalon.info(f'Upscaling single video file: {args.input}')
# check for input output format mismatch
if args.output.is_dir():
Avalon.error('Input and output path type mismatch')
Avalon.error('Input is single file but output is directory')
raise Exception('input output path type mismatch')
if not re.search(r'.*\..*$', str(args.output)):
Avalon.error('No suffix found in output file path')
Avalon.error('Suffix must be specified for FFmpeg')
raise Exception('No suffix specified')
upscaler = Upscaler(input_video=args.input, output_video=args.output, method=args.method, waifu2x_settings=waifu2x_settings, ffmpeg_settings=ffmpeg_settings)
# set optional options
upscaler.waifu2x_driver = args.driver
upscaler.scale_width = args.width
upscaler.scale_height = args.height
upscaler.scale_ratio = args.ratio
upscaler.model_dir = args.model_dir
upscaler.threads = args.threads
upscaler.video2x_cache_directory = video2x_cache_directory
upscaler.image_format = image_format
upscaler.preserve_frames = preserve_frames
# run upscaler
upscaler.create_temp_directories()
upscaler.run()
upscaler.cleanup_temp_directories()
# if input specified is a directory
elif args.input.is_dir():
# upscale videos in a directory
Avalon.info(f'Upscaling videos in directory: {args.input}')
# make output directory if it doesn't exist
args.output.mkdir(parents=True, exist_ok=True)
for input_video in [f for f in args.input.iterdir() if f.is_file()]:
output_video = args.output / input_video.name
upscaler = Upscaler(input_video=input_video, output_video=output_video, method=args.method, waifu2x_settings=waifu2x_settings, ffmpeg_settings=ffmpeg_settings)
# set optional options
upscaler.waifu2x_driver = args.driver
upscaler.scale_width = args.width
upscaler.scale_height = args.height
upscaler.scale_ratio = args.ratio
upscaler.model_dir = args.model_dir
upscaler.threads = args.threads
upscaler.video2x_cache_directory = video2x_cache_directory
upscaler.image_format = image_format
upscaler.preserve_frames = preserve_frames
# run upscaler
upscaler.create_temp_directories()
upscaler.run()
upscaler.cleanup_temp_directories()
else:
Avalon.error('Input path is neither a file nor a directory')
raise FileNotFoundError(f'{args.input} is neither file nor directory')
Avalon.info(f'Program completed, taking {round((time.time() - begin_time), 5)} seconds')
except Exception:
Avalon.error('An exception has occurred')
traceback.print_exc()
finally:
# remove Video2X cache directory
with contextlib.suppress(FileNotFoundError):
if not preserve_frames:
shutil.rmtree(video2x_cache_directory)

View File

@@ -1,416 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Video2x GUI
Author: K4YT3X
Date Created: July 27, 2019
Last Modified: August 17, 2019
Description: GUI for Video2X
"""
# local imports
from exceptions import *
from upscaler import Upscaler
# built-in imports
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
from tkinter.filedialog import *
import json
import pathlib
import tempfile
import threading
import time
VERSION = '1.1.1'
LEGAL_INFO = f'''Video2X GUI Version: {VERSION}
Author: K4YT3X
License: GNU GPL v3
Github Page: https://github.com/k4yt3x/video2x
Contact: k4yt3x@k4yt3x.com'''
# global static variables
AVAILABLE_METHODS = {
'GPU': 'gpu',
'CUDNN': 'cudnn',
'CPU': 'cpu'
}
AVAILABLE_DRIVERS = {
'Waifu2X Caffe': 'waifu2x_caffe',
'Waifu2X Converter CPP': 'waifu2x_converter',
'Waifu2x NCNN Vulkan': 'waifu2x_ncnn_vulkan',
'Anime4K': 'anime4k'
}
IMAGE_FORMATS = {'PNG', 'JPG'}
class Video2xGui():
def __init__(self):
self.running = False
# create main window
self.main_window = Tk()
self.main_window.title(f'Video2X GUI {VERSION}')
self.main_frame = Frame()
self.main_frame.pack(fill=BOTH, expand=True)
# add menu bar
self.menu_bar = Menu(self.main_frame)
# file menu
self.file_menu = Menu(self.menu_bar, tearoff=0)
self.file_menu.add_command(label='Exit', command=self.main_frame.quit)
self.menu_bar.add_cascade(label='File', menu=self.file_menu)
# help menu
self.help_menu = Menu(self.menu_bar, tearoff=0)
self.help_menu.add_command(label='About', command=self._display_help)
self.menu_bar.add_cascade(label='Help', menu=self.help_menu)
self.main_window.config(menu=self.menu_bar)
# file frame
self.file_frame = Frame(self.main_frame)
self.file_frame.pack(fill=X, padx=5, pady=5, expand=True)
# input file
self.input_file = StringVar()
label_text = StringVar()
label_text.set('Input File')
Label(self.file_frame, textvariable=label_text, relief=RIDGE, width=10).grid(row=0, column=0, padx=5, pady=5, sticky=W)
Entry(self.file_frame, textvariable=self.input_file, width=60).grid(row=0, column=1, padx=5, pady=5, sticky=W)
Button(self.file_frame, text='Select', command=self._select_input).grid(row=0, column=2, padx=5, pady=5, sticky=W)
# output file
self.output_file = StringVar()
label_text = StringVar()
label_text.set('Output File')
Label(self.file_frame, textvariable=label_text, relief=RIDGE, width=10).grid(row=1, column=0, padx=5, pady=5, sticky=W)
Entry(self.file_frame, textvariable=self.output_file, width=60).grid(row=1, column=1, padx=5, pady=5, sticky=W)
Button(self.file_frame, text='Select', command=self._select_output).grid(row=1, column=2, padx=5, pady=5, sticky=W)
# options
self.options_frame = Frame()
# self.options_left.pack(fill=X, padx=5, pady=5, expand=True)
self.options_frame.pack(fill=X, padx=5, pady=5, expand=True)
self.options_left = Frame(self.options_frame)
# self.options_left.pack(fill=X, padx=5, pady=5, expand=True)
self.options_left.grid(row=0, column=0, padx=5, pady=5, sticky=N)
# width
self.width = IntVar()
# self.width.set(1920)
Label(self.options_left, text='Width', relief=RIDGE, width=15).grid(row=0, column=0, padx=2, pady=3)
width_field = Entry(self.options_left, textvariable=self.width)
width_field.grid(row=0, column=1, padx=2, pady=3, sticky=W)
# height
self.height = IntVar()
# self.height.set(1080)
Label(self.options_left, text='Height', relief=RIDGE, width=15).grid(row=1, column=0, padx=2, pady=3)
height_field = Entry(self.options_left, textvariable=self.height)
height_field.grid(row=1, column=1, padx=2, pady=3, sticky=W)
# scale ratio
self.scale_ratio = DoubleVar()
# self.scale_ratio.set(2.0)
Label(self.options_left, text='Scale Ratio', relief=RIDGE, width=15).grid(row=2, column=0, padx=2, pady=3)
scale_ratio_field = Entry(self.options_left, textvariable=self.scale_ratio)
scale_ratio_field.grid(row=2, column=1, padx=2, pady=3, sticky=W)
# image format
self.image_format = StringVar(self.options_left)
self.image_format.set('PNG')
Label(self.options_left, text='Image Format', relief=RIDGE, width=15).grid(row=3, column=0, padx=2, pady=3)
image_format_menu = OptionMenu(self.options_left, self.image_format, *IMAGE_FORMATS)
image_format_menu.grid(row=3, column=1, padx=2, pady=3, sticky=W)
# options
self.options_right = Frame(self.options_frame)
# self.options_left.pack(fill=X, padx=5, pady=5, expand=True)
self.options_right.grid(row=0, column=1, padx=5, pady=5, sticky=N)
# threads
self.threads = IntVar()
self.threads.set(1)
Label(self.options_right, text='Threads', relief=RIDGE, width=15).grid(row=0, column=0, padx=2, pady=3)
threads_field = Entry(self.options_right, textvariable=self.threads)
threads_field.grid(row=0, column=1, padx=2, pady=3, sticky=W)
# method
self.method = StringVar(self.options_left)
self.method.set('GPU')
Label(self.options_right, text='Method', relief=RIDGE, width=15).grid(row=1, column=0, padx=2, pady=3)
method_menu = OptionMenu(self.options_right, self.method, *AVAILABLE_METHODS)
method_menu.grid(row=1, column=1, padx=2, pady=3, sticky=W)
# driver
self.driver = StringVar(self.options_left)
self.driver.set('Waifu2X Caffe')
Label(self.options_right, text='Driver', relief=RIDGE, width=15).grid(row=2, column=0, padx=2, pady=3)
driver_menu = OptionMenu(self.options_right, self.driver, *AVAILABLE_DRIVERS)
driver_menu.grid(row=2, column=1, padx=2, pady=3, sticky=W)
# preserve frames
self.preserve_frames = BooleanVar(self.options_left)
self.preserve_frames.set(True)
Label(self.options_right, text='Preserve Frames', relief=RIDGE, width=15).grid(row=3, column=0, padx=2, pady=3)
preserve_frames_menu = OptionMenu(self.options_right, self.preserve_frames, *{True, False})
preserve_frames_menu.grid(row=3, column=1, padx=2, pady=3, sticky=W)
# progress bar
self.progress_bar_frame = Frame()
self.progress_bar_frame.pack(fill=X, padx=5, pady=5, expand=True)
self.progress_bar = ttk.Progressbar(self.progress_bar_frame, orient='horizontal', length=100, mode='determinate')
self.progress_bar.pack(fill=X)
# start button frame
self.start_frame = Frame()
self.start_frame.pack(fill=X, padx=5, pady=5, expand=True)
# start button
self.start_button_text = StringVar()
self.start_button_text.set('Start')
Button(self.start_frame, textvariable=self.start_button_text, command=self._launch_upscaling, width=20).pack(side=RIGHT)
self.main_frame.mainloop()
def _display_help(self):
messagebox.showinfo('About', LEGAL_INFO)
def _launch_upscaling(self):
# prevent launching multiple instances
if self.running:
messagebox.showerror('Error', 'Video2X is already running')
return
# arguments sanity check
if self.input_file.get() == '':
messagebox.showerror('Error', 'You must specify input video file/directory path')
return
if self.output_file.get() == '':
messagebox.showerror('Error', 'You must specify output video file/directory path')
return
if (self.driver.get() in ['Waifu2X Converter CPP', 'Waifu2x NCNN Vulkan', 'Anime4K']) and self.width.get() and self.height.get():
messagebox.showerror('Error', f'Selected driver \"{self.driver.get()}\" accepts only scaling ratio')
return
if self.driver.get() == 'waifu2x_ncnn_vulkan' and (self.scale_ratio.get() > 2 or not self.scale_ratio.get().is_integer()):
messagebox.showerror('Error', 'Scaling ratio must be 1 or 2 for waifu2x_ncnn_vulkan')
return
if (self.width.get() or self.height.get()) and self.scale_ratio.get():
messagebox.showerror('Error', 'You can only specify either scaling ratio or output width and height')
return
if (self.width.get() and not self.height.get()) or (not self.width.get() and self.height.get()):
messagebox.showerror('Error', 'You must specify both width and height')
return
if (not self.width.get() or not self.height.get()) and not self.scale_ratio.get():
messagebox.showerror('Error', 'You must specify either output dimensions or scaling ratio')
return
upscale = threading.Thread(target=self._upscale)
upscale.start()
self.running = True
self.start_button_text.set('Running')
def _upscale(self):
# start timer
begin_time = time.time()
# read configuration file
config = read_config('video2x.json')
config = absolutify_paths(config)
input_file = pathlib.Path(self.input_file.get())
output_file = pathlib.Path(self.output_file.get())
driver = AVAILABLE_DRIVERS[self.driver.get()]
if driver == 'waifu2x_caffe':
waifu2x_settings = config['waifu2x_caffe']
if not pathlib.Path(waifu2x_settings['waifu2x_caffe_path']).is_file():
messagebox.showerror('Error', 'Specified waifu2x-caffe directory doesn\'t exist\nPlease check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['waifu2x_caffe_path'])
elif driver == 'waifu2x_converter':
waifu2x_settings = config['waifu2x_converter']
if not pathlib.Path(waifu2x_settings['waifu2x_converter_path']).is_dir():
messagebox.showerror('Error', 'Specified waifu2x-converter-cpp directory doesn\'t exist\nPlease check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['waifu2x_converter_path'])
elif driver == 'waifu2x_ncnn_vulkan':
waifu2x_settings = config['waifu2x_ncnn_vulkan']
if not pathlib.Path(waifu2x_settings['waifu2x_ncnn_vulkan_path']).is_file():
messagebox.showerror('Error', 'Specified waifu2x_ncnn_vulkan directory doesn\'t exist\nPlease check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['waifu2x_ncnn_vulkan_path'])
elif driver == 'anime4k':
waifu2x_settings = config['anime4k']
if not pathlib.Path(waifu2x_settings['anime4k_path']).is_file():
messagebox.showerror('Error', 'Specified Anime4K directory doesn\'t exist\nPlease check the configuration file settings')
raise FileNotFoundError(waifu2x_settings['anime4k_path'])
# read FFmpeg configuration
ffmpeg_settings = config['ffmpeg']
# load video2x settings
image_format = config['video2x']['image_format'].lower()
preserve_frames = config['video2x']['preserve_frames']
# load cache directory
if isinstance(config['video2x']['video2x_cache_directory'], str):
video2x_cache_directory = pathlib.Path(config['video2x']['video2x_cache_directory'])
else:
video2x_cache_directory = pathlib.Path(tempfile.gettempdir()) / 'video2x'
if video2x_cache_directory.exists() and not video2x_cache_directory.is_dir():
messagebox.showerror('Error', 'Specified cache directory is a file/link')
raise FileExistsError('Specified cache directory is a file/link')
elif not video2x_cache_directory.exists():
# try creating the cache directory
if messagebox.askyesno('Question', f'Specified cache directory {video2x_cache_directory} does not exist\nCreate directory?'):
try:
video2x_cache_directory.mkdir(parents=True, exist_ok=True)
# there can be a number of exceptions here
# PermissionError, FileExistsError, etc.
# therefore, we put a catch-them-all here
except Exception as e:
messagebox.showerror('Error', f'Unable to create {video2x_cache_directory}\nAborting...')
raise e
else:
raise FileNotFoundError('Could not create cache directory')
# load more settings from gui
width = self.width.get()
height = self.height.get()
scale_ratio = self.scale_ratio.get()
image_format = self.image_format.get()
threads = self.threads.get()
method = AVAILABLE_METHODS[self.method.get()]
preserve_frames = self.preserve_frames.get()
self.upscaler = Upscaler(input_video=input_file, output_video=output_file, method=method, waifu2x_settings=waifu2x_settings, ffmpeg_settings=ffmpeg_settings)
# set optional options
self.upscaler.waifu2x_driver = driver
self.upscaler.scale_width = width
self.upscaler.scale_height = height
self.upscaler.scale_ratio = scale_ratio
self.upscaler.model_dir = None
self.upscaler.threads = threads
self.upscaler.video2x_cache_directory = video2x_cache_directory
self.upscaler.image_format = image_format
self.upscaler.preserve_frames = preserve_frames
# run upscaler
self.upscaler.create_temp_directories()
# start progress bar
progress_bar = threading.Thread(target=self._progress_bar)
progress_bar.start()
# start upscaling
self.upscaler.run()
self.upscaler.cleanup_temp_directories()
# show message when upscaling completes
messagebox.showinfo('Info', f'Upscaling Completed\nTime Taken: {round((time.time() - begin_time), 5)} seconds')
self.progress_bar['value'] = 100
self.running = False
self.start_button_text.set('Start')
def _progress_bar(self):
""" This method prints a progress bar
This method prints a progress bar by keeping track
of the amount of frames in the input directory
and the output directory. This is originally
suggested by @ArmandBernard.
"""
# initialize variables early
self.upscaler.progress_bar_exit_signal = False
self.upscaler.total_frames_upscaled = 0
self.upscaler.total_frames = 1
# initialize progress bar values
self.progress_bar['value'] = 0
while not self.upscaler.progress_bar_exit_signal:
self.progress_bar['value'] = int(100 * self.upscaler.total_frames_upscaled / self.upscaler.total_frames)
time.sleep(1)
def _select_input(self):
self.input_file.set(askopenfilename(title='Select Input File'))
# try to set an output file name automatically
output_file = pathlib.Path(f'{self.input_file.get()}_output.mp4')
output_file_id = 0
while output_file.is_file() and output_file_id <= 10:
output_file = pathlib.Path(f'{self.input_file.get()}_output_{output_file_id}.mp4')
output_file_id += 1
if not output_file.exists():
self.output_file.set(str(output_file))
def _select_output(self):
self.output_file.set(asksaveasfilename(title='Select Output File'))
def read_config(config_file):
""" Reads configuration file
Returns a dictionary read by JSON.
"""
with open(config_file, 'r') as raw_config:
config = json.load(raw_config)
return config
def absolutify_paths(config):
""" Check to see if paths to binaries are absolute
This function checks if paths to binary files are absolute.
If not, then absolutify the path.
Arguments:
config {dict} -- configuration file dictionary
Returns:
dict -- configuration file dictionary
"""
current_directory = pathlib.Path(sys.argv[0]).parent.absolute()
# check waifu2x-caffe path
if not re.match('^[a-z]:', config['waifu2x_caffe']['waifu2x_caffe_path'], re.IGNORECASE):
config['waifu2x_caffe']['waifu2x_caffe_path'] = current_directory / config['waifu2x_caffe']['waifu2x_caffe_path']
# check waifu2x-converter-cpp path
if not re.match('^[a-z]:', config['waifu2x_converter']['waifu2x_converter_path'], re.IGNORECASE):
config['waifu2x_converter']['waifu2x_converter_path'] = current_directory / config['waifu2x_converter']['waifu2x_converter_path']
# check waifu2x_ncnn_vulkan path
if not re.match('^[a-z]:', config['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path'], re.IGNORECASE):
config['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path'] = current_directory / config['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path']
# check ffmpeg path
if not re.match('^[a-z]:', config['ffmpeg']['ffmpeg_path'], re.IGNORECASE):
config['ffmpeg']['ffmpeg_path'] = current_directory / config['ffmpeg']['ffmpeg_path']
# check video2x cache path
if config['video2x']['video2x_cache_directory']:
if not re.match('^[a-z]:', config['video2x']['video2x_cache_directory'], re.IGNORECASE):
config['video2x']['video2x_cache_directory'] = current_directory / config['video2x']['video2x_cache_directory']
return config
video2x_gui = Video2xGui()

View File

@@ -1,351 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Video2X Setup Script
Author: K4YT3X
Author: BrianPetkovsek
Date Created: November 28, 2018
Last Modified: August 20, 2019
Dev: SAT3LL
Licensed under the GNU General Public License Version 3 (GNU GPL v3),
available at: https://www.gnu.org/licenses/gpl-3.0.txt
(C) 2018-2019 K4YT3X
Description: This script helps installing all dependencies of video2x
and generates a configuration for it.
Installation Details:
- ffmpeg: %LOCALAPPDATA%\\video2x\\ffmpeg
- waifu2x-caffe: %LOCALAPPDATA%\\video2x\\waifu2x-caffe
- waifu2x-cpp-converter: %LOCALAPPDATA%\\video2x\\waifu2x-converter-cpp
- waifu2x_ncnn_vulkan: %LOCALAPPDATA%\\video2x\\waifu2x-ncnn-vulkan
- anime4k: %LOCALAPPDATA%\\video2x\\anime4k
"""
# built-in imports
import argparse
import contextlib
import json
import os
import pathlib
import re
import shutil
import subprocess
import sys
import tempfile
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
VERSION = '1.5.0'
# global static variables
LOCALAPPDATA = pathlib.Path(os.getenv('localappdata'))
DRIVER_OPTIONS = ['all', 'waifu2x_caffe', 'waifu2x_converter', 'waifu2x_ncnn_vulkan', 'anime4k']
def process_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 arguments
return parser.parse_args()
class Video2xSetup:
""" Install dependencies for video2x video enlarger
This library is meant to be executed as a stand-alone
script. All files will be installed under %LOCALAPPDATA%\\video2x.
"""
def __init__(self, driver, download_python_modules):
self.driver = driver
self.download_python_modules = download_python_modules
self.trash = []
def run(self):
if self.download_python_modules:
print('\nInstalling Python libraries')
self._install_python_requirements()
print('\nInstalling FFmpeg')
self._install_ffmpeg()
if self.driver == 'all':
self._install_waifu2x_caffe()
self._install_waifu2x_converter_cpp()
self._install_waifu2x_ncnn_vulkan()
self._install_anime4k()
elif self.driver == 'waifu2x_caffe':
self._install_waifu2x_caffe()
elif self.driver == 'waifu2x_converter':
self._install_waifu2x_converter_cpp()
elif self.driver == 'waifu2x_ncnn_vulkan':
self._install_waifu2x_ncnn_vulkan()
elif self.driver == 'anime4k':
self._install_anime4k()
print('\nGenerating Video2X configuration file')
self._generate_config()
print('\nCleaning up temporary files')
self._cleanup()
def _install_python_requirements(self):
""" Read requirements.txt and return its content
"""
pip_install('requirements.txt')
def _cleanup(self):
""" Cleanup all the temp files downloaded
"""
for file in self.trash:
try:
if file.is_dir():
print(f'Deleting directory: {file}')
shutil.rmtree(file)
else:
print(f'Deleting file: {file}')
file.unlink()
except Exception:
print(f'Error deleting: {file}')
traceback.print_exc()
def _install_ffmpeg(self):
""" Install FFMPEG
"""
latest_release = 'https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-latest-win64-static.zip'
ffmpeg_zip = download(latest_release, tempfile.gettempdir())
self.trash.append(ffmpeg_zip)
with zipfile.ZipFile(ffmpeg_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x')
def _install_waifu2x_caffe(self):
""" Install waifu2x_caffe
"""
print('\nInstalling waifu2x-caffe')
import requests
# Get latest release of waifu2x-caffe via GitHub API
latest_release = requests.get('https://api.github.com/repos/lltcggie/waifu2x-caffe/releases/latest').json()
for a in latest_release['assets']:
if 'waifu2x-caffe.zip' in a['browser_download_url']:
waifu2x_caffe_zip = download(a['browser_download_url'], tempfile.gettempdir())
self.trash.append(waifu2x_caffe_zip)
with zipfile.ZipFile(waifu2x_caffe_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x')
def _install_waifu2x_converter_cpp(self):
""" Install waifu2x_caffe
"""
print('\nInstalling waifu2x-converter-cpp')
import requests
# Get latest release of waifu2x-caffe via GitHub API
latest_release = requests.get('https://api.github.com/repos/DeadSix27/waifu2x-converter-cpp/releases/latest').json()
for a in latest_release['assets']:
if re.search(r'waifu2x-DeadSix27-win64_v[0-9]*\.zip', a['browser_download_url']):
waifu2x_converter_cpp_zip = download(a['browser_download_url'], tempfile.gettempdir())
self.trash.append(waifu2x_converter_cpp_zip)
with zipfile.ZipFile(waifu2x_converter_cpp_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp')
def _install_waifu2x_ncnn_vulkan(self):
""" Install waifu2x-ncnn-vulkan
"""
print('\nInstalling waifu2x-ncnn-vulkan')
import requests
# Get latest release of waifu2x-ncnn-vulkan via Github API
latest_release = requests.get('https://api.github.com/repos/nihui/waifu2x-ncnn-vulkan/releases/latest').json()
for a in latest_release['assets']:
if re.search(r'waifu2x-ncnn-vulkan-\d*\.zip', a['browser_download_url']):
waifu2x_ncnn_vulkan_zip = download(a['browser_download_url'], tempfile.gettempdir())
self.trash.append(waifu2x_ncnn_vulkan_zip)
# extract and rename
waifu2x_ncnn_vulkan_directory = LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan'
with zipfile.ZipFile(waifu2x_ncnn_vulkan_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x')
# if directory already exists, remove it
if waifu2x_ncnn_vulkan_directory.exists():
shutil.rmtree(waifu2x_ncnn_vulkan_directory)
# rename the newly extracted directory
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(waifu2x_ncnn_vulkan_directory)
def _install_anime4k(self):
""" Install Anime4K
"""
print('\nInstalling Anime4K')
"""
import requests
# get latest release of Anime4K via Github API
# at the time of writing this portion, Anime4K doesn't yet have a stable release
# therefore releases/latest won't work
latest_release = requests.get('https://api.github.com/repos/bloc97/Anime4K/releases').json()[0]
for a in latest_release['assets']:
if 'Anime4K_Java.zip' in a['browser_download_url']:
anime4k_zip = download(a['browser_download_url'], tempfile.gettempdir())
self.trash.append(anime4k_zip)
"""
# since Java pre-compiled release has been removed from download
# page, we use this cached version as a temporary solution
anime4k_zip = download('https://files.flexio.org/Resources/anime4k.zip', tempfile.gettempdir())
self.trash.append(anime4k_zip)
# extract and rename
with zipfile.ZipFile(anime4k_zip) as zipf:
zipf.extractall(LOCALAPPDATA / 'video2x' / 'anime4k')
def _generate_config(self):
""" Generate video2x config
"""
# Open current video2x.json file as template
with open('video2x.json', 'r') as template:
template_dict = json.load(template)
template.close()
# configure only the specified drivers
if self.driver == 'all':
template_dict['waifu2x_caffe']['waifu2x_caffe_path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-caffe' / 'waifu2x-caffe-cui.exe')
template_dict['waifu2x_converter']['waifu2x_converter_path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp')
template_dict['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan' / 'waifu2x-ncnn-vulkan.exe')
template_dict['anime4k']['anime4k_path'] = str(LOCALAPPDATA / 'video2x' / 'anime4k' / 'Anime4K.jar')
elif self.driver == 'waifu2x_caffe':
template_dict['waifu2x_caffe']['waifu2x_caffe_path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-caffe' / 'waifu2x-caffe-cui.exe')
elif self.driver == 'waifu2x_converter':
template_dict['waifu2x_converter']['waifu2x_converter_path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-converter-cpp')
elif self.driver == 'waifu2x_ncnn_vulkan':
template_dict['waifu2x_ncnn_vulkan']['waifu2x_ncnn_vulkan_path'] = str(LOCALAPPDATA / 'video2x' / 'waifu2x-ncnn-vulkan' / 'waifu2x-ncnn-vulkan.exe')
elif self.driver == 'anime4k':
template_dict['anime4k']['anime4k_path'] = str(LOCALAPPDATA / 'video2x' / 'anime4k' / 'Anime4K.jar')
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
# Write configuration into file
with open('video2x.json', 'w') as config:
json.dump(template_dict, config, indent=2)
config.close()
def download(url, save_path, chunk_size=4096):
""" Download file to local with requests library
"""
from tqdm import tqdm
import requests
save_path = pathlib.Path(save_path)
# create target folder if it doesn't exist
save_path.mkdir(parents=True, exist_ok=True)
# create requests stream for steaming file
stream = requests.get(url, stream=True, allow_redirects=True)
# get file name
file_name = None
if 'content-disposition' in stream.headers:
disposition = stream.headers['content-disposition']
with contextlib.suppress(IndexError):
file_name = re.findall("filename=(.+)", disposition)[0].strip('"')
if file_name is None:
# output_file = f'{save_path}\\{stream.url.split("/")[-1]}'
output_file = save_path / stream.url.split('/')[-1]
else:
output_file = save_path / file_name
# decode url encoding
output_file = pathlib.Path(urllib.parse.unquote(str(output_file)))
# get total size for progress bar if provided in headers
total_size = 0
if 'content-length' in stream.headers:
total_size = int(stream.headers['content-length'])
# print download information summary
print(f'Downloading: {url}')
print(f'Total size: {total_size}')
print(f'Chunk size: {chunk_size}')
print(f'Saving to: {output_file}')
# Write content into file
with open(output_file, 'wb') as output:
with tqdm(total=total_size, ascii=True) as progress_bar:
for chunk in stream.iter_content(chunk_size=chunk_size):
if chunk:
output.write(chunk)
progress_bar.update(len(chunk))
# return the full path of saved file
return output_file
def pip_install(file):
""" Install python package via python pip module
pip.main() is not available after pip 9.0.1, thus
pip module is not used in this case.
"""
return subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', '-r', file]).returncode
if __name__ == '__main__':
try:
args = process_arguments()
print('Video2X Setup Script')
print(f'Version: {VERSION}')
# do not install pip modules if script
# is packaged in exe format
download_python_modules = True
if sys.argv[0].endswith('.exe'):
print('\nScript is packaged as exe, skipping pip module download')
download_python_modules = False
setup = Video2xSetup(args.driver, download_python_modules)
setup.run()
print('\nScript finished successfully')
except Exception:
traceback.print_exc()
print('An error has occurred')
print('Video2X Automatic Setup has failed')
# in case of a failure, try cleaning up temp files
try:
setup._cleanup()
except Exception:
traceback.print_exc()
print('An error occurred while trying to cleanup files')
exit(1)

View File

@@ -1,98 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Waifu2x Caffe Driver
Author: K4YT3X
Date Created: Feb 24, 2018
Last Modified: August 3, 2019
Description: This class is a high-level wrapper
for waifu2x-caffe.
"""
# built-in imports
import subprocess
import threading
# third-party imports
from avalon_framework import Avalon
class Waifu2xCaffe:
"""This class communicates with waifu2x cui engine
An object will be created for this class, containing information
about the binary address and the processing method. When being called
by the main program, other detailed information will be passed to
the upscale function.
"""
def __init__(self, waifu2x_settings, process, model_dir, bit_depth):
self.waifu2x_settings = waifu2x_settings
self.waifu2x_settings['process'] = process
self.waifu2x_settings['model_dir'] = model_dir
self.waifu2x_settings['output_depth'] = bit_depth
# arguments passed through command line overwrites config file values
self.process = process
self.model_dir = model_dir
self.print_lock = threading.Lock()
def upscale(self, input_directory, output_directory, scale_ratio, scale_width, scale_height, image_format, upscaler_exceptions):
"""This is the core function for WAIFU2X class
Arguments:
input_directory {string} -- source directory path
output_directory {string} -- output directory path
width {int} -- output video width
height {int} -- output video height
"""
try:
# overwrite config file settings
self.waifu2x_settings['input_path'] = input_directory
self.waifu2x_settings['output_path'] = output_directory
if scale_ratio:
self.waifu2x_settings['scale_ratio'] = scale_ratio
elif scale_width and scale_height:
self.waifu2x_settings['scale_width'] = scale_width
self.waifu2x_settings['scale_height'] = scale_height
self.waifu2x_settings['output_extention'] = image_format
# print thread start message
self.print_lock.acquire()
Avalon.debug_info(f'[upscaler] Thread {threading.current_thread().name} started')
self.print_lock.release()
# list to be executed
# initialize the list with waifu2x binary path as the first element
execute = [str(self.waifu2x_settings['waifu2x_caffe_path'])]
for key in self.waifu2x_settings.keys():
value = self.waifu2x_settings[key]
# is executable key or null or None means that leave this option out (keep default)
if key == 'waifu2x_caffe_path' or value is None or value is False:
continue
else:
if len(key) == 1:
execute.append(f'-{key}')
else:
execute.append(f'--{key}')
execute.append(str(value))
Avalon.debug_info(f'Executing: {execute}')
completed_command = subprocess.run(execute, check=True)
# print thread exiting message
self.print_lock.acquire()
Avalon.debug_info(f'[upscaler] Thread {threading.current_thread().name} exiting')
self.print_lock.release()
# return command execution return code
return completed_command.returncode
except Exception as e:
upscaler_exceptions.append(e)

View File

@@ -1,96 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Waifu2x Converter CPP Driver
Author: K4YT3X
Date Created: February 8, 2019
Last Modified: August 3, 2019
Description: This class is a high-level wrapper
for waifu2x-converter-cpp.
"""
# built-in imports
import pathlib
import subprocess
import threading
# third-party imports
from avalon_framework import Avalon
class Waifu2xConverter:
"""This class communicates with waifu2x cui engine
An object will be created for this class, containing information
about the binary address and the processing method. When being called
by the main program, other detailed information will be passed to
the upscale function.
"""
def __init__(self, waifu2x_settings, model_dir):
self.waifu2x_settings = waifu2x_settings
self.waifu2x_settings['model_dir'] = model_dir
self.print_lock = threading.Lock()
def upscale(self, input_directory, output_directory, scale_ratio, jobs, image_format, upscaler_exceptions):
""" Waifu2x Converter Driver Upscaler
This method executes the upscaling of extracted frames.
Arguments:
input_directory {string} -- source directory path
output_directory {string} -- output directory path
scale_ratio {int} -- frames' scale ratio
threads {int} -- number of threads
"""
try:
# overwrite config file settings
self.waifu2x_settings['input'] = input_directory
self.waifu2x_settings['output'] = output_directory
self.waifu2x_settings['scale-ratio'] = scale_ratio
self.waifu2x_settings['jobs'] = jobs
self.waifu2x_settings['output-format'] = image_format
# models_rgb must be specified manually for waifu2x-converter-cpp
# if it's not specified in the arguments, create automatically
if self.waifu2x_settings['model-dir'] is None:
self.waifu2x_settings['model-dir'] = pathlib.Path(self.waifu2x_settings['waifu2x_converter_path']) / 'models_rgb'
# print thread start message
self.print_lock.acquire()
Avalon.debug_info(f'[upscaler] Thread {threading.current_thread().name} started')
self.print_lock.release()
# list to be executed
# initialize the list with waifu2x binary path as the first element
execute = [str(pathlib.Path(self.waifu2x_settings['waifu2x_converter_path']) / 'waifu2x-converter-cpp.exe')]
for key in self.waifu2x_settings.keys():
value = self.waifu2x_settings[key]
# the key doesn't need to be passed in this case
if key == 'waifu2x_converter_path':
continue
# null or None means that leave this option out (keep default)
elif 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 True:
continue
execute.append(str(value))
Avalon.debug_info(f'Executing: {execute}')
return subprocess.run(execute, check=True).returncode
except Exception as e:
upscaler_exceptions.append(e)

View File

@@ -1,93 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Name: Waifu2x NCNN Vulkan Driver
Author: SAT3LL
Date Created: June 26, 2019
Last Modified: August 3, 2019
Dev: K4YT3X
Description: This class is a high-level wrapper
for waifu2x_ncnn_vulkan.
"""
# built-in imports
import os
import subprocess
import threading
# third-party imports
from avalon_framework import Avalon
class Waifu2xNcnnVulkan:
"""This class communicates with waifu2x ncnn vulkan engine
An object will be created for this class, containing information
about the binary address and the processing method. When being called
by the main program, other detailed information will be passed to
the upscale function.
"""
def __init__(self, waifu2x_settings):
self.waifu2x_settings = waifu2x_settings
# arguments passed through command line overwrites config file values
# waifu2x_ncnn_vulkan can't find its own model directory if its not in the current dir
# so change to it
os.chdir(os.path.join(self.waifu2x_settings['waifu2x_ncnn_vulkan_path'], '..'))
self.print_lock = threading.Lock()
def upscale(self, input_directory, output_directory, scale_ratio, upscaler_exceptions):
"""This is the core function for WAIFU2X class
Arguments:
input_directory {string} -- source directory path
output_directory {string} -- output directory path
ratio {int} -- output video ratio
"""
try:
# overwrite config file settings
self.waifu2x_settings['i'] = input_directory
self.waifu2x_settings['o'] = output_directory
self.waifu2x_settings['s'] = scale_ratio
# print thread start message
self.print_lock.acquire()
Avalon.debug_info(f'[upscaler] Thread {threading.current_thread().name} started')
self.print_lock.release()
# list to be executed
# initialize the list with waifu2x binary path as the first element
execute = [str(self.waifu2x_settings['waifu2x_ncnn_vulkan_path'])]
for key in self.waifu2x_settings.keys():
value = self.waifu2x_settings[key]
# is executable key or null or None means that leave this option out (keep default)
if key == 'waifu2x_ncnn_vulkan_path' or value is None or value is False:
continue
else:
if len(key) == 1:
execute.append(f'-{key}')
else:
execute.append(f'--{key}')
execute.append(str(value))
Avalon.debug_info(f'Executing: {execute}')
completed_command = subprocess.run(execute, check=True)
# print thread exiting message
self.print_lock.acquire()
Avalon.debug_info(f'[upscaler] Thread {threading.current_thread().name} exiting')
self.print_lock.release()
# return command execution return code
return completed_command.returncode
except Exception as e:
upscaler_exceptions.append(e)

View File

@@ -0,0 +1,2 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/Video2XTargets.cmake")

7
cmake/version.h.in Normal file
View File

@@ -0,0 +1,7 @@
#pragma once
namespace video2x {
#define LIBVIDEO2X_VERSION_STRING "@PROJECT_VERSION@"
} // namespace video2x

1
docs/book/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
book

11
docs/book/book.toml Normal file
View File

@@ -0,0 +1,11 @@
[book]
authors = ["k4yt3x"]
language = "en"
multilingual = false
title = "Video2X Documentation"
[output.html]
default-theme = "ayu"
preferred-dark-theme = "ayu"
git-repository-url = "https://github.com/k4yt3x/video2x"
edit-url-template = "https://github.com/k4yt3x/video2x/edit/master/docs/book/{path}"

13
docs/book/src/README.md Normal file
View File

@@ -0,0 +1,13 @@
# Introduction
<p align="center">
<img src="https://github.com/user-attachments/assets/5cd63373-e806-474f-94ec-6e04963bf90f"/>
</p>
This site hosts the documentation for the Video2X project, a machine learning-based lossless video super-resolution and frame interpolation framework.
The project's homepage is located on GitHub at: [https://github.com/k4yt3x/video2x](https://github.com/k4yt3x/video2x).
If you have any questions, suggestions, or found any issues in the documentation, please [open an issue](https://github.com/k4yt3x/video2x/issues/new/choose) on GitHub.
> 🚧 Some pages are still under construction.

35
docs/book/src/SUMMARY.md Normal file
View File

@@ -0,0 +1,35 @@
# Summary
[Introduction](README.md)
# Building
- [Building](building/README.md)
- [Windows](building/windows.md)
- [Windows (Qt6)](building/windows-qt6.md)
- [Linux](building/linux.md)
# Installing
- [Installing](installing/README.md)
- [Windows (Command Line)](installing/windows.md)
- [Windows (Qt6 GUI)](installing/windows-qt6.md)
- [Linux](installing/linux.md)
# Running
- [Running](running/README.md)
- [Desktop](running/desktop.md)]
- [Command Line](running/command-line.md)
- [Container](running/container.md)
# Developing
- [Developing](developing/README.md)
- [Architecture](developing/architecture.md)
- [libvideo2x](developing/libvideo2x.md)
# Other
- [Other](other/README.md)
- [History](other/history.md)

View File

@@ -0,0 +1,3 @@
# Building
Instructions for building the project.

View File

@@ -0,0 +1,57 @@
# Linux
Instructions for building this project on Linux.
## Arch Linux
Arch users can build the latest version of the project from the AUR packages [`video2x`](https://aur.archlinux.org/packages/video2x) and [`video2x-git`](https://aur.archlinux.org/packages/video2x-git). The project's repository also contains another PKGBUILD example at `packaging/arch/PKGBUILD`.
```bash
git clone https://aur.archlinux.org/video2x.git
cd video2x-git
# Build the package without installing it
makepkg -s
# Build and install the package
makepkg -si
```
To build manually from the source, follow the instructions below.
```bash
# Install build and runtime dependencies
# See the PKGBUILD file for the list of up-to-date dependencies
pacman -Sy ffmpeg ncnn vulkan-driver spdlog boost-libs
pacman -Sy git cmake clang pkgconf just vulkan-headers openmp boost
# Clone the repository
git clone --recurse-submodules https://github.com/k4yt3x/video2x.git
cd video2x
# Build the project
just build
```
The built binaries will be located in the `build` directory.
## Ubuntu
Ubuntu users can use the `.justfile` to build the project automatically. The `ubuntu2404` and `ubuntu2204` targets are available for Ubuntu 24.04 and 22.04, respectively. `just` will automatically install the required dependencies, build the project, and package it into a `.deb` package file. It is recommended to perform the build in a container to ensure the environment's consistency and to avoid leaving extra build packages on your system.
```bash
# The version of `just` in the Ubuntu repository is outdated
# We need to compile and install `just` manually
sudo apt-get update && sudo apt-get install cargo
cargo install just
# Clone the repository
git clone --recurse-submodules https://github.com/k4yt3x/video2x.git
cd video2x
# Build the project
# Before running the command, ensure ~/.cargo/bin is in your PATH
just ubuntu2404
```
The built `.deb` package will be located under the current directory.

View File

@@ -0,0 +1,55 @@
# Windows (Qt6)
Instructions for building the Qt6 GUI of this project on Windows.
## 1. Prerequisites
These dependencies must be installed before building the project. This tutorial assumes that Qt6 has been installed to the default location (`C:\Qt`).
- [Visual Studio 2022](https://visualstudio.microsoft.com/vs/)
- Workload: Desktop development with C++
- [winget-cli](https://github.com/microsoft/winget-cli)
- [Qt6](https://www.qt.io/download)
- Component: Qt6 with MSVC 2022 64-bit
- Component: Qt Creator
## 1. Clone the Repository
```bash
# Install Git if not already installed
winget install -e --id=Git.Git
# Clone the repository
git clone --recurse-submodules https://github.com/k4yt3x/video2x-qt6.git
cd video2x-qt6
```
## 2. Install Dependencies
You need to have the `libvideo2x` shared library built before building the Qt6 GUI. Put the built binaries in `third_party/libvideo2x-shared`.
```bash
# Versions of manually installed dependencies
$ffmpegVersion = "7.1"
# Download and extract FFmpeg
curl -Lo ffmpeg-shared.zip "https://github.com/GyanD/codexffmpeg/releases/download/$ffmpegVersion/ffmpeg-$ffmpegVersion-full_build-shared.zip"
Expand-Archive -Path ffmpeg-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ffmpeg-$ffmpegVersion-full_build-shared" -NewName ffmpeg-shared
```
## 3. Build the Project
1. Open the `CMakeLists.txt` file in Qt Creator as the project file.
2. Click on the hammer icon at the bottom left of the window to build the project.
3. Built binaries will be located in the `build` directory.
After the build finishes, you will need to copy the Qt6 DLLs and other dependencies to the build directory to run the application. Before you run the following commands, remove everything in the release directory except for `video2x-qt6.exe` and the `.qm` files as they are not required for running the application. Then, run the following command to copy the Qt6 runtime DLLs:
```bash
C:\Qt\6.8.0\msvc2022_64\bin\windeployqt.exe --release --compiler-runtime .\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Release\video2x-qt6.exe
```
You will also need to copy the `libvideo2x` shared library to the build directory. Copy all files under `third_party/libvideo2x-shared` to the release directory except for `include`, `libvideo2x.lib`, and `video2x.exe`.
Now you should be able to run the application by double-clicking on `video2x-qt6.exe`.

View File

@@ -0,0 +1,56 @@
# Windows
Instructions for building this project on Windows.
## 1. Prerequisites
The following tools must be installed manually:
- [Visual Studio 2022](https://visualstudio.microsoft.com/vs/)
- Workload: Desktop development with C++
- [winget-cli](https://github.com/microsoft/winget-cli)
## 2. Clone the Repository
```bash
# Install Git if not already installed
winget install -e --id=Git.Git
# Clone the repository
git clone --recurse-submodules https://github.com/k4yt3x/video2x.git
cd video2x
```
## 3. Install Dependencies
```bash
# Install CMake
winget install -e --id=Kitware.CMake
# Install Vulkan SDK
winget install -e --id=KhronosGroup.VulkanSDK
# Versions of manually installed dependencies
$ffmpegVersion = "7.1"
$ncnnVersion = "20240820"
# Download and extract FFmpeg
curl -Lo ffmpeg-shared.zip "https://github.com/GyanD/codexffmpeg/releases/download/$ffmpegVersion/ffmpeg-$ffmpegVersion-full_build-shared.zip"
Expand-Archive -Path ffmpeg-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ffmpeg-$ffmpegVersion-full_build-shared" -NewName ffmpeg-shared
# Download and extract ncnn
curl -Lo ncnn-shared.zip "https://github.com/Tencent/ncnn/releases/download/$ncnnVersion/ncnn-$ncnnVersion-windows-vs2022-shared.zip"
Expand-Archive -Path ncnn-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ncnn-$ncnnVersion-windows-vs2022-shared" -NewName ncnn-shared
```
## 4. Build the Project
```bash
cmake -S . -B build -DUSE_SYSTEM_NCNN=OFF -DUSE_SYSTEM_SPDLOG=OFF -DUSE_SYSTEM_BOOST=OFF `
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/libvideo2x-shared
cmake --build build --config Release --parallel --target install
```
The built binaries will be located in `build/libvideo2x-shared`.

View File

@@ -0,0 +1,3 @@
# Developing
Development-related instructions and guidelines for this project.

View File

@@ -0,0 +1,38 @@
# Architecture
The basic working principals of Video2X and its historical architectures.
## Video2X <=4.0.0 (Legacy)
Below is the earliest architecture of Video2X. It extracts all of the frames from the video using FFmpeg, processes all frames, and stores them into a folder before running FFmpeg again to convert all of the frames back into a video. The drawbacks of this approach are apparent:
- Storing all frames of the video on disk twice requires a huge amount of storage, often hundreds of gigabytes.
- A lot of disk I/O (reading from/writing to disks) operations occur, which is inefficient. Each step stores its processing results to disk, and the next step has to read them from disk again.
![Video2Xv4](https://github.com/user-attachments/assets/976a93ff-efad-418f-a3e2-272e84db2d74)\
_Video2X architecture before version 5.0.0_
## Video2X 5.0.0 (Legacy)
Video2X 5.0.0's architecture was designed to address the inefficient disk I/O issues. This version uses frame serving and streamlines the process. All stages are started simultaneously, and frames are passed between stages through stdin/stdout pipes. However, this architecture also has several issues:
- At least two instances of FFmpeg will be started, three in the case of Anime4K.
- Passing frames through stdin/stdout is unstable. If frame sizes are incorrect, FFmpeg will hang waiting for the next frame.
- The frames entering and leaving each stage must be RGB24, even if they don't need to be. For instance, if the upscaler used is Anime4K, yuv420p is acceptable, but the frame is first converted by the decoder to RGB24, then converted back into YUV colorspace for libplacebo.
![Video2Xv5](https://github.com/user-attachments/assets/d1f38034-a5d3-4c7e-92bf-a5b30fa9ac72)\
_Video2X 5.x.x architecture_
## Video2X 6.0.0 (Current)
Video2X 6.0.0 (Current)
The newest version of Video2X's architecture addresses the issues of the previous architecture while improving efficiency.
- Frames are only decoded once and encoded once with FFmpeg's libavformat.
- Frames are passed as `AVFrame` structs. Their pixel formats are only converted when needed.
- Frames always stay in RAM, avoiding bottlenecks from disk I/O and pipes.
- Frames always stay in the hardware (GPU) unless they need to be downloaded to be processed by software (partially implemented).
![Video2Xv6 drawio](https://github.com/user-attachments/assets/c5d5fc3b-8688-4d50-b7c0-3b5d825a8c69)\
_Video2X 6.0.0 architecture_

View File

@@ -0,0 +1,5 @@
# libvideo2x
Instructions for using libvideo2x's C API in your own projects.
libvideo2x's API is still highly volatile. This document will be updated as the API stabilizes.

View File

@@ -0,0 +1,3 @@
# Installing
Instructions for installing this project.

View File

@@ -0,0 +1,20 @@
# Linux
Video2X packages are available for the Linux distros listed below. If you'd like to build it from source code, refer to the [PKGBUILD](https://github.com/k4yt3x/video2x/tree/master/packaging/arch/PKGBUILD) file for a general overview of the required dependencies and commands. If a package is not available for your distro and you prefer not to compile the program from source code, consider using the [container image](running/container.md).
## Arch Linux
- AUR packages, maintained by [@K4YT3X](https://github.com/k4yt3x).
- [aur/video2x](https://aur.archlinux.org/packages/video2x)
- [aur/video2x-git](https://aur.archlinux.org/packages/video2x-git)
- [aur/video2x-qt6](https://aur.archlinux.org/packages/video2x-qt6)
- [aur/video2x-qt6-git](https://aur.archlinux.org/packages/video2x-qt6-git)
- Chinese Mainland: archlinuxcn packages, maintained by [@Integral-Tech](https://github.com/Integral-Tech).
- [archlinuxcn/video2x](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x)
- [archlinuxcn/video2x-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-git)
- [archlinuxcn/video2x-qt6](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6)
- [archlinuxcn/video2x-qt6-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/video2x-qt6-git)
## Other Distros
Users of other distros can download and use the AppImage from the [releases page](https://github.com/k4yt3x/video2x/releases/latest).

View File

@@ -0,0 +1,7 @@
# Windows (Qt6)
You can download the installer for Video2X Qt6 from the [releases page](https://github.com/k4yt3x/video2x/releases/latest). The installer file's name is `video2x-qt6-windows-amd64-installer.exe`.
Download then double-click the installer to start the installation process. The installer will guide you through the installation process. You can choose the installation directory and whether to create a desktop shortcut during the installation.
After the installation is complete, you can start Video2X Qt6 by double-clicking the desktop shortcut.

View File

@@ -0,0 +1,12 @@
# Windows
You can download the latest version of the Windows build from the [releases page](https://github.com/k4yt3x/video2x/releases/latest). Here are the steps to download and install the pre-built binaries to `%LOCALAPPDATA%\Programs`.
```bash
$latestTag = (Invoke-RestMethod -Uri https://api.github.com/repos/k4yt3x/video2x/releases/latest).tag_name
curl -LO "https://github.com/k4yt3x/video2x/releases/download/$latestTag/video2x-windows-amd64.zip"
New-Item -Path "$env:LOCALAPPDATA\Programs\video2x" -ItemType Directory -Force
Expand-Archive -Path .\video2x-windows-amd64.zip -DestinationPath "$env:LOCALAPPDATA\Programs\video2x"
```
You can then add `%LOCALAPPDATA%\Programs\video2x` to your `PATH` environment variable to run `video2x` from the command line.

View File

@@ -0,0 +1 @@
# Other

View File

@@ -0,0 +1,47 @@
# History
Video2X came a long way from its original concepts to what it has become today. It started as a simple concept of "waifu2x can upscale images, and a video is just a sequence of images". Then, a PoC was made which can barely upscale a single video with waifu2x-caffe and with fixed settings. Now, Video2X has become a comprehensive and customizable video upscaling tool with a nice GUI and a community around it. This article documents in detail how Video2X's concept was born, and what happened during its development.
## Origin
The story started with me watching Bad Apple!!'s PV in early 2017. The original PV has a size of `512x384`, which is quite small and thus, quite blurry.
![vlcsnap-2020-05-15-20h41m36s060](https://user-images.githubusercontent.com/21986859/82106016-08ba8800-970e-11ea-85b5-d1b57d34e283.png)\
_A screenshot of the original Bad Apple!! PV_
Around the same time, I was introduced to this amazing project named waifu2x, which upscales (mostly anime) images using machine learning. This created a spark in my head: **if images can be upscaled, aren't videos just a sequence of images?** Then, I started making a proof-of-concept by manually extracting all frames from the original PV using FFmpeg, putting them through waifu2x-caffe, and assembling the frames back into a video again using FFmpeg. This was how the ["4K BadApple!! waifu2x Lossless Upscaled"](https://www.youtube.com/watch?v=FiX7ygnbAHw) video was created.
![4K BadApple waifu2x](https://img.youtube.com/vi/FiX7ygnbAHw/maxresdefault.jpg)\
_Thumbnail of the "4K BadApple!! waifu2x Lossless Upscaled" video_
After this experiment completed successfully, I started thinking about making an automation pipeline, where this manual process will be streamlined, and each of the steps will be handled automatically.
## Proof-of-Concept
When I signed up for Hack the Valley II in late 2017, I didn't know what I was going to make during that hackathon. Our team sat down and thought about what to make for around an hour, but no one came up with anything interesting. All of a sudden, I remembered, "Hey, isn't there a PoC I wanted to make? How about making that our hackathon project?" I then temporarily name the project Video2X, following waifu2x's scheme. Video2X was then born.
I originally wanted to write Video2X for Linux, but it's too complicated to get the original [nagadomi/waifu2x](https://github.com/nagadomi/waifu2x)'s version of waifu2x running, so waifu2x-caffe written for Windows was used to save time. This is why the first version of Video2X only supports Windows, and can only use waifu2x-caffe as its upscaling driver.
![the first commit of Video2X](https://user-images.githubusercontent.com/21986859/82105271-fcccc700-9709-11ea-8861-b22b807f885f.png)\
_video2x.py file in the first version of Video2X_
At the end of the hackathon, we managed to make a [sample comparison video](https://www.youtube.com/watch?v=mGEfasQl2Zo) based on [Spirited Away's official trailer](https://www.youtube.com/watch?v=ByXuk9QqQkk). This video was then published on YouTube and is the same demo video showcased in Video2X's repository. The original link was at [https://www.youtube.com/watch?v=PG94iPoeoZk](https://www.youtube.com/watch?v=PG94iPoeoZk), but it has been moved lately to another account under K4YT3X's name.
![Spirited Away Demo](https://user-images.githubusercontent.com/21986859/49412428-65083280-f73a-11e8-8237-bb34158a545e.png)\
_Upscale Comparison Demonstration_
When we demoed this project, there wasn't so much interest expressed by the judges. We were, however, suggested to pitch our project to Adobe. That didn't end up going anywhere, either. Like most of the other projects in a hackathon, this project didn't win any awards, and just almost vanished after the hackathon was over.
<!--![Hack the Valley II](https://files.k4yt3x.com/Resources/Images/htv2_team_photo.png)\-->
_[Image Removed]_\
_Our team in Hack the Valley II. You can see Video2X's demo video on the computer screens. Image blurred for privacy._
## Video2X 2.0
Roughly three months after the hackathon, I came back to this project and decided it was worth continuing. Although not many people in the hackathon found this project interesting or useful, I saw value in this project. This was further reinforced by the stars I've received in the project's repository.
I continued working on enhancing Video2X and fixing bugs, and Video2X 2.0 was released. The original version of Video2X was only made as a proof-of-concept for the hackathon. A lot of the usability and convenience aspects are ignored in exchange for development speed. The 2.0 version addressed a lot of these issues and made Video2X usable for regular users. Video2X has then also been converted from a hackathon project to a personal open-source project.
![screenshot of Video2X 2.0](https://user-images.githubusercontent.com/21986859/40265170-39c0caae-5b01-11e8-8371-8b6c24769639.png)\
_Screenshot of Video2X 2.0_

View File

@@ -0,0 +1,3 @@
# Running
Instructions for running and using this project.

View File

@@ -0,0 +1,104 @@
# Command Line
Instructions for running Video2X from the command line.
This page does not cover all the options available. For help with more options available, run Video2X with the `--help` argument.
## Basics
Use the following command to upscale a video by 4x with RealESRGAN:
```bash
video2x -i input.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
Use the following command to upscale a video to with libplacebo + Anime4Kv4 Mode A+A:
```bash
video2x -i input.mp4 -o output.mp4 -w 3840 -h 2160 -p libplacebo --libplacebo-shader anime4k-v4-a+a
```
## Advanced
It is possible to specify custom MPV-compatible GLSL shader files with the `--libplacebo-shader` argument:
```bash
video2x -i input.mp4 -o output.mp4 -p libplacebo -w 3840 -h 2160 --libplacebo-shader path/to/custom/shader.glsl
```
List the available GPUs with `--list-gpus, -l`:
```bash
$ video2x --list-gpus
0. NVIDIA RTX A6000
Type: Discrete GPU
Vulkan API Version: 1.3.289
Driver Version: 565.228.64
```
Select which GPU to use with the `--gpu, -g` argument:
```bash
video2x -i input.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3 -g 1
```
Specify arbitrary extra FFmpeg encoder options with the `--extra-encoder-options, -e` argument:
```bash
video2x -i input.mkv -o output.mkv -p realesrgan --realesrgan-model realesrgan-plus -s 4 -c libx264rgb -e crf=17 -e preset=veryslow -e tune=film
```
## Encoder Options
Video2X uses FFmpeg's C libraries to encode videos. Encoder options are specified in two ways:
- **Common options** shared by all encoders are stored in a [`AVCodecContext`](https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html) struct. Below are some options set through `AVCodecContext`:
- Codec
- Pixel format
- Bitrate
- Keyframe interval
- Minimum and maximum quantizer
- GOP size
- **Encoder-specific** options are stored in [`AVOption`](https://ffmpeg.org/doxygen/trunk/structAVOption.html) structs and set with the [`av_opt_set`](https://ffmpeg.org/doxygen/trunk/group__opt__set__funcs.html#ga5fd4b92bdf4f392a2847f711676a7537) function. Below are some encoder-specific options for `libx264`:
- CRF
- Preset
- Tune
- Profile
Common options can only be set through Video2X's command line arguments. You can run `video2x --help` and see the `Encoder options` section to see the supported options.
You can specify encoder-specific options in Video2X using the `--extra-encoder-option` (`-e`) argument. To view the available options for a particular codec, run:
```bash
ffmpeg -h encoder=$ENCODER
```
For example, to view the available options for `libx264`, run:
```console
$ ffmpeg -h encoder=libx264
Encoder libx264 [libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]:
General capabilities: dr1 delay threads
Threading capabilities: other
Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21 yuv420p10le yuv422p10le yuv444p10le nv20le gray gray10le
libx264 AVOptions:
-preset <string> E..V....... Set the encoding preset (cf. x264 --fullhelp) (default "medium")
-tune <string> E..V....... Tune the encoding params (cf. x264 --fullhelp)
-profile <string> E..V....... Set profile restrictions (cf. x264 --fullhelp)
-fastfirstpass <boolean> E..V....... Use fast settings when encoding first pass (default true)
-level <string> E..V....... Specify level (as defined by Annex A)
-passlogfile <string> E..V....... Filename for 2 pass stats
-wpredp <string> E..V....... Weighted prediction for P-frames
-a53cc <boolean> E..V....... Use A53 Closed Captions (if available) (default true)
-x264opts <string> E..V....... x264 options
-crf <float> E..V....... Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1)
-crf_max <float> E..V....... In CRF mode, prevents VBV from lowering quality beyond this point. (from -1 to FLT_MAX) (default -1)
-qp <int> E..V....... Constant quantization parameter rate control method (from -1 to INT_MAX) (default -1)
...
```
You can then set the encoder-specific options with the `-e` argument. The `-e` argument can be used multiple times to set multiple options. For example, the following arguments set the CRF to 17, the preset to `veryslow`, and the tune to `film` for `libx264`:
```console
-e crf=17 -e preset=veryslow -e tune=film
```

View File

@@ -0,0 +1,57 @@
# Container
Instructions for running the Video2X container.
## Prerequisites
- Docker, Podman, or another OCI-compatible runtime
- A GPU that supports the Vulkan API
- Check the [Vulkan Hardware Database](https://vulkan.gpuinfo.org/) to see if your GPU supports Vulkan
## Upscaling a Video
This section documents how to upscale a video. Replace `$TAG` with an appropriate container tag. A list of available tags can be found [here](https://github.com/k4yt3x/video2x/pkgs/container/video2x) (e.g., `6.1.1`).
### AMD GPUs
Make sure your host has the proper GPU and Vulkan libraries and drivers, then use the following command to launch the container:
```shell
docker run --gpus all -it --rm -v $PWD/data:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
### NVIDIA GPUs
In addition to installing the proper drivers on your host, `nvidia-docker2` (NVIDIA Container Toolkit) must also be installed on the host to use NVIDIA GPUs in containers. Below are instructions for how to install it on some popular Linux distributions:
- Debian/Ubuntu
- Follow the [official guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit) to install `nvidia-docker2`
- Arch/Manjaro
- Install `nvidia-container-toolkit` from the AUR
- E.g., `yay -S nvidia-container-toolkit`
Once all the prerequisites are installed, you can launch the container:
```shell
docker run --gpus all -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
Depending on the version of your nvidia-docker and some other mysterious factors, you can also try setting `no-cgroups = true` in `/etc/nvidia-container-runtime/config.toml` and adding the NVIDIA devices into the container if the command above doesn't work:
```shell
docker run --gpus all --device=/dev/nvidia0 --device=/dev/nvidiactl --runtime nvidia -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
If you are still getting a `vkEnumeratePhysicalDevices failed -3` error at this point, try adding the `--privileged` flag to give the container the same level of permissions as the host:
```shell
docker run --gpus all --privileged -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```
### Intel GPUs
Similar to NVIDIA GPUs, you can add `--gpus all` or `--device /dev/dri` to pass the GPU into the container. Adding `--privileged` might help with the performance (thanks @NukeninDark).
```shell
docker run --gpus all --privileged -it --rm -v $PWD:/host ghcr.io/k4yt3x/video2x:$TAG -i standard-test.mp4 -o output.mp4 -p realesrgan -s 4 --realesrgan-model realesr-animevideov3
```

View File

@@ -0,0 +1,3 @@
# Desktop
TODO.

View File

@@ -0,0 +1,25 @@
#pragma once
extern "C" {
#include <libavformat/avformat.h>
}
namespace video2x {
namespace avutils {
AVRational get_video_frame_rate(AVFormatContext* ifmt_ctx, int in_vstream_idx);
int64_t get_video_frame_count(AVFormatContext* ifmt_ctx, int in_vstream_idx);
AVPixelFormat get_encoder_default_pix_fmt(const AVCodec* encoder, AVPixelFormat target_pix_fmt);
float get_frame_diff(AVFrame* frame1, AVFrame* frame2);
void av_bufferref_deleter(AVBufferRef* bufferref);
void av_frame_deleter(AVFrame* frame);
void av_packet_deleter(AVPacket* packet);
} // namespace avutils
} // namespace video2x

View File

@@ -0,0 +1,23 @@
#pragma once
extern "C" {
#include <libavutil/frame.h>
#include <libswscale/swscale.h>
}
#include <mat.h>
namespace video2x {
namespace conversions {
// Convert AVFrame to another pixel format
AVFrame* convert_avframe_pix_fmt(AVFrame* src_frame, AVPixelFormat pix_fmt);
// Convert AVFrame to ncnn::Mat
ncnn::Mat avframe_to_ncnn_mat(AVFrame* frame);
// Convert ncnn::Mat to AVFrame
AVFrame* ncnn_mat_to_avframe(const ncnn::Mat& mat, AVPixelFormat pix_fmt);
} // namespace conversions
} // namespace video2x

View File

@@ -0,0 +1,34 @@
#pragma once
#include <filesystem>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
namespace video2x {
namespace decoder {
class Decoder {
public:
Decoder();
~Decoder();
int init(AVHWDeviceType hw_type, AVBufferRef* hw_ctx, const std::filesystem::path& in_fpath);
AVFormatContext* get_format_context() const;
AVCodecContext* get_codec_context() const;
int get_video_stream_index() const;
private:
static AVPixelFormat hw_pix_fmt_;
static AVPixelFormat get_hw_format(AVCodecContext* ctx, const AVPixelFormat* pix_fmts);
AVFormatContext* fmt_ctx_;
AVCodecContext* dec_ctx_;
int in_vstream_idx_;
};
} // namespace decoder
} // namespace video2x

View File

@@ -0,0 +1,85 @@
#pragma once
#include <cstdint>
#include <filesystem>
#include <vector>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/pixdesc.h>
}
namespace video2x {
namespace encoder {
// Encoder configurations
struct EncoderConfig {
// Non-AVCodecContext options
std::string codec = "libx264";
bool recalculate_pts = true;
bool copy_audio_streams = true;
bool copy_subtitle_streams = true;
// Basic video options
AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
// Rate control and compression
int64_t bit_rate = 0;
int rc_buffer_size = 0;
int rc_min_rate = 0;
int rc_max_rate = 0;
int qmin = -1;
int qmax = -1;
// GOP and frame structure
int gop_size = -1;
int max_b_frames = -1;
int keyint_min = -1;
int refs = -1;
// Performance and threading
int thread_count = 0;
// Latency and buffering
int delay = -1;
// Extra AVOptions
std::vector<std::pair<std::string, std::string>> extra_opts;
};
class Encoder {
public:
Encoder();
~Encoder();
int init(
AVBufferRef* hw_ctx,
const std::filesystem::path& out_fpath,
AVFormatContext* ifmt_ctx,
AVCodecContext* dec_ctx,
EncoderConfig& enc_cfg,
int width,
int height,
int frm_rate_mul,
int in_vstream_idx
);
int write_frame(AVFrame* frame, int64_t frame_idx);
int flush();
AVCodecContext* get_encoder_context() const;
AVFormatContext* get_format_context() const;
int* get_stream_map() const;
int get_output_video_stream_index() const;
private:
EncoderConfig enc_cfg_;
AVFormatContext* ofmt_ctx_;
AVCodecContext* enc_ctx_;
int out_vstream_idx_;
int* stream_map_;
};
} // namespace encoder
} // namespace video2x

View File

@@ -0,0 +1,64 @@
#pragma once
#include <filesystem>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
}
#include "processor.h"
namespace video2x {
namespace processors {
// FilterLibplacebo class definition
class FilterLibplacebo : public Filter {
public:
// Constructor
FilterLibplacebo(
uint32_t vk_device_index,
const std::filesystem::path& shader_path,
int width,
int height
);
// Destructor
virtual ~FilterLibplacebo() override;
// Initializes the filter with decoder and encoder contexts
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int filter(AVFrame* in_frame, AVFrame** out_frame) override;
// Flushes any remaining frames
int flush(std::vector<AVFrame*>& flushed_frames) override;
// Returns the filter's type
ProcessorType get_processor_type() const override { return ProcessorType::Libplacebo; }
// Returns the filter's output dimensions
void get_output_dimensions(
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int& out_width,
int& out_height
) const override;
private:
AVFilterGraph* filter_graph_;
AVFilterContext* buffersrc_ctx_;
AVFilterContext* buffersink_ctx_;
uint32_t vk_device_index_;
const std::filesystem::path shader_path_;
int width_;
int height_;
AVRational in_time_base_;
AVRational out_time_base_;
};
} // namespace processors
} // namespace video2x

View File

@@ -0,0 +1,63 @@
#pragma once
extern "C" {
#include <libavcodec/avcodec.h>
}
#include "processor.h"
#include "realcugan.h"
namespace video2x {
namespace processors {
// FilterRealcugan class definition
class FilterRealcugan : public Filter {
public:
// Constructor
FilterRealcugan(
int gpuid = 0,
bool tta_mode = false,
int scaling_factor = 4,
int noise_level = -1,
int num_threads = 1,
int syncgap = 3,
const fsutils::StringType model_name = STR("models-pro")
);
// Destructor
virtual ~FilterRealcugan() override;
// Initializes the filter with decoder and encoder contexts
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int filter(AVFrame* in_frame, AVFrame** out_frame) override;
// Returns the filter's type
ProcessorType get_processor_type() const override { return ProcessorType::RealCUGAN; }
// Returns the filter's output dimensions
void get_output_dimensions(
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int& out_width,
int& out_height
) const override;
private:
RealCUGAN* realcugan_;
int gpuid_;
bool tta_mode_;
int scaling_factor_;
int noise_level_;
int num_threads_;
int syncgap_;
const fsutils::StringType model_name_;
AVRational in_time_base_;
AVRational out_time_base_;
AVPixelFormat out_pix_fmt_;
};
} // namespace processors
} // namespace video2x

View File

@@ -0,0 +1,59 @@
#pragma once
extern "C" {
#include <libavcodec/avcodec.h>
}
#include "processor.h"
#include "realesrgan.h"
namespace video2x {
namespace processors {
// FilterRealesrgan class definition
class FilterRealesrgan : public Filter {
public:
// Constructor
FilterRealesrgan(
int gpuid = 0,
bool tta_mode = false,
int scaling_factor = 4,
int noise_level = 0,
const fsutils::StringType model_name = STR("realesr-animevideov3")
);
// Destructor
virtual ~FilterRealesrgan() override;
// Initializes the filter with decoder and encoder contexts
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int filter(AVFrame* in_frame, AVFrame** out_frame) override;
// Returns the filter's type
ProcessorType get_processor_type() const override { return ProcessorType::RealESRGAN; }
// Returns the filter's output dimensions
void get_output_dimensions(
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int& out_width,
int& out_height
) const override;
private:
RealESRGAN* realesrgan_;
int gpuid_;
bool tta_mode_;
int scaling_factor_;
int noise_level_;
const fsutils::StringType model_name_;
AVRational in_time_base_;
AVRational out_time_base_;
AVPixelFormat out_pix_fmt_;
};
} // namespace processors
} // namespace video2x

View File

@@ -0,0 +1,37 @@
#pragma once
#include <filesystem>
#include <optional>
#include <string>
namespace video2x {
namespace fsutils {
#ifdef _WIN32
typedef wchar_t CharType;
#define STR(x) L##x
#else
typedef char CharType;
#define STR(x) x
#endif
#ifdef _WIN32
typedef std::wstring StringType;
#else
typedef std::string StringType;
#endif
bool file_is_readable(const std::filesystem::path& path);
std::optional<std::filesystem::path> find_resource(const std::filesystem::path& resource);
std::string path_to_u8string(const std::filesystem::path& path);
std::string wstring_to_u8string(const fsutils::StringType& wstr);
fsutils::StringType path_to_string_type(const std::filesystem::path& path);
fsutils::StringType to_string_type(int value);
} // namespace fsutils
} // namespace video2x

View File

@@ -0,0 +1,62 @@
#pragma once
extern "C" {
#include <libavcodec/avcodec.h>
}
#include "processor.h"
#include "rife.h"
namespace video2x {
namespace processors {
// InterpolatorRIFE class definition
class InterpolatorRIFE : public Interpolator {
public:
// Constructor
InterpolatorRIFE(
int gpuid = 0,
bool tta_mode = false,
bool tta_temporal_mode = false,
bool uhd_mode = false,
int num_threads = 1,
const fsutils::StringType model_name = STR("rife-v4.6")
);
// Destructor
virtual ~InterpolatorRIFE() override;
// Initializes the interpolator with decoder and encoder contexts
int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) override;
// Processes an input frame and returns the processed frame
int interpolate(AVFrame* prev_frame, AVFrame* in_frame, AVFrame** out_frame, float time_step)
override;
// Returns the interpolator's type
ProcessorType get_processor_type() const override { return ProcessorType::RIFE; }
// Returns the interpolator's output dimensions
void get_output_dimensions(
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int& out_width,
int& out_height
) const override;
private:
RIFE* rife_;
int gpuid_;
bool tta_mode_;
bool tta_temporal_mode_;
bool uhd_mode_;
int num_threads_;
const fsutils::StringType model_name_;
AVRational in_time_base_;
AVRational out_time_base_;
AVPixelFormat out_pix_fmt_;
};
} // namespace processors
} // namespace video2x

View File

@@ -0,0 +1,25 @@
#pragma once
#include <filesystem>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavfilter/avfilter.h>
}
namespace video2x {
namespace processors {
int init_libplacebo(
AVFilterGraph** filter_graph,
AVFilterContext** buffersrc_ctx,
AVFilterContext** buffersink_ctx,
AVCodecContext* dec_ctx,
int out_width,
int out_height,
uint32_t vk_device_index,
const std::filesystem::path& shader_path
);
} // namespace processors
} // namespace video2x

View File

@@ -0,0 +1,94 @@
#pragma once
#include <atomic>
#include <cstdint>
#include <memory>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
#include "avutils.h"
#include "decoder.h"
#include "encoder.h"
#include "libvideo2x_export.h"
#include "processor.h"
namespace video2x {
enum class VideoProcessorState {
Idle,
Running,
Paused,
Failed,
Aborted,
Completed
};
class LIBVIDEO2X_API VideoProcessor {
public:
VideoProcessor(
const processors::ProcessorConfig proc_cfg,
const encoder::EncoderConfig enc_cfg,
const uint32_t vk_device_idx = 0,
const AVHWDeviceType hw_device_type = AV_HWDEVICE_TYPE_NONE,
const bool benchmark = false
);
virtual ~VideoProcessor() = default;
[[nodiscard]] int
process(const std::filesystem::path in_fname, const std::filesystem::path out_fname);
void pause() { state_.store(VideoProcessorState::Paused); }
void resume() { state_.store(VideoProcessorState::Running); }
void abort() { state_.store(VideoProcessorState::Aborted); }
VideoProcessorState get_state() const { return state_.load(); }
int64_t get_processed_frames() const { return frame_idx_.load(); }
int64_t get_total_frames() const { return total_frames_.load(); }
private:
[[nodiscard]] int process_frames(
decoder::Decoder& decoder,
encoder::Encoder& encoder,
std::unique_ptr<processors::Processor>& processor
);
[[nodiscard]] int write_frame(AVFrame* frame, encoder::Encoder& encoder);
[[nodiscard]] inline int write_raw_packet(
AVPacket* packet,
AVFormatContext* ifmt_ctx,
AVFormatContext* ofmt_ctx,
int* stream_map
);
[[nodiscard]] inline int process_filtering(
std::unique_ptr<processors::Processor>& processor,
encoder::Encoder& encoder,
AVFrame* frame,
AVFrame* proc_frame
);
[[nodiscard]] inline int process_interpolation(
std::unique_ptr<processors::Processor>& processor,
encoder::Encoder& encoder,
std::unique_ptr<AVFrame, decltype(&avutils::av_frame_deleter)>& prev_frame,
AVFrame* frame,
AVFrame* proc_frame
);
processors::ProcessorConfig proc_cfg_;
encoder::EncoderConfig enc_cfg_;
uint32_t vk_device_idx_ = 0;
AVHWDeviceType hw_device_type_ = AV_HWDEVICE_TYPE_NONE;
bool benchmark_ = false;
std::atomic<VideoProcessorState> state_ = VideoProcessorState::Idle;
std::atomic<int64_t> frame_idx_ = 0;
std::atomic<int64_t> total_frames_ = 0;
};
} // namespace video2x

View File

@@ -0,0 +1,11 @@
#pragma once
#ifdef _WIN32
#ifdef LIBVIDEO2X_EXPORTS
#define LIBVIDEO2X_API __declspec(dllexport)
#else
#define LIBVIDEO2X_API __declspec(dllimport)
#endif
#else
#define LIBVIDEO2X_API
#endif

View File

@@ -0,0 +1,48 @@
#pragma once
#include <memory>
#include <string>
#include <vector>
#include <spdlog/logger.h>
#include <spdlog/sinks/sink.h>
#include "libvideo2x_export.h"
namespace video2x {
namespace logger_manager {
class LIBVIDEO2X_API LoggerManager {
public:
LoggerManager(const LoggerManager&) = delete;
LoggerManager& operator=(const LoggerManager&) = delete;
static LoggerManager& instance();
std::shared_ptr<spdlog::logger> logger();
bool reconfigure_logger(
const std::string& logger_name,
const std::vector<spdlog::sink_ptr>& sinks,
const std::string& pattern = "%+"
);
bool set_log_level(const std::string& level_str);
void hook_ffmpeg_logging();
void unhook_ffmpeg_logging();
private:
LoggerManager();
std::shared_ptr<spdlog::logger> logger_ = nullptr;
};
} // namespace logger_manager
// Convenience function to get the logger instance
inline std::shared_ptr<spdlog::logger> logger() {
return logger_manager::LoggerManager::instance().logger();
}
} // namespace video2x

View File

@@ -0,0 +1,98 @@
#pragma once
#include <variant>
#include <vector>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavfilter/avfilter.h>
#include <libavutil/buffer.h>
}
#include "fsutils.h"
namespace video2x {
namespace processors {
enum class ProcessingMode {
Filter,
Interpolate,
};
enum class ProcessorType {
None,
Libplacebo,
RealESRGAN,
RealCUGAN,
RIFE,
};
struct LibplaceboConfig {
fsutils::StringType shader_path;
};
struct RealESRGANConfig {
bool tta_mode = false;
fsutils::StringType model_name;
};
struct RealCUGANConfig {
bool tta_mode = false;
int num_threads = 1;
int syncgap = 3;
fsutils::StringType model_name;
};
struct RIFEConfig {
bool tta_mode = false;
bool tta_temporal_mode = false;
bool uhd_mode = false;
int num_threads = 0;
fsutils::StringType model_name;
};
// Unified filter configuration
struct ProcessorConfig {
ProcessorType processor_type = ProcessorType::None;
int width = 0;
int height = 0;
int scaling_factor = 0;
int noise_level = -1;
int frm_rate_mul = 0;
float scn_det_thresh = 0.0f;
std::variant<LibplaceboConfig, RealESRGANConfig, RealCUGANConfig, RIFEConfig> config;
};
class Processor {
public:
virtual ~Processor() = default;
virtual int init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef* hw_ctx) = 0;
virtual int flush(std::vector<AVFrame*>&) { return 0; }
virtual ProcessingMode get_processing_mode() const = 0;
virtual ProcessorType get_processor_type() const = 0;
virtual void get_output_dimensions(
const ProcessorConfig& proc_cfg,
int in_width,
int in_height,
int& width,
int& height
) const = 0;
};
// Abstract base class for filters
class Filter : public Processor {
public:
ProcessingMode get_processing_mode() const override { return ProcessingMode::Filter; }
virtual int filter(AVFrame* in_frame, AVFrame** out_frame) = 0;
};
// Abstract base class for interpolators
class Interpolator : public Processor {
public:
ProcessingMode get_processing_mode() const override { return ProcessingMode::Interpolate; }
virtual int
interpolate(AVFrame* prev_frame, AVFrame* in_frame, AVFrame** out_frame, float time_step) = 0;
};
} // namespace processors
} // namespace video2x

View File

@@ -0,0 +1,39 @@
#pragma once
#include <functional>
#include <memory>
#include <unordered_map>
#include "processor.h"
namespace video2x {
namespace processors {
// Processor Factory Class
class ProcessorFactory {
public:
using Creator = std::function<std::unique_ptr<Processor>(const ProcessorConfig&, uint32_t)>;
// Singleton instance accessor
static ProcessorFactory& instance();
// Register a processor type with its creation function
void register_processor(ProcessorType type, Creator creator);
// Create a processor instance based on configuration
std::unique_ptr<Processor>
create_processor(const ProcessorConfig& proc_cfg, uint32_t vk_device_index) const;
private:
// Private constructor for Singleton
ProcessorFactory() = default;
// Map of processor types to their creation functions
std::unordered_map<ProcessorType, Creator> creators;
// Static initializer for default processors
static void init_default_processors(ProcessorFactory& factory);
};
} // namespace processors
} // namespace video2x

2585
models/libplacebo/anime4k-v4-a+a.glsl vendored Normal file

File diff suppressed because it is too large Load Diff

2309
models/libplacebo/anime4k-v4-a.glsl vendored Normal file

File diff suppressed because it is too large Load Diff

2585
models/libplacebo/anime4k-v4-b+b.glsl vendored Normal file

File diff suppressed because it is too large Load Diff

2309
models/libplacebo/anime4k-v4-b.glsl vendored Normal file

File diff suppressed because it is too large Load Diff

1711
models/libplacebo/anime4k-v4-c+a.glsl vendored Normal file

File diff suppressed because it is too large Load Diff

1435
models/libplacebo/anime4k-v4-c.glsl vendored Normal file

File diff suppressed because it is too large Load Diff

9173
models/libplacebo/anime4k-v4.1-gan.glsl vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,37 @@
7767517
35 39
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 2 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 2 3 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 3 4 5
Convolution convrelu_2 1 1 4 6 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 6 7 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 7 8 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Crop slice_43 1 1 5 9 -23309=2,4,4 -23310=2,-4,-4 -23311=2,1,2
Deconvolution deconvrelu_0 1 1 8 10 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_0 2 1 10 9 11
Convolution convrelu_5 1 1 11 12 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_20 1 1 12 13 0=3 1=4 3=2 4=3 5=1 6=3072
Split splitncnn_1 1 2 13 14 15
Convolution convrelu_6 1 1 14 16 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_7 1 1 16 17 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_2 1 2 17 18 19
Convolution convrelu_8 1 1 18 20 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_9 1 1 20 21 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 21 22 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 22 23 24
Convolution convrelu_11 1 1 23 25 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_12 1 1 25 26 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_13 1 1 26 27 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Crop slice_44 1 1 24 28 -23309=2,4,4 -23310=2,-4,-4 -23311=2,1,2
Deconvolution deconvrelu_1 1 1 27 29 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_1 2 1 29 28 30
Convolution convrelu_14 1 1 30 31 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 31 32 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Crop slice_45 1 1 19 33 -23309=2,16,16 -23310=2,-16,-16 -23311=2,1,2
Deconvolution deconvrelu_2 1 1 32 34 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_2 2 1 34 33 35
Convolution convrelu_16 1 1 35 36 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_18 1 1 36 37 0=3 1=3 5=1 6=1728
Crop slice_46 1 1 15 38 -23309=2,20,20 -23310=2,-20,-20 -23311=2,1,2
BinaryOp add_3 2 1 37 38 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 4 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 4 5 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 5 6 7
Convolution convrelu_2 1 1 7 8 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 8 9 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 9 10 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 10 11 12
Pooling mean_64 1 1 12 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 14 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 14 15 0=64 1=1 2=512 9=4
BinaryOp mul_2 2 1 11 15 16 0=2
Crop pad_9 1 1 6 17 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 16 18 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_3 2 1 17 18 19
Convolution convrelu_6 1 1 19 20 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 20 21 0=3 1=4 3=2 4=3 5=1 6=3072
Split splitncnn_2 1 2 21 22 23
Convolution convrelu_7 1 1 23 24 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 24 25 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 25 26 27
Convolution convrelu_9 1 1 27 28 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 28 29 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 29 30 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 30 31 32
Pooling mean_65 1 1 32 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 34 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 34 35 0=128 1=1 2=2048 9=4
BinaryOp mul_4 2 1 31 35 36 0=2
Split splitncnn_5 1 2 36 37 38
Convolution convrelu_13 1 1 38 39 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 39 40 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 40 41 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 41 42 43
Pooling mean_66 1 1 43 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 45 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 45 46 0=128 1=1 2=2048 9=4
BinaryOp mul_5 2 1 42 46 47 0=2
Crop pad_10 1 1 37 48 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 47 49 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 48 49 50
Convolution convrelu_17 1 1 50 51 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 51 52 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 52 53 54
Pooling mean_67 1 1 54 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 56 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 56 57 0=64 1=1 2=512 9=4
BinaryOp mul_7 2 1 53 57 58 0=2
Crop pad_11 1 1 26 59 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 58 60 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_8 2 1 59 60 61
Crop pad_12 1 1 22 62 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 61 63 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 63 64 0=3 1=3 5=1 6=1728
BinaryOp add_9 2 1 64 62 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 4 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 4 5 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 5 6 7
Convolution convrelu_2 1 1 7 8 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 8 9 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 9 10 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 10 11 12
Pooling mean_64 1 1 12 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 14 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 14 15 0=64 1=1 2=512 9=4
BinaryOp mul_2 2 1 11 15 16 0=2
Crop pad_9 1 1 6 17 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 16 18 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_3 2 1 17 18 19
Convolution convrelu_6 1 1 19 20 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 20 21 0=3 1=4 3=2 4=3 5=1 6=3072
Split splitncnn_2 1 2 21 22 23
Convolution convrelu_7 1 1 23 24 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 24 25 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 25 26 27
Convolution convrelu_9 1 1 27 28 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 28 29 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 29 30 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 30 31 32
Pooling mean_65 1 1 32 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 34 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 34 35 0=128 1=1 2=2048 9=4
BinaryOp mul_4 2 1 31 35 36 0=2
Split splitncnn_5 1 2 36 37 38
Convolution convrelu_13 1 1 38 39 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 39 40 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 40 41 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 41 42 43
Pooling mean_66 1 1 43 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 45 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 45 46 0=128 1=1 2=2048 9=4
BinaryOp mul_5 2 1 42 46 47 0=2
Crop pad_10 1 1 37 48 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 47 49 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 48 49 50
Convolution convrelu_17 1 1 50 51 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 51 52 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 52 53 54
Pooling mean_67 1 1 54 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 56 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 56 57 0=64 1=1 2=512 9=4
BinaryOp mul_7 2 1 53 57 58 0=2
Crop pad_11 1 1 26 59 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 58 60 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_8 2 1 59 60 61
Crop pad_12 1 1 22 62 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 61 63 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 63 64 0=3 1=3 5=1 6=1728
BinaryOp add_9 2 1 64 62 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 4 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 4 5 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 5 6 7
Convolution convrelu_2 1 1 7 8 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 8 9 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 9 10 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 10 11 12
Pooling mean_64 1 1 12 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 14 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 14 15 0=64 1=1 2=512 9=4
BinaryOp mul_2 2 1 11 15 16 0=2
Crop pad_9 1 1 6 17 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 16 18 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_3 2 1 17 18 19
Convolution convrelu_6 1 1 19 20 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 20 21 0=3 1=4 3=2 4=3 5=1 6=3072
Split splitncnn_2 1 2 21 22 23
Convolution convrelu_7 1 1 23 24 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 24 25 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 25 26 27
Convolution convrelu_9 1 1 27 28 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 28 29 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 29 30 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 30 31 32
Pooling mean_65 1 1 32 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 34 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 34 35 0=128 1=1 2=2048 9=4
BinaryOp mul_4 2 1 31 35 36 0=2
Split splitncnn_5 1 2 36 37 38
Convolution convrelu_13 1 1 38 39 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 39 40 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 40 41 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 41 42 43
Pooling mean_66 1 1 43 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 45 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 45 46 0=128 1=1 2=2048 9=4
BinaryOp mul_5 2 1 42 46 47 0=2
Crop pad_10 1 1 37 48 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 47 49 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 48 49 50
Convolution convrelu_17 1 1 50 51 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 51 52 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 52 53 54
Pooling mean_67 1 1 54 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 56 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 56 57 0=64 1=1 2=512 9=4
BinaryOp mul_7 2 1 53 57 58 0=2
Crop pad_11 1 1 26 59 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 58 60 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_8 2 1 59 60 61
Crop pad_12 1 1 22 62 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 61 63 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 63 64 0=3 1=3 5=1 6=1728
BinaryOp add_9 2 1 64 62 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 4 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 4 5 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 5 6 7
Convolution convrelu_2 1 1 7 8 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 8 9 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 9 10 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 10 11 12
Pooling mean_64 1 1 12 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 14 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 14 15 0=64 1=1 2=512 9=4
BinaryOp mul_2 2 1 11 15 16 0=2
Crop pad_9 1 1 6 17 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 16 18 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_3 2 1 17 18 19
Convolution convrelu_6 1 1 19 20 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 20 21 0=3 1=5 3=3 4=2 5=1 6=4800
Split splitncnn_2 1 2 21 22 23
Convolution convrelu_7 1 1 23 24 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 24 25 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 25 26 27
Convolution convrelu_9 1 1 27 28 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 28 29 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 29 30 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 30 31 32
Pooling mean_65 1 1 32 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 34 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 34 35 0=128 1=1 2=2048 9=4
BinaryOp mul_4 2 1 31 35 36 0=2
Split splitncnn_5 1 2 36 37 38
Convolution convrelu_13 1 1 38 39 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 39 40 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 40 41 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 41 42 43
Pooling mean_66 1 1 43 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 45 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 45 46 0=128 1=1 2=2048 9=4
BinaryOp mul_5 2 1 42 46 47 0=2
Crop pad_10 1 1 37 48 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 47 49 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 48 49 50
Convolution convrelu_17 1 1 50 51 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 51 52 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 52 53 54
Pooling mean_67 1 1 54 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 56 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 56 57 0=64 1=1 2=512 9=4
BinaryOp mul_7 2 1 53 57 58 0=2
Crop pad_11 1 1 26 59 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 58 60 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_8 2 1 59 60 61
Crop pad_12 1 1 22 62 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 61 63 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 63 64 0=3 1=3 5=1 6=1728
BinaryOp add_9 2 1 64 62 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 4 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 4 5 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 5 6 7
Convolution convrelu_2 1 1 7 8 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 8 9 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 9 10 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 10 11 12
Pooling mean_64 1 1 12 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 14 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 14 15 0=64 1=1 2=512 9=4
BinaryOp mul_2 2 1 11 15 16 0=2
Crop pad_9 1 1 6 17 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 16 18 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_3 2 1 17 18 19
Convolution convrelu_6 1 1 19 20 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 20 21 0=3 1=5 3=3 4=2 5=1 6=4800
Split splitncnn_2 1 2 21 22 23
Convolution convrelu_7 1 1 23 24 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 24 25 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 25 26 27
Convolution convrelu_9 1 1 27 28 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 28 29 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 29 30 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 30 31 32
Pooling mean_65 1 1 32 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 34 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 34 35 0=128 1=1 2=2048 9=4
BinaryOp mul_4 2 1 31 35 36 0=2
Split splitncnn_5 1 2 36 37 38
Convolution convrelu_13 1 1 38 39 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 39 40 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 40 41 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 41 42 43
Pooling mean_66 1 1 43 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 45 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 45 46 0=128 1=1 2=2048 9=4
BinaryOp mul_5 2 1 42 46 47 0=2
Crop pad_10 1 1 37 48 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 47 49 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 48 49 50
Convolution convrelu_17 1 1 50 51 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 51 52 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 52 53 54
Pooling mean_67 1 1 54 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 56 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 56 57 0=64 1=1 2=512 9=4
BinaryOp mul_7 2 1 53 57 58 0=2
Crop pad_11 1 1 26 59 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 58 60 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_8 2 1 59 60 61
Crop pad_12 1 1 22 62 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 61 63 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 63 64 0=3 1=3 5=1 6=1728
BinaryOp add_9 2 1 64 62 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 4 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 4 5 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 5 6 7
Convolution convrelu_2 1 1 7 8 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 8 9 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 9 10 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 10 11 12
Pooling mean_64 1 1 12 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 14 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 14 15 0=64 1=1 2=512 9=4
BinaryOp mul_2 2 1 11 15 16 0=2
Crop pad_9 1 1 6 17 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 16 18 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_3 2 1 17 18 19
Convolution convrelu_6 1 1 19 20 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 20 21 0=3 1=5 3=3 4=2 5=1 6=4800
Split splitncnn_2 1 2 21 22 23
Convolution convrelu_7 1 1 23 24 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 24 25 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 25 26 27
Convolution convrelu_9 1 1 27 28 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 28 29 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 29 30 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 30 31 32
Pooling mean_65 1 1 32 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 34 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 34 35 0=128 1=1 2=2048 9=4
BinaryOp mul_4 2 1 31 35 36 0=2
Split splitncnn_5 1 2 36 37 38
Convolution convrelu_13 1 1 38 39 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 39 40 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 40 41 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 41 42 43
Pooling mean_66 1 1 43 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 45 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 45 46 0=128 1=1 2=2048 9=4
BinaryOp mul_5 2 1 42 46 47 0=2
Crop pad_10 1 1 37 48 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 47 49 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 48 49 50
Convolution convrelu_17 1 1 50 51 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 51 52 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 52 53 54
Pooling mean_67 1 1 54 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 56 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 56 57 0=64 1=1 2=512 9=4
BinaryOp mul_7 2 1 53 57 58 0=2
Crop pad_11 1 1 26 59 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 58 60 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_8 2 1 59 60 61
Crop pad_12 1 1 22 62 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 61 63 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 63 64 0=3 1=3 5=1 6=1728
BinaryOp add_9 2 1 64 62 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 2 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 2 3 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 3 4 5
Convolution convrelu_2 1 1 5 6 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 6 7 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 7 8 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 8 9 10
Pooling mean_64 1 1 10 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 12 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 12 13 0=64 1=1 2=512 9=4
BinaryOp mul_0 2 1 9 13 14 0=2
Crop pad_9 1 1 4 15 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 14 16 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_1 2 1 15 16 17
Convolution convrelu_6 1 1 17 18 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 18 19 0=3 1=4 3=2 4=3 5=1 6=3072
Split splitncnn_2 1 2 19 20 21
Convolution convrelu_7 1 1 21 22 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 22 23 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 23 24 25
Convolution convrelu_9 1 1 25 26 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 26 27 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 27 28 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 28 29 30
Pooling mean_65 1 1 30 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 32 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 32 33 0=128 1=1 2=2048 9=4
BinaryOp mul_2 2 1 29 33 34 0=2
Split splitncnn_5 1 2 34 35 36
Convolution convrelu_13 1 1 36 37 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 37 38 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 38 39 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 39 40 41
Pooling mean_66 1 1 41 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 43 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 43 44 0=128 1=1 2=2048 9=4
BinaryOp mul_3 2 1 40 44 45 0=2
Crop pad_10 1 1 35 46 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 45 47 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_4 2 1 46 47 48
Convolution convrelu_17 1 1 48 49 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 49 50 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 50 51 52
Pooling mean_67 1 1 52 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 54 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 54 55 0=64 1=1 2=512 9=4
BinaryOp mul_5 2 1 51 55 56 0=2
Crop pad_11 1 1 24 57 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 56 58 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 57 58 59
Crop pad_12 1 1 20 60 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 59 61 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 61 62 0=3 1=3 5=1 6=1728
BinaryOp add_7 2 1 62 60 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 2 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 2 3 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 3 4 5
Convolution convrelu_2 1 1 5 6 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 6 7 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 7 8 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 8 9 10
Pooling mean_64 1 1 10 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 12 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 12 13 0=64 1=1 2=512 9=4
BinaryOp mul_0 2 1 9 13 14 0=2
Crop pad_9 1 1 4 15 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 14 16 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_1 2 1 15 16 17
Convolution convrelu_6 1 1 17 18 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 18 19 0=3 1=4 3=2 4=3 5=1 6=3072
Split splitncnn_2 1 2 19 20 21
Convolution convrelu_7 1 1 21 22 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 22 23 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 23 24 25
Convolution convrelu_9 1 1 25 26 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 26 27 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 27 28 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 28 29 30
Pooling mean_65 1 1 30 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 32 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 32 33 0=128 1=1 2=2048 9=4
BinaryOp mul_2 2 1 29 33 34 0=2
Split splitncnn_5 1 2 34 35 36
Convolution convrelu_13 1 1 36 37 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 37 38 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 38 39 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 39 40 41
Pooling mean_66 1 1 41 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 43 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 43 44 0=128 1=1 2=2048 9=4
BinaryOp mul_3 2 1 40 44 45 0=2
Crop pad_10 1 1 35 46 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 45 47 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_4 2 1 46 47 48
Convolution convrelu_17 1 1 48 49 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 49 50 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 50 51 52
Pooling mean_67 1 1 52 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 54 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 54 55 0=64 1=1 2=512 9=4
BinaryOp mul_5 2 1 51 55 56 0=2
Crop pad_11 1 1 24 57 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 56 58 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 57 58 59
Crop pad_12 1 1 20 60 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 59 61 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 61 62 0=3 1=3 5=1 6=1728
BinaryOp add_7 2 1 62 60 out0

Binary file not shown.

View File

@@ -0,0 +1,57 @@
7767517
55 63
Input in0 0 1 in0
Convolution convrelu_0 1 1 in0 2 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_1 1 1 2 3 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_0 1 2 3 4 5
Convolution convrelu_2 1 1 5 6 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_3 1 1 6 7 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_4 1 1 7 8 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_1 1 2 8 9 10
Pooling mean_64 1 1 10 gap0 0=1 4=1
InnerProduct convrelu_5 1 1 gap0 12 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_21 1 1 12 13 0=64 1=1 2=512 9=4
BinaryOp mul_0 2 1 9 13 14 0=2
Crop pad_9 1 1 4 15 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_0 1 1 14 16 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_1 2 1 15 16 17
Convolution convrelu_6 1 1 17 18 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Deconvolution deconv_48 1 1 18 19 0=3 1=4 3=2 4=3 5=1 6=3072
Split splitncnn_2 1 2 19 20 21
Convolution convrelu_7 1 1 21 22 0=32 1=3 5=1 6=864 9=2 -23310=1,1.000000e-01
Convolution convrelu_8 1 1 22 23 0=64 1=3 5=1 6=18432 9=2 -23310=1,1.000000e-01
Split splitncnn_3 1 2 23 24 25
Convolution convrelu_9 1 1 25 26 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
Convolution convrelu_10 1 1 26 27 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution convrelu_11 1 1 27 28 0=128 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Split splitncnn_4 1 2 28 29 30
Pooling mean_65 1 1 30 gap1 0=1 4=1
InnerProduct convrelu_12 1 1 gap1 32 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_22 1 1 32 33 0=128 1=1 2=2048 9=4
BinaryOp mul_2 2 1 29 33 34 0=2
Split splitncnn_5 1 2 34 35 36
Convolution convrelu_13 1 1 36 37 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
Convolution convrelu_14 1 1 37 38 0=256 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Convolution convrelu_15 1 1 38 39 0=128 1=3 5=1 6=294912 9=2 -23310=1,1.000000e-01
Split splitncnn_6 1 2 39 40 41
Pooling mean_66 1 1 41 gap2 0=1 4=1
InnerProduct convrelu_16 1 1 gap2 43 0=16 1=1 2=2048 9=1
InnerProduct convsigmoid_23 1 1 43 44 0=128 1=1 2=2048 9=4
BinaryOp mul_3 2 1 40 44 45 0=2
Crop pad_10 1 1 35 46 -23309=2,4,4 -23310=2,-4,-4 -23311=2,-2,-1
Deconvolution deconvrelu_1 1 1 45 47 0=128 1=2 3=2 5=1 6=65536 9=2 -23310=1,1.000000e-01
BinaryOp add_4 2 1 46 47 48
Convolution convrelu_17 1 1 48 49 0=64 1=3 5=1 6=73728 9=2 -23310=1,1.000000e-01
Convolution convrelu_18 1 1 49 50 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Split splitncnn_7 1 2 50 51 52
Pooling mean_67 1 1 52 gap3 0=1 4=1
InnerProduct convrelu_19 1 1 gap3 54 0=8 1=1 2=512 9=1
InnerProduct convsigmoid_24 1 1 54 55 0=64 1=1 2=512 9=4
BinaryOp mul_5 2 1 51 55 56 0=2
Crop pad_11 1 1 24 57 -23309=2,16,16 -23310=2,-16,-16 -23311=2,-2,-1
Deconvolution deconvrelu_2 1 1 56 58 0=64 1=2 3=2 5=1 6=16384 9=2 -23310=1,1.000000e-01
BinaryOp add_6 2 1 57 58 59
Crop pad_12 1 1 20 60 -23309=2,20,20 -23310=2,-20,-20 -23311=2,-2,-1
Convolution convrelu_20 1 1 59 61 0=64 1=3 5=1 6=36864 9=2 -23310=1,1.000000e-01
Convolution conv_46 1 1 61 62 0=3 1=3 5=1 6=1728
BinaryOp add_7 2 1 62 60 out0

Some files were not shown because too many files have changed in this diff Show More