diff --git a/.gitignore b/.gitignore index 56d5ac3..e6fa4b9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ exp/ detector/ out/ pretrained-models/ +.venv/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..bda292d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "alphapose-docker"] + path = alphapose-docker + url = https://git.rubenvandeven.com/security_vision/alphapose-docker diff --git a/README.md b/README.md new file mode 100644 index 0000000..f340b7a --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Looping Alphapose Training + +Pulling the traditional media art trick: can we loop the training of Alphapose? What if we train it on COCO data, run it on COCO images, train it on these results, run it on COCO images etc. ad inf.? + +## Installation + +```bash +poetry install +git submodule init +git submodule update +``` + +Then make sure alphapose-docker is set up: + +```bash +cd alphapose-docker +docker build --tag alphapose . +``` + +As mentioned in the README from [alphapose-docker](https://git.rubenvandeven.com/security_vision/alphapose-docker) it is necessary to download some external models before usage, as per [the AlphaPose installation guide](https://github.com/MVIG-SJTU/AlphaPose/blob/master/docs/INSTALL.md#models). + +1. YOLOv3 Object detector can be place in the `alphapose-docker/detector/yolo/data` repository. +2. (Optionally) YOLOX models go in the `alphapose-docker/detector/yolox/data` repository. +3. A pretrained AlphaPose model can be place in the `alphapose-docker/pretrained_models` directory. See their [Model Zoo](https://github.com/MVIG-SJTU/AlphaPose/blob/master/docs/MODEL_ZOO.md) for the various options. +4. For pose tracking, see the [pose tracking module](https://github.com/MVIG-SJTU/AlphaPose/tree/master/trackers). Make sure to add the necessary folder as a volume to the `docker run` command. + +## Usage + +Then the scripts can be invoked with `poetry run python ....py` + + diff --git a/alphapose-docker b/alphapose-docker new file mode 160000 index 0000000..5aa2d0f --- /dev/null +++ b/alphapose-docker @@ -0,0 +1 @@ +Subproject commit 5aa2d0fac11d9af37c567284324d06b5a050d81d diff --git a/loop_alphapose_training.py b/loop_alphapose_training.py index 68a6516..f8cec59 100644 --- a/loop_alphapose_training.py +++ b/loop_alphapose_training.py @@ -60,9 +60,9 @@ def wrap_docker_cmd(cmd: list, container: str = 'alphapose'): '-v', str(pwd) + '/exp:/build/AlphaPose/exp', '-v', str(pwd) + '/data:/build/AlphaPose/data', '-v', str(pwd) + '/out:/out', - '-v', str(pwd) + '/detector/yolox/data:/build/AlphaPose/detector/yolox/data', - '-v', str(pwd) + '/detector/yolo/data:/build/AlphaPose/detector/yolo/data', - '-v', str(pwd) + '/pretrained_models:/build/AlphaPose/pretrained_models', + '-v', str(pwd) + '/alphapose-docker/detector/yolox/data:/build/AlphaPose/detector/yolox/data', + '-v', str(pwd) + '/alphapose-docker/detector/yolo/data:/build/AlphaPose/detector/yolo/data', + '-v', str(pwd) + '/alphapose-docker/pretrained_models:/build/AlphaPose/pretrained_models', container, *cmd ] diff --git a/poetry.lock b/poetry.lock index 5cb3aad..d0ce8b2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -560,7 +560,7 @@ cffi = {version = "*", markers = "implementation_name == \"pypy\""} [[package]] name = "setuptools" -version = "67.5.1" +version = "67.6.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false @@ -1345,8 +1345,8 @@ pyzmq = [ {file = "pyzmq-25.0.0.tar.gz", hash = "sha256:f330a1a2c7f89fd4b0aa4dcb7bf50243bf1c8da9a2f1efc31daf57a2046b31f2"}, ] setuptools = [ - {file = "setuptools-67.5.1-py3-none-any.whl", hash = "sha256:1c39d42bda4cb89f7fdcad52b6762e3c309ec8f8715b27c684176b7d71283242"}, - {file = "setuptools-67.5.1.tar.gz", hash = "sha256:15136a251127da2d2e77ac7a1bc231eb504654f7e3346d93613a13f2e2787535"}, + {file = "setuptools-67.6.0-py3-none-any.whl", hash = "sha256:b78aaa36f6b90a074c1fa651168723acbf45d14cb1196b6f02c0fd07f17623b2"}, + {file = "setuptools-67.6.0.tar.gz", hash = "sha256:2ee892cd5f29f3373097f5a814697e397cf3ce313616df0af11231e2ad118077"}, ] setuptools-scm = [ {file = "setuptools_scm-7.1.0-py3-none-any.whl", hash = "sha256:73988b6d848709e2af142aa48c986ea29592bbcfca5375678064708205253d8e"}, diff --git a/pyproject.toml b/pyproject.toml index 3c0706c..299b15f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "alphapose-loop" +name = "alphapose-feedback" version = "0.1.0" description = "" authors = ["Ruben van de Ven "]