Code Monkey home page Code Monkey logo

video2x's Introduction


Join our Telegram discussion group to ask any questions you have about Video2X, chat directly with the developers, or discuss about upscaling technologies and the future of Video2X in general.

The latest Windows update is built based on version 4.8.1. GUI is not available for 5.0.0 yet, but is already under development. Go to the GUI page to see the basic usages of the GUI. Try the mirror if you can't download releases directly from GitHub.

You can use Video2X on Google Colab for free if you don't have a powerful GPU of your own. You can borrow a powerful GPU (Tesla K80, T4, P4, or P100) on Google's server for free for a maximum of 12 hours per session. Please use the free resource fairly and do not create sessions back-to-back and run upscaling 24/7. This might result in you getting banned. You can get Colab Pro/Pro+ if you'd like to use better GPUs and get longer runtimes. Usage instructions are embedded in the Colab Notebook.

Nightly releases are automatically created by the GitHub Actions CI/CD pipelines. They usually contain more experimental features and bug fixes. However, they are much less stable to the stable releases. You must log in to GitHub to download CI build artifacts.

Video2X container images are available on the GitHub Container Registry for easy deployment on Linux and macOS. If you already have Docker/Podman installed, only one command is needed to start upscaling a video. For more information on how to use Video2X's Docker image, please refer to the documentations.

Video2X's documentations are hosted on this repository's Wiki page. It includes comprehensive explanations for how to use the GUI, the CLI, the container image, the library, and more. The Wiki is open to edits by the community, so you, yes you, can also correct errors or add new contents to the documentations.

Introduction

Video2X is a video/GIF/image upscaling and frame interpolation software written in Python. It can use these following state-of-the-art algorithms to increase the resolution and frame rate of your video/GIF/image. More information about the algorithms that it supports can be found in the documentations.

Video Upscaling

Spirited Away Demo
Upscale demo: Spirited Away's movie trailer

  • Spirited Away: YouTube | Bilibili
    • 360P to 4K
    • The original video's copyright belongs to ๆ ชๅผไผš็คพใ‚นใ‚ฟใ‚ธใ‚ชใ‚ธใƒ–ใƒช
  • Bad Apple!!: YouTube | Bilibili
    • 384P to 4K 120FPS
    • The original video's copyright belongs to ใ‚ใซใ‚‰
  • The Pet Girl of Sakurasou: YouTube | Bilibili
    • 240P to 1080P 60FPS
    • The original video's copyright belongs to ASCII Media Works

GIF Upscaling

catfru catfru4x
Catfru scaled up to 4x its original size using waifu2x (original image)

Image Upscaling

Jill Comparison
Image 8x upscaling demo (original image by nananicu)

Standard Test Clip

The following clip can be used to test if your setup works properly. This is also the standard clip used for running performance benchmarks.

The original clip came from the anime "ใ•ใใ‚‰่˜ใฎใƒšใƒƒใƒˆใชๅฝผๅฅณ."
Copyright of this clip belongs to ๆ ชๅผไผš็คพใ‚ขใƒ‹ใƒ—ใƒฌใƒƒใ‚ฏใ‚น.

License

This project is licensed under the GNU Affero General Public License Version 3 (GNU AGPL v3)
Copyright (C) 2018-2024 K4YT3X and contributors.

AGPLv3

This project includes or depends on these following projects:

Project License
FFmpeg LGPLv2.1, GPLv2
waifu2x-ncnn-vulkan MIT License
srmd-ncnn-vulkan MIT License
realsr-ncnn-vulkan MIT License
rife-ncnn-vulkan MIT License
realcugan-ncnn-vulkan MIT License
Anime4K MIT License
ffmpeg-python Apache-2.0
Loguru MIT License
opencv-python MIT License
Pillow HPND License
Rich MIT License
pynput LGPLv3.0

Legacy versions of this project includes or depends on these following projects:

Project License
waifu2x-caffe MIT License
waifu2x-converter-cpp MIT License
Anime4KCPP MIT License
Gifski AGPLv3
tqdm MPLv2.0, MIT License

More licensing information can be found in the NOTICES file.

Special Thanks

Appreciations given to the following personnel who have contributed significantly to the project.

Similar Projects

  • Dandere2x: A lossy video upscaler also built around waifu2x, but with video compression techniques to shorten the time needed to process a video.
  • Waifu2x-Extension-GUI: A similar project that focuses more and only on building a better graphical user interface. It is built using C++ and Qt5, and currently only supports the Windows platform.

