diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..19f5ec24 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/docs/getting_started.md b/docs/getting_started.md index 325bbdd8..22a4260b 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -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) @@ -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 diff --git a/docs/install_by_docker.md b/docs/install_by_docker.md new file mode 100644 index 00000000..11934199 --- /dev/null +++ b/docs/install_by_docker.md @@ -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 +```