Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Add Dockerfile and instructions of installation by docker #350

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG PYTORCH="1.8.0"
ARG CUDA="11.1"
ARG CUDNN="8"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 8.0 8.6"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub

RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN conda install ffmpeg -y
RUN conda install -c fvcore -c iopath -c conda-forge fvcore iopath -y
RUN conda install -c bottler nvidiacub -y
RUN conda install pytorch3d -c pytorch3d -y
RUN pip install "mmcv-full>=1.3.17,<=1.5.3" -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
RUN pip install "mmdet<=2.25.1"
WORKDIR /
RUN git clone https://github.com/open-mmlab/mmhuman3d.git
WORKDIR /mmhuman3d
RUN pip install -v -e .

RUN pip install numpy==1.23
RUN pip install pillow==9.5
RUN pip install scipy==1.9.1
6 changes: 3 additions & 3 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- [Data Preparation](#data-preparation)
- [Body Model Preparation](#body-model-preparation)
- [Inference / Demo](#inference--demo)
- [Offline Demo](#Offline-Demo)
- [Online Demo](#Online-Demo)
- [Offline Demo](#offline-demo)
- [Online Demo](#online-demo)
- [Evaluation](#evaluation)
- [Evaluate with a single GPU / multiple GPUs](#evaluate-with-a-single-gpu--multiple-gpus)
- [Evaluate with slurm](#evaluate-with-slurm)
Expand All @@ -17,7 +17,7 @@

## Installation

Please refer to [install.md](./install.md) for installation.
Please refer to [install.md](./install.md) for installation or [install_by_docker.md](./install_by_docker.md) for installation through docker.

## Data Preparation

Expand Down
29 changes: 29 additions & 0 deletions docs/install_by_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Installation by Docker

After pull the image from [here](https://hub.docker.com/repository/docker/jacobbbbbb/mmhuman3d/general), simply run the following command:
```
docker run --gpus all --shm-size=64g -it -v {DATA_DIR}:/mmhuman3d/data mmhuman3d
```

We test this command on RTX 3090. Alternatively, you can build docker image based on your own GPU type by the following command with the provided Dockerfile:
```
docker image build -t mmhuman3d
```

Then run the command above. Note that inside the container, we donot provide data including body_models etc, please refer to [data_preparation](https://github.com/open-mmlab/mmhuman3d/blob/main/docs/preprocess_dataset.md) for preparation details.

After data prepared, this [demo command](https://github.com/open-mmlab/mmhuman3d/blob/main/docs/getting_started.md) can be a quick check:
```shell
python demo/estimate_smpl.py \
configs/hmr/resnet50_hmr_pw3d.py \
data/checkpoints/resnet50_hmr_pw3d.pth \
--single_person_demo \
--det_config demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
--det_checkpoint https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
--input_path demo/resources/single_person_demo.mp4 \
--show_path vis_results/single_person_demo.mp4 \
--output demo_result \
--smooth_type savgol \
--speed_up_type deciwatch \
--draw_bbox
```