diff --git a/Dockerfile b/Dockerfile index eeabefa..a76374a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,19 @@ ENV BASE=/code/up-master RUN mkdir /code WORKDIR /code COPY deployment/requirements.txt . -RUN apt-get install realpath \ +RUN apt-get install -y realpath git \ && wget https://github.com/classner/up/archive/master.zip \ && unzip master.zip \ && rm master.zip WORKDIR ${BASE} - +COPY SMPL_python_v.1.0.0.zip . +COPY config.py . +RUN unzip SMPL_python_v.1.0.0.zip \ + && rm SMPL_python_v.1.0.0.zip # Install python packages RUN pip install -r ${BASE}/requirements.txt RUN pip install -r /code/requirements.txt +RUN pip install opendr # Adding Caffemodels ADD models/test2.caffemodel ${BASE}/pose/training/model/pose/ diff --git a/README.md b/README.md index 8c1a8d8..f2eb57b 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,18 @@ docker-compose run demo pose /input/zuck1.jpg ``` This will generate `.npz` and `.png` files in the `input` folder. + + +## Using nvidia-docker-compose +``` +pip install nvidia-docker-compose +# nvidia-docker-compose binary may not be in your path. On ubuntu, for my installation, it installed to /home/edward/.local/bin/. An Anaconda installation will have binaries in anaconda/bin. +nvidia-docker-compose build +``` + +Generate body fit: +``` +# Download SMPL_python_v.1.0.0.zip and place in the root directory of this repo on the docker host +nvidia-docker-compose build +nvidia-docker-compose run demo bodyfit /input/zuck1.jpg +``` diff --git a/config.py b/config.py new file mode 100644 index 0000000..ffd6bf6 --- /dev/null +++ b/config.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python2 +"""Configuration values for the project.""" +import os.path as path +import click + + +############################ EDIT HERE ######################################## +SMPL_FP = path.expanduser("/code/up-master/smpl") +DEEPLAB_BUILD_FP = path.expanduser("~/git/deeplab-public-ver2/build") +DEEPERCUT_CNN_BUILD_FP = path.expanduser("~/git/deepcut-cnn/build_cluster") +UP3D_FP = path.expanduser("~/datasets/up-3d") +SEG_DATA_FP = path.expanduser("~/datasets/seg_prepared") +POSE_DATA_FP = path.expanduser("~/datasets/pose_prepared") +DIRECT3D_DATA_FP = path.expanduser("~/datasets/2dto3d_prepared") + + +############################################################################### +# Infrastructure. Don't edit. # +############################################################################### + +@click.command() +@click.argument('key', type=click.STRING) +def cli(key): + """Print a config value to STDOUT.""" + if key in globals().keys(): + print globals()[key] + else: + raise Exception("Requested configuration value not available! " + "Available keys: " + + str([kval for kval in globals().keys() if kval.isupper()]) + + ".") + + +if __name__ == '__main__': + cli() # pylint: disable=no-value-for-parameter + diff --git a/deployment/docker-entrypoint.sh b/deployment/docker-entrypoint.sh index 937cb47..f4040f3 100644 --- a/deployment/docker-entrypoint.sh +++ b/deployment/docker-entrypoint.sh @@ -24,7 +24,7 @@ case "$1" in python pose/pose.py --use_cpu "${@:2}" ;; bodyfit) - echo "todo" + python 3dfit/bodyfit.py "${@:2}" ;; *) show_help