neural-style install

1. torch 설치 :

# in a terminal, run the commands
cd ~/
git clone https://github.com/torch/distro.git ~/torch --recursive
sudo apt-get install libreadline-dev libjpeg-dev cmake git
cd ~/torch; ./install.sh



2.  loadcaffe 설치 :

좀 복잡한 부분이라 저도 정확이 이해는 못하고 있지만, neural-style은 caffe에서 학습시킨 VGG_ILSVRC_19_layers란 네트워크 모델을 가져다 쓴답니다. 이걸 쓰기 위해서는 우선 

sudo apt-get install libprotobuf-dev protobuf-compiler

명령으로 구글의 '프로토콜 버퍼' 라이브러리를 깔아주고,

luarocks install loadcaffe



3. neural-style 설치 :

설치할 폴더에서,


설치라기 보다 카피이지요.

cd neural-style
sh models/download_models.sh

해 주시면 실제로 쓸 caffemodel파일을 다운로드 해 옵니다.

모델파일이 다운로드 됐으면 이제 토치를 써 볼 수 있지요.

---------------------------------------------------------------------------------


5. run
 
토치를 실행시키는 명령인 'th'로 뉴럴스타일 'neural-style.lua'를 돌려봅니다.

th neural_style.lua -gpu -1 -print_iter -1

제대로 다 설치가 됐으면 :

Successfully loaded models/VGG_ILSVRC_19_layers.caffemodel
conv1_1: 64 3 3 3
conv1_2: 64 64 3 3
...
...

이렇게 나와야 하구요.

실제로 내 그림을 가지고, 아무 옵션없이 디폴트로 돌려 보려면 :

th neural_style.lua -style_image <image.jpg> -content_image <image.jpg>

댓글

  1. 1. torch 설치 :

    # in a terminal, run the commands
    cd ~/
    curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
    git clone https://github.com/torch/distro.git ~/torch --recursive
    [ sudo apt-get install libreadline-dev libjpeg-dev cmake git ]
    cd ~/torch; ./install.sh

    답글삭제
  2. telnet towel.blinkenlights.nl

    스타워즈 1편을 터미널로 보기

    답글삭제
  3. apt-get install sl

    sl

    기차 지나가기

    답글삭제
  4. apt-get install fortune

    fortune

    명사들의 명언, 오늘의 운세

    답글삭제
  5. root@tecmint:~# rev
    123abc
    cba321
    xuniL eb ot nrob
    born to be Linux

    답글삭제
  6. factor 1101
    1101: 3 367

    소인수 분해

    답글삭제
  7. 터미널에서 클립보드로

    $ cat ~/Desktop/ded.html | pbcopy

    Now that file is in the clipboard.

    To put it somewhere else, that is, to paste it, do:

    $ pbpaste > ~/Documents/ded.html

    답글삭제
  8. 이전에 작업하던 디렉토리로 이동하기

    $ cd -

    or

    $ cd $OLD_PWD

    답글삭제
  9. 파일 크기로 찾기: 보다 큰거 모두 찾기

    $ find ~/ -size +1024k

    답글삭제
  10. 하드웨어 목록 표시

    $ sudo lshw

    답글삭제
  11. 스토리지 목록 보여주기

    $ sudo fdisk -l

    답글삭제

댓글 쓰기

이 블로그의 인기 게시물

파이썬으로 Homomorphic Filtering 하기

파이썬으로 2D FFT/iFFT 하기: numpy 버전