Giter Club home page Giter Club logo

waifu2x-mac's Introduction

Waifu2x-mac

CI

Waifu2x port to macOS, also in Core ML and Metal. For other details please refer to waifu2x-ios.

Project Status

I can't believe this really happened:

My update to the "waifu magnifier" on macOS just got rejected. I admit that it's my fault that I never appealed the so-called "Waifu2x" app which pirated my code in this repo to Apple.

I was still updating this project since that person pirated my code back in 2018. All of this suddenly becomes a joke now.

I am extremely upset about all of this. So I decided to completely abandon this project.

You can still download past releases and send PRs for improvements. But don't expect any update from me in the future.

Update (2021-10-28): The developer of "WaiFu2x" responded to my complaint through Apple. They have removed their App from the App Store and released the name. After calming down I have re-considered the future of this project. It was a huge mistake that I chose MIT as license. I'll still work on this in the future, but all newer changes will be released under a more strict license.

About waifu2x on the Mac App Store

The app waifu2x on the MAS is based on waifu2x-ios instead of this project. It runs through Mac Catalyst.

Disclaimer

I haven't published an app based on this project to the Mac App Store. If any app appears on the store that looks like this project, it has nothing to do with me.

Requirements

  • macOS 10.13+ (Running)
  • Xcode 11.1+ (Building)

Download

Note that all pre-built binaries are not signed. You can either sign them yourself or go to system settings to bypass the signature check.

From Releases

Go to Releases to get pre-built binaries. Not all release versions contain both GUI and CLI.

From GitHub Actions

Go to Actions to fetch the latest build for both GUI and CLI. They will be removed automatically 90 days after being built.

Homebrew (Experimental, CLI only)

If you want to install with homebrew:

brew install imxieyi/waifu2x/waifu2x

It downloads pre-built binary from releases. Xcode is not needed.

Compilation Instructions

Option A (automatic):

  1. Open the Terminal (⌘+Space, "terminal")
  2. Drag build.sh from Finder to the Terminal window, and press Return to start building the app.
    All missing dependencies (including Xcode) will be installed automatically by the script if needed.
  3. Once the build has completed, the waifu2x-mac-app application can be found in the build folder.

Option B (manual):

  1. Build using waifu2x-mac-app scheme
  2. To locate the built macOS app, expand the Products folder on Project Navigator (left pane) and right click on waifu2x-mac-app.app to select Show in Finder

Installing the App and CLI Version

The app can be dragged to any location you choose, such as /Applications.

If you would like to use the CLI version, right click on the app and select Show Package Contents. Navigate to Contents/MacOS. The CLI version is waifu2x.

If you would like to run the program anywhere, you must create a symbolic link by typing ln -s /path/to/waifu2x /usr/local/bin/waifu2x in a terminal. You can also drag the waifu2x executable after ln -s to get the file path in terminal automatically.

For example, if waifu2x-mac-app is in /Applications, you would run the following command to create a symlink:
ln -s /Applications/waifu2x-mac-app.app/Contents/MacOS/waifu2x /usr/local/bin/waifu2x

N.B.: You can not drag the CLI executable out and use it directly as it will not work. You must create a symbolic link as shown above if you want to use it without going into the waifu2x-mac-app.app directory.
Additionally the symbolic link will break if you move the macOS app. You can delete the old symlink with unlink /usr/local/bin/waifu2x and run ln -s again to create a new one.

Command-Line Usage

Usage: waifu2x [options]
    -t, --type:
        Image type - a for anime (default), p for photo
    -s, --scale:
        Scale factor (1 or 2)
    -n, --noise:
        Denoise level (0-4)
    -i, --input:
        Input image file (any format as long as NSImage loads)
    -o, --output:
        Output image file (png)
    -h, --help:
        Print usage

WARNING: The CLI version is not a self-contained executable. waifu2x must remain in the same directory as CommandLineKit.framework and waifu2x_mac.framework.

waifu2x-mac's People

Contributors

chargeflux avatar guimondmm avatar imxieyi 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

waifu2x-mac's Issues

TIFF Support?

