3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

waifu2x を OSX で動かしたメモ

Last updated at Posted at 2015-06-13

いまさら waifu2x に参戦。まだ OSX 版のバイナリはないみたいなんで自分でビルドしよう。
本家ではなく OpenCV を使う http://github.com/WL-Amigo/waifu2x-converter-cpp を使います。

brew tap homebrew/science
brew install homebrew/science/opencv3 --without-tests --without-numpy --without-python
git clone http://github.com/WL-Amigo/waifu2x-converter-cpp
cd waifu2x-converter-cpp
vi Makefile # 下の makefile を持ってくる
make
OPENCV=/usr/local/opt/opencv3

CXX=clang++
CXXFLAGS=-I$(OPENCV)/include -I$(CURDIR)/include -I./include -std=c++11 -pthread -Wall
LDFLAGS=-L$(OPENCV)/lib -pthread -Wl,-rpath,$(OPENCV)/lib
LDLIBS=-lopencv_core -lopencv_imgproc -lopencv_imgcodecs -lopencv_features2d

waifu2x-converter-cpp: src/main.o src/modelHandler.o src/convertRoutine.cpp
        $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)

clean:
        rm */*.o%

w_o さんの Makefile を参考にした https://github.com/tanakamura/waifu2x-converter-cpp/blob/master/Makefile

動くけどCUDA版を使ったことないので早いのか遅いのすらわからない…。

OSXのOpenCLで動かすところまではやりたい。

追記: w_o さんの OpenCL 版まで動かした

さすがにかなり変更したのでgithubにあげた。

バイナリもあげたぞい。
threadPool の移植を諦めてるのでマルチスレッドになっておらず遅いはず。
OSXで OpenMPって簡単に使えるんだっけ…

3
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?