딥러닝 모델 환경 구축하기

석준·2023년 9월 3일
0

캡스톤디자인

목록 보기
7/9

Ubuntu 18.04.5 LTS 버전에서 이미지 변환 모델 AnimeGANv2CartoonGan을 구동하기 위해 개발 환경을 구축해 보자


아나콘다 설치

1. 설치 파일 다운

https://repo.anaconda.com/archive/.winzip/

// 예시
$ wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh

2. 설치 파일 실행

// 예시
$ bash Anaconda3-2019.10-Linux-x86_64.sh

3. bashrc 실행

$ source ~/.bashrc

4. 아나콘다 업그레이드

(base) $ conda update conda
(base) $ conda update anaconda

AnimeGANv2 환경 구축

https://github.com/TachibanaYoshino/AnimeGANv2

요구사항

  • python 3.6
  • tensorflow-gpu 1.15.0 (GPU 2080Ti, cuda 10.0.130, cudnn 7.6.0)
  • opencv
  • tqdm
  • numpy
  • glob
  • argparse

1. 작업 공간 생성

(base) $ conda create -n anigan python=3.6
(base) $ conda activate anigan

2. 파이썬 pip 업그레이드

(anigan) $ python -m pip install --upgrade pip

3. AnimeGANv2 가져오기

(anigan) $ git clone https://github.com/TachibanaYoshino/AnimeGANv2.git

4. 환경 설정

(anigan) $ cd ./AnimeGANv2
(anigan) $ pip install tensorflow-gpu==1.15
(anigan) $ pip install argparse
(anigan) $ conda install opencv
(anigan) $ conda install tqdm
(anigan) $ conda install glob2

5. 테스트

$ python test.py --checkpoint_dir checkpoint/generator_Hayao_weight --test_dir dataset/test/HR_photo --save_dir Hayao/HR_photo

CartoonGan 환경 구축

https://github.com/JSeokjun/CartoonGan-tensorflow

요구사항

  • Python 3.6
  • TensorFlow 2.0 Alpha
  • tqdm
  • imageio
  • tb-nightly

1. 작업 공간 생성

(base) $ conda create -n cartgan python=3.6
(base) $ conda activate cartgan

2. 파이썬 pip 업그레이드

(cartgan) $ python -m pip install --upgrade pip

3. CartoonGan 가져오기

(cartgan) $ git clone https://github.com/mnicnc404/CartoonGan-tensorflow.git

4. 환경 설정

(cartgan) $ cd ./CartoonGan-tensorflow
(cartgan) $ pip install tensorflow==2.0
(cartgan) $ conda install tqdm
(cartgan) $ pip install imageio
(cartgan) $ pip install tb-nightly

5. 테스트

$ python cartoonize.py --input_dir input_images --output_dir output_images --styles shinkai hayao --comparison_view horizontal

참고 문헌

담비와시작하는머신러닝. (2020, February 3). [ Anaconda ] 아나콘다 설치 방법 및 기초 사용법 ( Linux ). Retrieved 23:49, September 4, 2023, from https://dambi-ml.tistory.com/6

목포대학교 컴퓨터공학과 손현승 교수. (2022, November 3). Deep Leaning + Animation. Retrieved 23:51, September 4, 2023, from https://dream.mokpo.ac.kr/bbs/ce/614/192100/download.do

profile
ERICA SW 19

0개의 댓글