video2x's People

Contributors

28598519a avatar brianpetkovsek avatar donicrosby avatar felixkruemel avatar fire0shadow avatar importtaste avatar k4yt3x avatar konqidam avatar mayiflex avatar medram avatar peterdavehello avatar plambe avatar presc avatar sat3ll avatar snixon avatar yousiki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video2x's Issues

JSON object must be str, not bytes

I get this error when I try to run the latest version of video2x:
JSON object must be str, not bytes
I was able to fix it by changing video2x.py line 98 to the following:
return json.loads(json_str.decode('utf-8'))

I also had to perform the following package install commands to get this new version of video2x to run:
pip install tqdm
pip install avalon_framework
pip install colorama

That's not an issue in and of itself, but if the readme doesn't already advise the user to install those packages beforehand, it should be changed to do so.

Images Unprocessed When Using CUDNN

So im back and now having this error:

"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -i "D:\S01E01o.avi" C:\Users\Marcd\Desktop\videoenlarger\video2x-master\frames\extracted_%0d.png -y
ffmpeg version N-92202-gf72b9904fe Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, avi, from 'D:\S01E01o.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
  Duration: 00:20:50.46, start: 0.000000, bitrate: 1172 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1035 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> png (native))
Press [q] to stop, [?] for help
[mpeg4 @ 0000000004724800] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.
Output #0, image2, to 'C:\Users\Marcd\Desktop\videoenlarger\video2x-master\frames\extracted_%0d.png':
  Metadata:
    encoder         : Lavf58.19.100
    Stream #0:0: Video: png, rgb24, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc
    Metadata:
      encoder         : Lavc58.33.101 png
frame=29982 fps=217 q=-0.0 Lsize=N/A time=00:20:50.50 bitrate=N/A dup=1 drop=0 speed=9.07x
video:10005055kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[+] INFO: Reading video information
[+] INFO: Framerate: 23.976
[+] INFO: Starting to upscale extracted images
2018-11-01 21:43:49.597001 [+] INFO: [upscaler] Thread 0 started
2018-11-01 21:43:49.598004 [+] INFO: [upscaler] Thread 1 started
2018-11-01 21:43:49.598004 [+] INFO: [upscaler] Thread 2 started
2018-11-01 21:43:49.599007 [+] INFO: [upscaler] Thread 3 started
2018-11-01 21:43:49.599007 [+] INFO: [upscaler] Thread 4 started
2018-11-01 21:43:49.600010 [+] INFO: [upscaler] Thread 5 started
2018-11-01 21:43:49.600010 [+] INFO: [upscaler] Thread 6 started
2018-11-01 21:43:49.601012 [+] INFO: [upscaler] Thread 7 started
2018-11-01 21:43:49.601012 [+] INFO: [upscaler] Thread 8 started
2018-11-01 21:43:49.601012 [+] INFO: [upscaler] Thread 9 started
2018-11-01 21:43:49.604020 [+] INFO: [upscaler] Thread 10 started
2018-11-01 21:43:49.605023 [+] INFO: [upscaler] Thread 11 started
2018-11-01 21:43:50.194590 [+] INFO: [upscaler] Thread 4 exiting
2018-11-01 21:43:50.364041 [+] INFO: [upscaler] Thread 0 exiting
2018-11-01 21:43:50.381086 [+] INFO: [upscaler] Thread 9 exiting
2018-11-01 21:43:50.383091 [+] INFO: [upscaler] Thread 1 exiting
2018-11-01 21:43:50.388105 [+] INFO: [upscaler] Thread 10 exiting
2018-11-01 21:43:50.390110 [+] INFO: [upscaler] Thread 11 exiting
2018-11-01 21:43:50.394121 [+] INFO: [upscaler] Thread 5 exiting
2018-11-01 21:43:50.395124 [+] INFO: [upscaler] Thread 6 exiting
2018-11-01 21:43:50.395124 [+] INFO: [upscaler] Thread 7 exiting
2018-11-01 21:43:50.396126 [+] INFO: [upscaler] Thread 3 exiting
2018-11-01 21:43:50.398131 [+] INFO: [upscaler] Thread 8 exiting
2018-11-01 21:43:50.399134 [+] INFO: [upscaler] Thread 2 exiting
[+] INFO: Upscaling completed
[+] INFO: Converting extracted frames into video
"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -r 23.976 -f image2 -s 640x480 -i C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\extracted_%d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\no_audio.mp4 -y
ffmpeg version N-92202-gf72b9904fe Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[image2 @ 000000000465afc0] Could find no file with path 'C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\extracted_%d.png' and index in the range 0-4
C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\extracted_%d.png: No such file or directory
[+] INFO: Conversion completed
[+] INFO: Stripping audio track from original video
"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -i "D:\S01E01o.avi" -vn -acodec copy C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\output-audio.aac -y
ffmpeg version N-92202-gf72b9904fe Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, avi, from 'D:\S01E01o.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
  Duration: 00:20:50.46, start: 0.000000, bitrate: 1172 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1035 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