The iOS app supports importing TIFF images (and then turning them into PNG) but on the Mac side, there's no support whatsoever. I was wondering if we could see support for 16-bit TIFF images as import and export options.

Build failed and Xcode error

Hi, thank you for upload the waifu app for Mac user...but I have some problems with it :( I tried to build it and it failed, also when I used the Xcode, the app wouldn't build and I keep getting the error messages..please help me :'( Thank you

Build failed:
Screen Shot 2020-10-20 at 12 07 12 PM

Xcode error:
Screen Shot 2020-10-20 at 12 30 03 PM

1.5 Upscale Factor?

Hi! I was wondering if it's possible to do a 1.5 upscale factor, instead of the currently available 1.0 and 2.0?

TTA support?

Hello. Is there TTA (test-time augmentation) support in the MacOS version already? I'm using the CLI version primarily, but I'm unsure if TTA is enabled by default or not at all. If they aren't features, could they be implemented? Thank you for this excellent GUI and CLI versions for Mac. You are a life-saver!

Bit-depth support?

Is there going to be a feature in the future to support more than 24-bit png? I would like to feed it 32-bit images and have the bit depth retained.

Update the linking of CLI version

Hi,

I believe I figured out how to bundle the CLI version with the app itself such if you go into waifu2x-mac-app.app/Contents/MacOS, you can choose to launch waifu2x-mac-app which is the GUI or waifu2x which is the CLI version. This ensures that the CLI version and GUI version are packaged together and the CLI doesn't need to be in the same directory as the frameworks.

I can submit a PR for these changes. It involves copying CommandLineKit to the Frameworks directory of the .app directory and adding a search path for the CLI version to reference that.

I also disabled installing the CLI version to /usr/local/bin and making sure the CLI version is only inside the App bundle since the executable in /usr/local/bin will fail because of missing frameworks.

Can't compile application with build.sh OR Xcode

Hey there! Trying to compile this myself, it won't work no matter what I do.

Attempting to compile in Xcode gives me this error inside of the Waifu2x.swift file:
Waifu2x.swift:203:9 The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

Attempting to compile using the build.sh file in terminal gives:
image

I'm not sure what I'm doing wrong here, but nevertheless it isn't compiling.

Thanks!

Upscale not working - segmentation fault & static results

Hi! The script was working fine since I first download but for some reason, it broke down today. I've attached the terminal messages and the upscale result too. It copies the original image to 4 horizontally and the rest is just fuzzy static.

I'm running on a MacBook Air with MacOS Catalina 10.15.6

Any help would be appreciated! :D

tilly@192-168-1-101 ~ % cd /Users/tilly/Downloads/Waifu2x 
tilly@192-168-1-101 Waifu2x % ./waifu.sh
"With Alpha: false"
"Really With Alpha: false"
./waifu.sh: line 8:  1078 Segmentation fault: 11  ./waifu2x -n 1 -s 2 -i "$source" -o "$outputpng"
"With Alpha: false"
"Really With Alpha: false"
./waifu.sh: line 8:  1079 Segmentation fault: 11  ./waifu2x -n 1 -s 2 -i "$source" -o "$outputpng"
"With Alpha: false"
"Really With Alpha: false"
"With Alpha: false"
"Really With Alpha: false"

Screenshot 2020-10-13 at 7 37 40 pm

Only the iGPU is used

Despite the Automatic graphics switching being disabled, only the UHD 630 iGPU resource on my MBP is being used, while the 560X usage stays at 0%. App compiled on Xcode 10.1. Is there any code/Xcode change necessary in order to enable the 560X usage?

Bulk conversions and remembering subfolders

This offshoot is missing several significant features compared to Waifu2x-Extension-GUI, with two glaring examples. One, it can't do bulk conversions or convert multiple files in a folder at once. Two, it does not remember subfolders, e.g. consistently stay where to pick files and where to save them. It all makes converting more than a couple of images extremely tedious especially compared to Windows programs. Why exactly is there no bulk conversion and is there any chance the folders where files are picked and saved can stay the same over different file conversions? It would be nice if the CLI could do bulk conversions with a wildcard (e.g. waifu2x -i /Users/Me/Downloads/Pictures/.jpg -o /Users/Me/Pictures/.png) which would render the other issue moot. I don't know what it means but currently doing this in the CLI outputs "With Alpha: False /n Really With Alpha: False."

Outputting Blank Images

I did ../waifu2x-mac-cli/waifu2x -t a -s 2 -n 2 -i "$file" -o "output/$file" to upscale some files, but it outputs a blank image at output/$file.

2018-06-23 10:18:15.601 waifu2x[82288:1013507] Maximum texture size supported: 16384
"With Alpha: true"
"Really With Alpha: true"

I tried other image files (jpeg) and they work great, but there seems to be an issue either with transparency or file size. The exact images I was upscaling can be found here: https://drive.google.com/drive/folders/1Ok9QfoeLz0XKYUBOHC5aVq4JWXhzyCas

Vapoursynth plugin

Could you possibly make a Vapoursynth plugin that is mac compatible using metal so this could be added to workflow scripts of animation videos.

Rather than a stand alone app or cli?

Multi-threading option?

I tried to use the CLI version and it has great speed.
But it uses only single thread.
ActivityMonitor.app shows it uses only 100% (other multi thread app uses 400 - 800% to conversion)
so I wander it has -j option (it uses for multi threading option at other waifu2x) to be more speed.

Unfortunately, Idk about the Metal and CoreML feature than you.
If you don't annoy with this order, please add new feature for choosing multithread.

Thank you for your great job 👍

CLI version

Hi! I was wonder if it is possible for you to make a CLI version of Waifu2x-mac because it would help with batch-processing. From looking at the code for the GUI, you call the function Waifu2x with the arguments 'img' and a predefined model when pressing the Process button. Unfortunately that is the extent of what I know about Swift and don't have the knowledge to make it into a CLI program.

I hope you can consider it or point me to how I could do it on my own. When I compiled Waifu2x_mac, I do get a UNIX executable in the framework but you can't run it from Terminal so that is probably not what is intended for.

Thanks!

If it will have an instrument panel, it would be fine.

I can't control the parameters and noise reduction of the amplification, and even which training model it uses is not clear.

There is also a small problem. Under 10.14, I can't see it working or occupying system resources in the istar menu.

Input and output arguments for the CLI version

Hi. Will you consider these possible improvements on the command-line arguments?

  • Remove the -i prefix for the input
  • Accept standard input and output (stdin & stdout)
  • Default output path (add a suffix -waifu2x.png, etc.)
  • Default values for scaling and denoise (-s 2 -n 1 for myself)
  • 1.6× scale in the original waifu2x

Stuck at generating

Not sure what is special about my setup, but I get stuck at "Generating" almost 100% of the time in the GUI. The models I have been trying to use are REAL-ESRGAN and REAL-CUGAN, and targeting 2x scaling.

Using the CLI I have never seen any lockup, an upscaled videos are processed correctly. My only issues are when using the GUI.

System is Mac Studio running Monterey 12.3, with M1 Max and 32GB of memory.

If there are any useful logs generated I am happy to include them here, because the GUI path is a very reliable failure for me.

dyld: Library not loaded: @rpath/libswiftCore.dylib

After a brew install on High Sierra v10.13.6 I'm finding a library that isn't linked, as per the title

λ MBP ~ → waifu2x --help                      
dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /usr/local/bin/waifu2x
  Reason: image not found
[1]    93255 abort      waifu2x --help
λ MBP ~ → xcode-select -v    
xcode-select version 2349.

It always build failed.

After the first build, I seem to have deleted the build folder by mistake(Combined with 2# floor, I seem to have never built successfully). I want to use build.sh to build again, but after dragging build.sh to Terminal, it always only executes the last operation to delete all files.
WX20200923-142310@2x

How to use build.sh to rebuild APP?

Utilize GPU in the prediction phase

Hi, it seems that this app only utilizes Apple Neural Engine, while leaving all GPUs unused in the prediction phase.

Since all m1 processors have the same amount of neural engines, using M1 Max will not make this program any faster. Is it possible to use all GPUs to accelerate the predicting phase?

Thanks.

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.