This image has been used for the paper: https://link.springer.com/article/10.3758/s13428-025-02816-xâ (free access to the pdf: https://rdcu.be/eFwacâ ) The Dockerfile can be found in the osf repository: https://osf.io/gy98b/â
The host computer must have the appropriate packages installed to allow GPUs to be used by the Docker containers, e.g., for Nvidia GPUs, it requires to install the Nvidia container toolkit: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.htmlâ â
All ready-to-use Docker containers (including this one), are constrained to the dependencies software versions they had when built. The main cause for compatibility issues and the container not working properly comes from the graphic card and the versions of CUDA/cudnn/Pytorch. In particular, any recent enough GPU that is not handled by the pre-installed version would lead to errors, or the images/videos not being processed. In such a case, the fix is to use the Dockerfile shared on our osf and modify the appropriate lines to use versions of the software. For example, using an Nvidia GPU RTX A4000 or A5000 requires to modify the Dockerfile to use CUDA version 11.3, and cudnn 8; then to rebuild a docker container using the updated Dockerfile.
Dockerfile based on the official Dockerfile from August 2022 https://github.com/facebookresearch/detectron2/tree/main/dockerâ
sudo docker build --build-arg USER_ID=$UID -t detectron2:paper .
Default command:
sudo docker run --rm --gpus all -it -e="DISPLAY" -v=/tmp/.X11-unix:/tmp/.X11-unix:rw -v /home/$user:/home/$user detectron2:paper /bin/bash
Replace $user by the session's username.
Add -v /media:/media to give access to external hard drives
If needed, limit the amount of RAM shared with docker with the parameter:
--shm-size=8gb
Replace $data_path by the path to the data folder and $result_path by the path to the result folder
Warning: the folder to which the --output and --export are written must exist.
Add --output $result_path/detectron2/vis to save the images with the keypoints and skeleton on top. Necessitate to create the folder. Be careful that it should be added right after python demo/demo.py, if added at the end, detectron2 will throw an error.
Memory profiling can be done by adding the following command before the processing commands described below:
mprof run --include-children --multiprocess --output $result_path/detectron2/mprofile.dat
.png images in a folder inside the Docker without visualizating resultspython demo/demo.py --config-file configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml --input $data_path/images/*.png --export $result_path/detectron2/keypoints_coco17 --opts MODEL.WEIGHTS models/model_final_a6e10b.pkl
change .png for other formats if needed.
python demo/demo.py --config-file configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml --video-input $data_path/$video --export $result_path/detectron2/keypoints_coco17 --opts MODEL.WEIGHTS models/model_final_a6e10b.pkl
Replace $video by the name of the video.
To avoid potential changes or unavailability of the file, and ensure reproduction of results the model weights were downloaded on 2023.01.11 from
https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x/137849621/model_final_a6e10b.pkl as file model_final_a6e10b.pkl, added to the gitlab repository, and the local version is used to run Detectron2, rather than being always downloaded from facebook servers.
Based on the official files available here on August 2022: https://github.com/facebookresearch/detectron2/tree/main/demoâ On demo.py:
Content type
Image
Digest
sha256:c152bf183âŚ
Size
9 GB
Last updated
almost 3 years ago
docker pull humanoidsctu/detectron2:paper