[adts @ 0000000004748000] Only AAC streams can be muxed by the ADTS muxer
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
    Last message repeated 1 times
[+] INFO: Inserting audio track into new video
"C:\Users\Marcd\Desktop\videoenlarger\ffmpeg-4.0.2\bin/ffmpeg.exe" -i C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\no_audio.mp4 -i C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\output-audio.aac -shortest -codec copy D:\S01E01n.avi -y
ffmpeg version N-92202-gf72b9904fe Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
C:\Users\Marcd\Desktop\videoenlarger\video2x-master\upscaled\no_audio.mp4: No such file or directory
[+] INFO: Program completed, taking 154.6568 seconds

help

can't seem to get it figured
installed python - downloaded ffmpeg-4.0.1.tar.bz2 and waifu
put everything in waifu folder use bat and python
need help on how specifically run it

AttributeError: module 'avalon_framework' has no attribute 'FM'

I get error:

               Video2X Video Enlarger
Traceback (most recent call last):
  File "video2x.py", line 175, in <module>
    print_logo()
  File "video2x.py", line 83, in print_logo
    '    Version ' + VERSION + '\n' + avalon.FM.RST)
AttributeError: module 'avalon_framework' has no attribute 'FM'

ProgressBar

is it possible to implement a Progress Bar or something simlair ? for upscaling progress

Progress bar

A progress bar/percentage has been often asked for but seemed impossible. A possible solution:

Run a side script that tracks the number of files in the waifu2x output folder vs the input folder.
100 * output / input for percentage.

FileNotFoundError: "C:/Program Files (x86)/ffmpeg/bin/ffmpeg.exe"

"C:/Program Files (x86)/ffmpeg/bin/ffmpeg.exe" -i "C:\Users\Me\AppData\Local\Programs\Python\Python37-32\testvid.mp4" C:\Users\Me\AppData\Local\Programs\Python\Python37-32\frames\extracted_%0d.png -y
[!] ERROR: An exception occurred
Traceback (most recent call last):
  File "video2x.py", line 287, in <module>
    video2x()
  File "video2x.py", line 208, in video2x
    fm.extract_frames(args.video, FRAMES)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python37-32\ffmpeg.py", line 41, in extract_frames
    subprocess.call(execute)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 317, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\Me\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 769, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1172, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

Small fix regarding documentation for waifu2x model selection

With some of the recent updates surrounding the new json config layout and the waifu2x model selection, the existing known usage of the command line -y option is out of date. If you use, for example -y cunet on the command line which used to work just fine, it now passes this as --model_dir cunet to waifu2x which is the wrong syntax it is expecting and thus fails that stage of the script.

I only noticed this as I had left the -y option in my batch file and it began failing once it got to the upscaling stage. It obviously functions fine if -y is dropped off and left to use the model_dir directive in the json file.

ffmpeg extraction fails to start if missing extracted frames folder with custom paths

Found out with the custom extracted and upscaled frames folders if those are missing, at the very least the ffmpeg extraction step fails. Not sure if waifu2x-caffe will do the same as I did not get that far. Where this comes in is the end of the script when it wipes those folders, it'll do so whether using the temp directory or custom paths. In a batch this is a no-go.

I've done a potentially crude fix for this which I'll try and do a PR for. You may wish to do a cleaner version of course. :)

Extracting frames stopping

Ffmpeg stops extracting frames after a certain period of time, around 25 seconds. I know it is time based, because it was a different amount of frames before it stopped on my ssd vs my hdd with the same video. No cpu or disk usage, complete halt. All i have done is cloned the git and used the setup.py.

Edit: this only happens when you lose focus of the cmd window. Whoops.

[WinError 5] Access Denied

I ran into an issue. Issues appears if either cudNN or gpu mode is used.
Using a GTX 1070 with CUDA 10.1 installed and cudNN library.

The entire log:

              Video2X Video Enlarger

                   Version 2.4.3

