From 4e5112d91cf9808a5c01fc43809344c2c7aae746 Mon Sep 17 00:00:00 2001 From: caxapexac Date: Wed, 4 Mar 2020 16:26:37 +0300 Subject: [PATCH] Installation guide Added support for multiple download_trained_model.sh launch Added installation guide --- .gitignore | 1 + README.md | 30 +++++++++++++++++++++++++++++- scripts/download_trained_model.sh | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e708e040 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +checkpoints/* diff --git a/README.md b/README.md index 54a16fea..12b5b900 100755 --- a/README.md +++ b/README.md @@ -33,14 +33,42 @@ This codebase provides: - PIL - skimage - tqdm +- numpy +- cv2 for training and data generation - [trimesh](https://trimsh.org/) with [pyembree](https://github.com/scopatz/pyembree) -- cv2 - [pyexr](https://github.com/tvogels/pyexr) - PyOpenGL - freeglut (use `sudo apt-get install freeglut3-dev` for ubuntu users) +## Windows demo installation instuction + +- Install [miniconda](https://docs.conda.io/en/latest/miniconda.html) +- Add `conda` to PATH +- Install [git bash](https://git-scm.com/downloads) +- Launch `Git\bin\bash.exe` +- `eval "$(conda shell.bash hook)"` then `conda activate my_env` because of [this](https://github.com/conda/conda-build/issues/3371) +- Automatic `env create -f environment.yml` (look [this](https://github.com/conda/conda/issues/3417)) +- OR manually setup [environment](https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533) + - `conda create —name pifu python` where `pifu` is name of your environment + - `conda activate` + - `conda install pytorch torchvision cudatoolkit=10.1 -c pytorch` + - `conda install pillow` + - `conda install scikit-image` + - `conda install tqdm` + - `conda install -c menpo opencv` +- Download [wget.exe](https://eternallybored.org/misc/wget/) +- Place it into `Git\mingw64\bin` +- `sh ./scripts/download_trained_model.sh` +- Remove background from your image ([this](https://www.remove.bg/), for example) +- Create black-white mask .png +- Replace original from sample_images/ +- Try it out - `sh ./scripts/test.sh` +- Download [Meshlab](http://www.meshlab.net/) because of [this](https://github.com/shunsukesaito/PIFu/issues/1) +- Open .obj file in Meshlab + + ## Demo Warning: The released model is trained with mostly upright standing scans with weak perspectie projection and the pitch angle of 0 degree. Reconstruction quality may degrade for images highly deviated from trainining data. 1. run the following script to download the pretrained models from the following link and copy them under `./PIFu/checkpoints/`. diff --git a/scripts/download_trained_model.sh b/scripts/download_trained_model.sh index c86a2845..c652f2c6 100755 --- a/scripts/download_trained_model.sh +++ b/scripts/download_trained_model.sh @@ -1,6 +1,6 @@ set -ex -mkdir checkpoints +mkdir -p checkpoints cd checkpoints wget "https://drive.google.com/uc?export=download&id=1zEmVXG2VHy0MMzngcRshB4D8Sr_oLHsm" -O net_G wget "https://drive.google.com/uc?export=download&id=1V83B6GDIjYMfHdpg-KcCSAPgHxpafHgd" -O net_C