waifu2x-caffe Documentation

repository·master·Indexed 26 days ago

https://github.com/lltcggie/waifu2x-caffe

A Windows-optimized implementation of the waifu2x image upscaling and noise reduction algorithm using the Caffe framework. It features a GUI and a CLI tool (waifu2x-caffe-cui.exe) for processing 2D illustrations and photos with NVIDIA GPU acceleration via CUDA/cuDNN or CPU mode. The software supports various models including RGB, Photo, UpRGB, UpPhoto, Y, UpResNet10, and CUnet, and provides detailed controls for split size, batch size, and Test-Time Augmentation (TTA).

Tokens
10K
Snippets
7
Records
59
Agent score
78%

What's inside waifu2x-caffe

  1. Use the waifu2x-caffe-cui.exe CLI tool

    master

    The waifu2x-caffe-cui.exe is the command-line interface (CUI) version of the tool. You can use it to perform batch image conversions via a command prompt.

    To view all available commands and help information, run:

    waifu2x-caffe-cui.exe --help

    An example command for converting a single image with specific noise reduction and scaling settings:

    waifu2x-caffe-cui.exe -i mywaifu.png -m noise_scale --scale_ratio 1.6 --noise_level 2

    Note: The output filename is automatically generated based on the model, mode, noise level, and magnification ratio used.

    waifu2x-caffe-cui.exe -i mywaifu.png -m noise_scale --scale_ratio 1.6 --noise_level 2
  2. Optimize performance using Division Size (crop_size)

    master

    The software divides images into pieces of a specific size (crop_size) for processing.

    To optimize speed:

    1. Monitor GPU Load: Use tools like GPU-Z to check GPU usage and VRAM. If GPU usage is low, increase the crop_size.
    2. Use Divisors: Setting the crop_size to a divisor of the image's width and height reduces wasteful calculations and increases speed.
    3. Memory Caution: Doubling the crop_size can theoretically increase memory usage by up to 4x. Be careful not to exceed your VRAM, especially when using CUDA.
  3. Configure Operation Settings in waifu2x-caffe

    master
    The Operation Settings (動作設定) allow you to control how the application behaves during file input, processing, and output. These settings are typically used to automate workflows or select hardware acceleration.
  4. System Requirements for waifu2x-caffe

    master

    To run waifu2x-caffe on Windows, ensure your system meets the following requirements:

    • OS: Windows Vista or later (64-bit only; no 32-bit version available).
    • Memory: At least 1GB of available RAM (requirement varies based on image size).
    • GPU: NVIDIA GPU with Compute Capability 3.5 or higher (required for CUDA/cuDNN acceleration; CPU mode is available but slower).
    • Prerequisite: Microsoft Visual C++ 2015 Redistributable Package Update 3 (x64) must be installed.

    You can download the required redistributable from the Microsoft website (look for vcredist_x64.exe).

  5. Add new languages to waifu2x-caffe

    master

    Language files use the JSON format. To add a new language:

    1. Create a new JSON language file.
    2. Register the language in lang/LangList.txt using the TSV (Tab-Separated Values) format with the following columns:
      • LangName: Language name
      • LangID: Primary language (MSDN ID)
      • SubLangID: Sublanguage (MSDN ID)
      • FileName: The name of the JSON language file.

    Example entry for Japanese: Japanese 0x11 0x01 filename.json

  6. Install and setup waifu2x-caffe

    master

    To run waifu2x-caffe on Windows, ensure your environment meets the following requirements:

    • OS: Windows Vista or later (64-bit only).
    • Memory: At least 1GB of free memory (more may be required depending on image size).
    • GPU: NVIDIA GPU with Compute Capability 3.5 or higher for hardware acceleration.
    • Required Runtime: Microsoft Visual C++ 2015 Redistributable Package Update 3 (x64 version) must be installed.

    You can download the latest version from the releases page.

  7. Use the waifu2x-caffe-cui.exe CLI

    master

    The waifu2x-caffe-cui.exe is a command-line tool for image transformation. You can run it via Command Prompt.

    To view the help menu, use:

    waifu2x-caffe-cui.exe --help

    Example of a standard transformation command:

    waifu2x-caffe-cui.exe -i mywaifu.png -m noise_scale --scale_ratio 1.6 --noise_level 2

    This command will save the result as mywaifu(noise_scale)(Level2)(x1.600000).png in the same directory.

    waifu2x-caffe-cui.exe -i mywaifu.png -m noise_scale --scale_ratio 1.6 --noise_level 2
  8. Use the waifu2x-caffe GUI

    master

    The Waifu2x-caffe.exe provides a graphical interface for image conversion:

    1. Launch: Double-click the executable.
    2. Input: Drag and drop an image or a folder into the Input path field. If you drag a folder, the software will process files within that folder (and subfolders) based on the configured extensions.
    3. Output: The Output path is automatically set based on the input, but you can manually change it to a different destination.
    4. Batch Processing: You can drag multiple files or folders simultaneously. When multiple items are provided, the software maintains the folder structure in the output directory.
  9. Optimize performance using Split Size (crop_size)

    master

    The software processes images by splitting them into tiles of a specific size (crop_size).

    To improve speed:

    1. Increase crop_size: If your GPU usage is not near 100% during conversion, increasing this value can utilize more GPU power.
    2. Use divisors: Setting the split size to a divisor of the image's width/height (or a value that leaves minimal remainder) can reduce wasted computation and increase speed.
    3. Memory Caution: Doubling the crop_size theoretically increases memory usage by ~4x. Monitor VRAM usage (e.g., via GPU-Z) to prevent crashes, especially when using CUDA which consumes more memory than cuDNN.
  10. Configure Processing Speed and Memory Usage

    master

    Split Size (分割サイズ)

    Specifies the width (in pixels) used when dividing the image for internal processing.

    • Optimization: Choosing an optimal split size can significantly improve speed.
    • Memory Warning: If the split size is too large, the software may exceed available system memory or GPU VRAM and crash.
    • Model Sensitivity: Some models produce different results depending on the split size. If results change, use the default split size and adjust the Batch Size instead.

    Batch Size (バッチサイズ)

    Specifies the number of segments processed together. Increasing the batch size can improve processing speed, but like split size, it increases memory/VRAM consumption. Ensure it does not exceed your hardware limits.

  11. Configure Input and Output Paths

    master

    Input Path (入力パス)

    Specify the path for files to be converted.

    • Single File/Folder: Drag and drop a file or folder.
    • Multiple Files/Folders: Drag multiple items. The software will output them into a new folder while maintaining the original directory structure (indicated as (Multi Files) in the input field).
    • Subfolders: If a folder is specified, the software will process all files within that folder and its subfolders that match the specified extensions.

    Output Path (出力パス)

    Specify where to save the converted images. If a folder is provided as the input, the converted files will be saved into that folder while preserving the original directory structure. If the specified output folder does not exist, it will be created automatically.

    File Extensions

    • Extensions to convert in folder (フォルダ内の変換する拡張子): When the input is a folder, specify which extensions to process. The default is png:jpg:jpeg:tif:tiff:bmp:tga. Use a colon (:) as a delimiter. Case-insensitive.
    • Output Extension (出力拡張子): Specify the desired format for the converted image. The available options for quality and bit depth settings depend on this selection.