[!] WARNING: Each waifu2x-caffe thread will require up to 2.5 GB of system memory
[!] WARNING: You demanded 5 threads to be created, but you only have 9.2927 GB system memory available
[!] WARNING: 12.5 GB of system memory is recommended for 5 threads
[!] WARNING: With your current amount of system memory available, 3 threads is recommended
[?] USER: Change to the recommended value? [Y/n]: Y
[!] WARNING: Each waifu2x-caffe thread will require up to 2.5 GB of system memory
[!] WARNING: You demanded 3 threads to be created, but you only have 7.1709 GB GPU memory available
[!] WARNING: 10.5 GB of GPU memory is recommended for 3 threads
[!] WARNING: With your current amount of GPU memory available, 2 threads is recommended
[?] USER: Change to the recommended value? [Y/n]: Y
[+] INFO: Upscaling single video file: C:\Users\username\Desktop\heretitle\heretitle\heretitle.mkv
2019-03-01 01:47:57.933123 [+] INFO: Extracted frames is being saved to: G:\Convert\Temp\extracted
2019-03-01 01:47:57.933123 [+] INFO: Upscaled frames is being saved to: G:\Convert\Temp\upscaled
Executing: "G:\Convert\video2x\ffmpeg-4.1-win64-static\bin/ffmpeg.exe" -i "C:\Users\username\Desktop\heretitle\heretitle\heretitle.mkv" "G:\Convert\Temp\extracted"\extracted_%0d.png -y -hwaccel auto
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Trailing options were found on the commandline.
Input #0, matroska,webm, from 'C:\Users\username\Desktop\heretitle\heretitle\heretitle.mkv':
  Metadata:
    title           : 
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 2017-03-22T01:43:04.000000Z
  Duration: 00:29:00.96, start: 0.000000, bitrate: 1455 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 640x478, SAR 1:1 DAR 320:239, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default) (forced)
    Metadata:
      title           : 
    Stream #0:1(ger): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) (forced)
    Metadata:
      title           : GER - AC3
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
Output #0, image2, to 'G:\Convert\Temp\extracted\extracted_%0d.png':
  Metadata:
    title           : 
    encoder         : Lavf58.20.100
    Stream #0:0: Video: png, rgb24, 640x478 [SAR 1:1 DAR 320:239], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default) (forced)
    Metadata:
      title           : 
      encoder         : Lavc58.35.100 png
frame=41739 fps=167 q=-0.0 Lsize=N/A time=00:29:00.86 bitrate=N/A speed=6.95x
video:14407542kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[+] INFO: Reading video information
[+] INFO: Framerate: 23.976023976023978
[+] INFO: Starting to upscale extracted images
2019-03-01 01:52:57.566659 [+] INFO: [upscaler] Thread 1 started
2019-03-01 01:52:57.567651 [+] INFO: [upscaler] Thread 0 started
Exception in thread 0:
Traceback (most recent call last):
  File "G:\Python\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "G:\Python\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "G:\video2x\video2x\bin\waifu2x_caffe.py", line 50, in upscale
    subprocess.call(execute)
  File "G:\Python\lib\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "G:\Python\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "G:\Python\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
PermissionError: [WinError 5] Access Denied
Exception in thread 1:
Traceback (most recent call last):
  File "G:\Python\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "G:\Python\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "G:\video2x\video2x\bin\waifu2x_caffe.py", line 50, in upscale
    subprocess.call(execute)
  File "G:\Python\lib\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "G:\Python\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "G:\Python\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
PermissionError: [WinError 5] Access Denied


[+] INFO: Upscaling completed
[+] INFO: Converting extracted frames into video
Executing: "G:\Convert\video2x\ffmpeg-4.1-win64-static\bin/ffmpeg.exe" -r 23.976023976023978 -f image2 -s 1920x1440 -i "G:\Convert\Temp\upscaled"\extracted_%d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p "G:\Convert\Temp\upscaled"\no_audio.mp4 -y -hwaccel auto
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Trailing options were found on the commandline.
[image2 @ 00000292d440b480] Could find no file with path 'G:\Convert\Temp\upscaled\extracted_%d.png' and index in the range 0-4
G:\Convert\Temp\upscaled\extracted_%d.png: No such file or directory
[+] INFO: Conversion completed
[+] INFO: Migrating audio tracks and subtitles to upscaled video
Executing: "G:\Convert\video2x\ffmpeg-4.1-win64-static\bin/ffmpeg.exe" -i "G:\Convert\Temp\upscaled"\no_audio.mp4 -i "C:\Users\username\Desktop\heretitle\heretitle\heretitle.mkv" -c:a copy -c:v copy -c:s copy -map 0:v? -map 1:a? -map 1:s? "G:\Convert\MovieOut\stars-battle.angel.alita.ova.mp4" -y -hwaccel auto
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Trailing options were found on the commandline.
G:\Convert\Temp\upscaled\no_audio.mp4: No such file or directory
[+] INFO: Program completed, taking 299.76256 seconds
Deleting cache directory: G:\Convert\Temp\extracted
Deleting cache directory: G:\Convert\Temp\upscaled

Help starting out?

Hi, Is this for linux or windows? Python doesn't support git cloning or change directory, but it is mentioned thru the instructions and tags.

Can't figure out what features are available...

  1. always throws and error that there is no factor specified, even when using height and width, even when a factor is specified

  2. gpu always throws an error
    [!] ERROR: An exception occurred
    Traceback (most recent call last):
    File "video2x.py", line 357, in
    video2x()
    File "video2x.py", line 207, in video2x
    ffmpeg_arguments.append('-hwaccel {}'.format(ffmpeg_hwaccel))
    AttributeError: 'str' object has no attribute 'append'

  3. since only CPU works and I have to modify video2x.py to remove the check for the factor parameter in order to proceed, output still fails:
    [image2 @ 000001b40701b2c0] Could find no file with path 'c:\Documents\Downloads\video2x-master\upscaled\extracted_%d.png' and index in the range 0-4
    c:\Documents\Downloads\video2x-master\upscaled\extracted_%d.png: No such file or directory
    c:\Documents\Downloads\video2x-master\upscaled\no_audio.mp4: No such file or directory

It is possible to provide an example of a situation when the script works?

Several dependencies missing

It says that I need to download both TQDM and Avalon Framework because they are showing up as modules that are missing

I downloaded TQDM from GitHub and that worked, however, I was then met with an error saying that there was no module called Avalon. I downloaded your Avalon package from GitHub but that did not work.

I ended up having to remove every instance of Avalon from the video2x.py in order for it to run
properly.

image

That is the one for TQDM, but it said the same for Avalon once I got TQDM sorted.

ZeroDivisionError?

After the program finished processing all the frames, the following message appeared:
video:4418846kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[!] ERROR: An exception occurred
Traceback (most recent call last):
File "video2x.py", line 215, in
video2x()
File "video2x.py", line 150, in video2x
framerate = float(Fraction(info['streams'][0]['avg_frame_rate']))
File "C:\Python27\lib\fractions.py", line 162, in new
raise ZeroDivisionError('Fraction(%s, 0)' % numerator)
ZeroDivisionError: Fraction(0, 0)

What could have caused this problem? Does this program require certain video coding format to run properly?

KeyError: 'ffmpeg_hwaccel'

I'm in understanding that i've installed all Prerequisites. I've checked that they are correctly installed by typing 'ffmpeg' or 'python' in cmd.

I've also defined in the Config generator the location of the installed prerequisties, although I didn't know what to write for arguments passed ffmpeg or something along those lines.

When i try to use the program and type in what is required, I am met with the follow.

===================================================================


