Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---What is Waifu2x?---
- https://github.com/nagadomi/waifu2x
- Waifu2x is a neural network based image upscaler for anime images. It is primarily designed to run on CUDA.
- The quality increase is practically unparalleled.
- Demonstration Image: https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png
- You can test it on images yourself at http://waifu2x.udp.jp/
- Most crucially, it's been ported to run on .avi videos, hence it can upscale anime to quality previously unavalible.
- ---What is this process for?---
- This process takes a .avi video and runs waifu2x on it to generate an unparalleled high quality upscale.
- Uncompressed .avi files have monsterously impractical file sizes (200gb per episode would be typical)
- Hence this process carries out a convulted system of encoding to generate very small file sizes for the quality of video.
- The audio gets split from the video by the process and then needs to be remerged.
- ---What is this process worth using on?---
- Anime where the best release avalible is DVD quality or equivalent or worse will see the most benefit from this process.
- Anime that already recieved a BD or HD quality release will recieve less benefit from this process (and take longer)
- Maybe there's someone out there with a fetish for UHD anime?
- ---Requirements---
- A .avi video
- An Nvidia GPU that can utilize CUDA
- A lot of time to set up all the programs you need.
- A lot of time (dependant upon GPU model) to process the video using waifu2x-w2xc (0.25fps on a GTX770 on DVD quality)
- Can be done without CUDA but expect ~0.02fps
- ---Step 1: Getting AviUtl---
- 1. Go to http://www.htasoft.com/aviutl/aviutl.htm for information
- 2. Download AviUtl here: http://spring-fragrance.mints.ne.jp/aviutl/
- 3. Download http://www.htasoft.com/aviutl/aviutlengsettings.zip and unzip it all into the AviUtl folder, replacing files
- 4. You now have an English-translated AviUtl
- ---Step 2: Getting waifu2x-w2xc plugin---
- 1. Go to https://github.com/YSRKEN/aviutl-waifu2x-w2xc and google translate it to read up on it
- 2. Ensure you have Visual C++ redistributable package 2013
- 3. Install by downloading the plugins folder and extracting it
- 4. The folder titled "plugins" needs to be within the AviUtl directory and contain both models_rgb folders and the .auf
- ---Step 3: Getting x264vfw---
- 1. This doesn't need an explanation: http://sourceforge.net/projects/x264vfw/
- ---Step 4: Getting Avi-Mux GUI---
- 1. This doesn't need an explanation: http://www.alexander-noe.com/video/amg/
- ---Step 5: Getting AviUtl-waifu2x-w2xc to happen---
- 1. Load up the target .avi
- 2. Under Filter select waifu2x-w2xc
- 3. Under settings select waifu2x-w2xc
- Explanation of next dialogue:
- Noise 0 is no noise reduction. Noise 1 is Normal noise reduction. Noise 2 is High noise reduction
- High noise reduction is most suited to JPEG, not to video. You may want to test all the settings to determine the best
- Scale 0 is no increase in resolution. Scale 1 is a 2x increase in resolution (what we want)
- Leave block on 128
- Have Use GPU ticked or you will die of old age before the video finishes processing
- Leave photography unticked
- 4. Close the dialogue
- You will get an error with different text depending upon whether you are using Japanese AppLocal
- Japanese: サイズが大きすぎます!
- English: ƒTƒCƒY‚ª‘å‚«‚·‚¬‚Ü‚·I
- This translates to "Size is too big".
- This means waifu2x-w2xc is increasing the resolution of the file beyond what AviUtl settings allow
- 5. File - General settings - system configuration
- 6. Set MAX picture size X and Y to double the resolution of the source AVI. Hit OK
- 7. Reboot AviUtl and reload the Avi. You are now good to go.
- ---Step 6: Exporting from AviUtl---
- 1. File -> Save Avi
- 2. Click "Video Codec"
- 3. From the dropdown select x264vfw - H.264/MPEG-4 AVC codec
- 4. Click "Configure"
- 5. Under Rate Control, set the Rate Factor to about 18.
- 6. Under Output, set output mode to File and select an output file location/name along the lines of AnimeEP01-Video.avi
- 7. Hit ok and ok again
- 8. Back in the main window for saving, use same location with file name along the lines of AnimeEp01-Audio.avi
- 9. MAKE SURE EVERYTHING YOU WANT IS SET UP CORRECTLY BEFORE CONTINUING BECAUSE YOU'RE IN FOR THE LONG HAUL NOW.
- 10. Click save and wait anywhere between several hours and several weeks (years if not using CUDA)
- 11. You now have a .avi file which has the audio but a blank video, and a .avi file with the video but no audio.
- ---Step 7: Remerging the audio and video---
- 1. Load up AVI-Mux GUI
- 2. Open both the audio and video files via drag and drop
- 3. Select each of the files in the program and click "Generate data source from files" (you need to do this 1 at a time)
- 4. In the lower GUI find the line that says something like "FourCC: x264 (unknown bitrate. 0.00kByte, 12:34:56.789
- 5. Untick the tick box next to that line
- 6. Click start to save the file, giving it whatever name you want
- 7. Save. This process is very quick compared to the previous step
- 8. You are done. Enjoy your extremely high quality anime
- ---Extra 1: waifu2x-w2xc in multiple stages---
- Leaving waifu2x-w2xc doing it's stuff in AviUtl for several days straight might not be the best idea.
- Any interuption to the process and you would have to start over
- Hence, it may be important to do the process in multiple stages.
- 1. Install AviDemux http://www.videohelp.com/software/AviDemux
- 2. Do the above process as normal until you reach Step 6
- 3. Get the total number of frames at the top (it looks like [1/34567] where the second number is total)
- 4. Split the number of frames into equalish sized segments (like 1 - 17283 and 17284-34567)
- 5. FOR EACH SEGMENT...
- Edit -> select processing range
- Enter the start and end frame of that segment and hit ok
- Do step 6 as per normal, giving each segment a different name
- 6. Carry out step 7 on every segment to create the merged segments
- 7. Boot up AviDemux
- 8. Open the FIRST merged segment
- 9. Use File -> Append to append the SECOND through LAST merged segment
- 10. File -> Save
- 11. You are done. Enjoy your extremely high quality anime
- ---Extra 2: Speeding shit up---
- This document should already have made it very clear how slow this process is
- Doing it on an entire anime series with typical hardware would take almost as long as it does for each episode to come out
- Hence you would need a dedicated CUDA / Neural Network rig to do serious, frequent releases at this quality
- https://timdettmers.wordpress.com/2014/08/14/which-gpu-for-deep-learning/ gives some advice on making that rig
- In short, you probably want the Titan X. I don't know if having multiple Titan X will speed up waifu2x further.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement