본문 바로가기
연구/머신러닝

DensePose 테스트

by 디어솔 2018. 7. 22.
반응형

HRI 연구에도 도움이 될만한 자료여서 테스트 해보기 시작했다. 시작할 땐 이렇게 오래걸릴거라곤 꿈에도 몰랐지..


먼저 환경은 다음과 같다.

OS: Ubuntu 16.04 64bit

GPU: Nvidia GeForce GTX 1080Ti


아래는 설치 순서이다. 내가 지금 쓰는 환경에 맞춘것이어서 버전 달라지면 또 모른다...


1. Upgrade and update Ubuntu

$ sudo apt-get update

$ sudo apt-get upgrade


2. Install Nvidia graphic driver

$ sudo add-apt-repository ppa:graphics-derivers/ppa

$ sudo apt-get update

$ sudo apt-get install nvidia-396


3. Install Anaconda2

download: https://www.anaconda.com/download/#linux

$ bash Anaconda-latest-Linux-x86_64.sh

$ source /home/[user name]/.bashrc


4. Install CUDA9.2

download: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=runfilelocal

$ sudo sh cuda_9.2.148_396.37_linux.run

*DO NOT INSTALL NVIDIA DRIVER DURING INSTALLATION


5. Test CUDA samples

build the sample files: $ make

test files


6. Install cuDNN v7.1.4 for CUDA 9.2

download runtime library, developer library, code samples and user guide (Deb): https://developer.nvidia.com/rdp/cudnn-download

install runtime library: $ sudo dpkg -i libcudnn7_7.1.4.18-1+cuda9.2_amd64.deb

install developer library: $ sudo dpkg -i libcudnn7-dev_7.1.4.18-1+cuda9.2_amd64.deb

install code samples and user guide: $ sudo dpkg -i libcudnn7-doc_7.1.4.18-1+cuda9.2_amd64.deb


7. Install Caffe2 from source

refer this link: https://caffe2.ai/docs/getting-started.html?configuration=compile

1) Install Dependencies

2) Install msgpack and argparse

3) Download pytorch: https://github.com/pytorch/pytorch

4) $ cd pytorch

5) $ git submodule update --init

6) $ mkdir build && cd build

7) $ cmake ..

8) $ sudo make install

9) set PYTHONPATH and LD_LIBRARY_PATH

$ sudo gedit ~/.bashrc

export PYTHONPATH=/usr/local
export PYTHONPATH=$PYTHONPATH:/home/ys/pytorch/build
export PYTHONPATH=$PYTHONPATH:/home/ys/pytorch/caffe2
export PYTHONPATH=$PYTHONPATH:/home/ys/pytorch/caffe2/build
export LD_LIBRARY_PATH=/usr/local/lib

10)  reboot the system and test installation


8. Follow instructions (https://github.com/facebookresearch/DensePose/blob/master/INSTALL.md)

Install COCO API

1) $ git clone https://github.com/cocodataset/cocoapi.git $COCOAPI

2) $ cd cocoapi

3) $ make install

4) $python2 setup.py install --user

Download Densepose

1) $ git clone https://github.com/facebookresearch/densepose $DENSEPOSE

2) $ pip install -r densepose/requirements.txt

3) $ cd densepose && make

4) $ python2 $DENSEPOSE/detectron/tests/test_spatial_narrow_as_op.py
5) $ cd $DENSEPOSE && make ops
6) $ python2 $DENSEPOSE/detectron/tests/test_zero_even_op.py

Fetch densepose data

1) $ cd $DENSEPOSE/DensePoseData
2) $ bash get_densepose_uv.sh
3) $ bash get_DensePose_COCO.sh
4) $ bash get_eval_data.sh

Set the coco dataset

download coco dataset: http://cocodataset.org/#download


9. Test files

$ jupyter notebook

see notebooks/*.ipynb




끝!


댓글