\ \ / / () | | |__ \ \ \ / /
\ \ / / _ __| | ___ ___ ) | \ V /
\ / / | | / ` | / _ \ / _ \ / / > <
\ / | | | (
| | | __/ | (
) | / /_ / .
/ || _,| _| _/ |__| // _\

           Video2X Video Enlarger

               Version 2.1.5

Traceback (most recent call last):
File "video2x.py", line 300, in
ffmpeg_hwaccel = config['ffmpeg_hwaccel']
KeyError: 'ffmpeg_hwaccel'

===================================================================
I did 'ffmpeg -hwaccel_device 1' in cmd thinking it would do something but it didn't fix this. Truth be told I only half know what I'm doing, but I somehow got this far.

I've probably done something wrong, any help would be much appeciated.

Many Thanks

FileNotFoundError

an i get the next error :D

"C:/Users/Marcd/Desktop/videoenlarger/ffmpeg-4.0.2/ffmpeg.exe" -i "D:\S01E01o.avi" C:\Users\Marcd\Desktop\videoenlarger\video2x-master\frames\extracted_%0d.png -y
[!] ERROR: An exception occurred
Traceback (most recent call last):
File "video2x.py", line 207, in
video2x()
File "video2x.py", line 144, in video2x
fm.extract_frames(args.video, FRAMES)
File "C:\Users\Marcd\Desktop\videoenlarger\video2x-master\ffmpeg.py", line 41, in extract_frames
subprocess.call(execute)
File "C:\Users\Marcd\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 317, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\Marcd\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 769, in init
restore_signals, start_new_session)
File "C:\Users\Marcd\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1172, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden

No such file or directory

Windows 10, Python 3.7.0
Catching several exceptions during upscaling (webm):

[image2 @ 000002b53ac8ad00] Could find no file with path 'C:\Users\deonix\AppData\Local\Temp\tmpou7zsjpm\extracted_%d.png' and index in the range 0-4
C:\Users\deonix\AppData\Local\Temp\tmpou7zsjpm\extracted_%d.png: No such file or directory
Output #0, adts, to 'C:\Users\deonix\AppData\Local\Temp\tmpq9r1jr4z\output-audio.aac':
Output file #0 does not contain any stream
C:\Users\deonix\AppData\Local\Temp\tmpq9r1jr4z\no_audio.mp4: No such file or directory

Add Option for Scaling

would be nice to say i want the file x times larger and not to tell the exact resolution.

and thank you for all your work at this :)

ffmpeg issue

While ffmpeg was woking extracting the audio, it returned this error
image
Creating an empty output_audio.aac
So when it was copying that audio on the final video:
image

I repeated the process inserting the commands on my own and got it working using -acodec aac
I was working with a .avi video. It is a problem with that video format? Or a common error? I used ffmpeg 4.1

Thanks for your awesome work

Request: Allow bypassing 'create folder?' request at startup if cache folders are missing

As requested in #39

With the new update to allow creation of the cache folders if missing (if using custom paths) it now adds a user input request to confirm creation upon startup.

The issue is that at the end of the script regardless of whether it is using the default temp folders or custom paths for the cache folders, it will erase the folders outright. So even for custom paths if you originally created the folders, the script will wipe them when one instance of the script finishes and on the next will query the user to create them again. This breaks batch scripts.

Either providing a command line or config option to bypass this query and default it to yes or rewriting the cache erasing section of the script to retain the custom folders would work. Not preferential to either one. Whatever works to get around this. :)

ERROR when upscaling images. AttributeError: 'module' object has no attribute 'DEVNULL'

[+] INFO: Framerate: 24.0
[+] INFO: Starting to upscale extracted images
Upscaling: extracted_1.png:   0%|                                                            | 0/15666 [00:00<?, ?it/s][!] ERROR: An exception occurred
Traceback (most recent call last):
  File "video2x.py", line 212, in <module>
    video2x()
  File "video2x.py", line 164, in video2x
    width, int(args.factor) * height)
  File "C:\Users\Blarg\Downloads\VideoUpscaler\video2x\waifu2x.py", line 47, in upscale
    subprocess.call(execute, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
AttributeError: 'module' object has no attribute 'DEVNULL'
Exception KeyError: KeyError(<weakref at 000000000347E688; to 'tqdm' at 00000000039207F0>,) in <bound method tqdm.__del__ of Upscaling: extracted_1.png:   0%|                                                            | 0/15666 [00:00<?, ?it/s]> ignored

TypeError: ask() got an unexpected keyword argument 'batch'

With the new batch argument added I'm now seeing the above error when attempting to use it. Tried to debug on my own but unfortunately not seeing what is up. Here's the full error message. Tried both -b and --batch at the end of the command

[!] WARNING: Specified cache folder/directory Z:\video2x does not exist
Traceback (most recent call last):
File "video2x.py", line 207, in
if Avalon.ask('Create folder/directory?', default=True, batch=args.batch):
TypeError: ask() got an unexpected keyword argument 'batch'

Dependencies Auto-install Script

Abstract

Add a script that will deploy all dependencies automatically upon execution.

Detailed Description

It may be hard for users not having knowledge about CLI to get started with video2x. A script that will install all dependencies automatically could simplify the process. Therefore a decision has been made that this script should be added into the mix.

Modules to be installed include:

Binary

  • ffmpeg
  • waifu2x-caffe

Python Dependencies

  • avalon framework

no such file or directory

please delete this, i suspect it has something to do with incomparable versions of windows 10, i had errors with pip/python earlier only just managed to get it working with this, it seems nvidia drivers don't like working for this version of windows (cuda, cudnn) BUILD (17134) got 32gb of ram, ryzen 1800x +1050ti it won't actually let me use it for some reason :(

Add Multithreading

Based on #11,

Enhance the overall performance with multithreading.

1. try to make waifu2x going to make multible pictures at once and not one by one.
#11 (comment)

1. Add a feature for adding folder within multiple files.
#11 (comment)

include "attachment" (t) stream for fonts

The attachments stream is usually used to hold fonts for subtitles, one example where this is used is the latest season of JoJo, HorribleSubs release. To copy it over from the source file, the following code can be used in ffmpeg:

-c:t copy -map 1:t?

add Config file

I think a Config file would be nice for the path of ffmpeg and waifu2x (and any other ?). When updating for now i must go into the main file and edit it

Error, not enough memory? Retrying...)

File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)
File: 000001.png, Code: 1 (Error, not enough memory? Retrying...)
File: 014301.png, Code: 1 (Error, not enough memory? Retrying...)

'frames' folder split leaving random frame out, breaking post-upscale encode step

Decided to give this a go on a test video this morning. A roughly 22-25 minute video with approx. 35k frames. One thing I ran into is that somewhere during the process where it breaks the frames out into equal folders depending on the number of upscaler threads use for whatever reason in my test left out a single frame. So essentially I had this:

frames
-- \0
-- \1
-- \2
-- \extracted_9999.png

Btw, that frame number is correct in my scenario and not just a placeholder

So with that lone frame outside those folders, after upscaling was done there was a single frame gap in the upscaled folder. It then cascaded to the following ffmpeg encode step failing at that frame number because it couldn't find it.

FWIW it recommended dropping down to 3 threads which I did so not sure how related that would be here. Despite the fact it never seems to use much more than about 1GB extra tops over my normal load leaving about 7GB free still and just 1GB VRAM used on my 6GB 1060 MaxQ. Though it seemed to load the system down pretty well with the Compute load up around 85% and CPU (i7-7700HQ) regularly around 90%. Took about 2.5 hours just for the upscale portion for 35k frames.

An exception occurred

I'm getting this error when running the program:

[!] ERROR: An exception occurred
Traceback (most recent call last):
  File "video2x.py", line 357, in <module>
    video2x()
  File "video2x.py", line 207, in video2x
    ffmpeg_arguments.append('-hwaccel {}'.format(ffmpeg_hwaccel))
AttributeError: 'str' object has no attribute 'append'

Always give an error when zooming in

Trailing options were found on the commandline.
G:\video2x-master\video2x-master\upscaled\no_audio.mp4: No such file or directory
[+] INFO: Program completed, taking 19.93307 seconds

Some quality-of-life improvements (command line arguments and core processing tweaks)

So been playing around with this script a bit more. I have an old show of about ~90 episodes I'd like to start processing with this. Some things that immediately came to mind that could probably be improved upon:

  1. Currently the 'demux' and 'remux' stages assume a single AAC audio track and fail if there's any other formats used and miss secondary audio tracks. Being able to dynamically work with what is in the source file would be nice, including multiple audio tracks as well as subtitle tracks. Maybe just automatically say all tracks after the video track just copy them 1:1 to the output video. Don't even need to re-encode here since that can be done after the fact pretty easily.

  2. There are a LOT of command line arguments being given to ffmpeg along the way as well as even waifu2x-caffe which are currently hardcoded and could be more suitable having some of them as either command line options or in the config file. Prime example is the h264 encoding stage and being able to fine tune the encoding settings. Even a one off case I'm running into is cropping black borders off at the frame extraction stage that otherwise get blown up needlessly otherwise in the end.

  3. Maybe choose to have options to redirect the frames and upscale folders to a different location.

I may play around with these on my own but can't guarantee anything or even a timeframe. Not a developer by any means (unless you count some crusty php knowledge from 10+ years ago that barely counts as novice level. lol) but have been meaning to pick up python at some point so may give me something to toy around with.

First time user error messages.

Just followed the tutorial everything was smooth but on my try out video I get these errors, it does not crash tho. (video was 480p mp4 to 1080p mp4.
index

Resume process

Hello,

I was experimenting a bit with the program yesterday, and the core concept is neat but something that's really missing is a way to resume a video. In my testing, on a i7 5820k and 1080Ti, resolution doubling a single 22min 640x480 episode takes something close to 40 hours.

It would definitely be useful to be able to stop the transcode and then resume later.

Any ideas about how that should be handled? I can help out with a patch.

File not found when filename contains spaces

When providing a filename containing spaces it throws a file not found error only showing the first word in the filename. The filename is quoted on the commandline but doesn't seem to carry over in the script. This is with double quotes. Suspecting they may be getting stripped I tried with single quotes but this just results in an argument error instead.

include new models (improvement)

Hello,

I've just found your tool and I've been digging through the code a bit. I've noticed that your code does not allow for the use of the newer models included in waifu2x caffe, in particular "cunet" and "upresnet10". From my experience, cunet can give even better results than anime_style_art_rgb with better handling of noise and haloing even without turning on much noise reduction. I've not compared their performance though.

Would it be possible to have those models included in the -y / --model_type option?

Thanks.

Cant seem to get waifu2x-converter-cpp to work.

Been playing around with this for the last hour or so and I can't get waifu2x-converter-cpp to work.
CPU works fine but every time I use -d waifu2x_converter I run into the same problem.

The video will extract fine but when it comes time to upscale I keep getting a "cv::imread failed" error and then a message saying the process was successfully done.

noise level option (improvement)

After digging through your code, I found that you've hardcoded the use of level 3 noise reduction for waifu2x. That seems a bit excessive for most anime encodes files imo. Could you possibly include an option -n / --noise_level to let the user set this? That would be awesome.

Completes at 50% output video is unplayable.

new user here. I followed the tutorial and my process runs to 50% about and then INFO: program completed, appears and it closes the task and deletes all temporary images. the video file that it creates is a small 4mb file with no video (the input file is 60mb). I've gone to the temp folder while it is running and i've seen it is creating the images.
i'm unclear on where the log is but here's this for now
elp

Check failed: error == cudaSuccess (2 vs. 0) out of memory

K4YT3X Edit: Temporary Solution

The issue is caused by waifu2x-caffe not having sufficient memory. A temporary solution to this problem is to reduce the number of threads used.

Original Issue

Hi, the program failed and I am having the following exception when I use --gpu to enlarge.
I believe my machine has enough memory to run it.
It there any way to fix it?
Many thanks. This is a useful program.

[+] INFO: Reading video information
[+] INFO: Framerate: 59.94005994005994
[+] INFO: Starting to upscale extracted images
2018-12-16 22:27:58.707744 [+] INFO: [upscaler] Thread 3 started
2018-12-16 22:27:58.707744 [+] INFO: [upscaler] Thread 4 started
2018-12-16 22:27:58.708742 [+] INFO: [upscaler] Thread 0 started
2018-12-16 22:27:58.708742 [+] INFO: [upscaler] Thread 1 started
2018-12-16 22:27:58.709739 [+] INFO: [upscaler] Thread 2 started
Could not create log file: File exists
COULD NOT CREATE LOGFILE '20181216-222802.16176'!
F1216 22:28:02.183454 12168 syncedmem.cpp:78] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
Could not create log file: File exists
COULD NOT CREATE LOGFILE '20181216-222802.15444'!
F1216 22:28:02.189438 10304 syncedmem.cpp:78] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
Could not create log file: File exists
COULD NOT CREATE LOGFILE '20181216-222802.17140'!
F1216 22:28:02.238307  1736 syncedmem.cpp:78] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
Could not create log file: File exists
COULD NOT CREATE LOGFILE '20181216-222802.22424'!
F1216 22:28:02.290169 10188 syncedmem.cpp:71] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
Could not create log file: File exists
COULD NOT CREATE LOGFILE '20181216-222803.18460'!
F1216 22:28:03.546811  1888 syncedmem.cpp:71] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
2018-12-16 22:28:03.889894 [+] INFO: [upscaler] Thread 2 exiting
2018-12-16 22:28:04.882241 [+] INFO: [upscaler] Thread 1 exiting
2018-12-16 22:28:04.925128 [+] INFO: [upscaler] Thread 0 exiting
2018-12-16 22:28:04.962030 [+] INFO: [upscaler] Thread 4 exiting
2018-12-16 22:28:05.021869 [+] INFO: [upscaler] Thread 3 exiting
[+] INFO: Upscaling completed

Typos and Additional Options

In README.md, it says: "You can also change FOLDERIN and FOLDERIN if you want." Shouldn't one of those be FOLDEROUT or something?
Also, shouldn't there be an option to choose which video filtering process you want to use? Like using upconv_7_anime_style_art_rgb, upconv_7_photo, anime_style_art_rgb, photo, or anime_style_art_y instead of just photo? I guess I could edit the .py files to use the appropriate filter, but it would be easier if it was a command line option.
And if your graphics card supports cuDNN and you have support for it installed, can you use that option at the end by writing --cudnn instead of --gpu? I assume you can, but the readme did not specify that option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.