From e514785e9391f45f8836b013f0d917f1bd9aa15e Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Mon, 2 Feb 2026 14:46:49 +0100 Subject: [PATCH 01/15] Update project name and README formatting --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a77c5859..a73ebc75 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# FMPose: 3D Pose Estimation via Flow Matching +# FMPose3D: monocular 3D Pose Estimation via Flow Matching This is the official implementation of the approach described in the paper: -> [**FMPose: 3D Pose Estimation via Flow Matching**](xxx) +> [**FMPose3D: monocular 3D Pose Estimation via Flow Matching**](xxx) > Ti Wang, Xiaohang Yu, Mackenzie Weygandt Mathis @@ -11,7 +11,7 @@ This is the official implementation of the approach described in the paper: ## Set up a environment -Make sure you have Python 3.10. You can set this up with: +Make sure you have Python 3.10+. You can set this up with: ```bash conda create -n fmpose_3d python=3.10 conda activate fmpose_3d From 5bb43ae645b03c896bc05a07b8cd581e21a4cd9f Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Mon, 2 Feb 2026 14:54:12 +0100 Subject: [PATCH 02/15] Update model name from FMPose to FMPose3D --- animals/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/animals/README.md b/animals/README.md index 49bd922f..af9da699 100644 --- a/animals/README.md +++ b/animals/README.md @@ -2,7 +2,7 @@ # Animals -In this part, the FMPose model is trained on [Animal3D](https://xujiacong.github.io/Animal3D/) dataset and [Control_Animal3D](https://luoxue-star.github.io/AniMer_project_page/) dataset. +In this part, the FMPose3D model is trained on [Animal3D](https://xujiacong.github.io/Animal3D/) dataset and [Control_Animal3D](https://luoxue-star.github.io/AniMer_project_page/) dataset. ## Demo ### Testing on in-the-wild images (animals) @@ -62,4 +62,4 @@ Download the pretrained model from [here](https://drive.google.com/drive/folders ```bash cd animals # the current path is: ./animals bash ./scripts/test_animal3d.sh -``` \ No newline at end of file +``` From 607d1cb8aca2577af8f2be3d2360246c7eb33961 Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Mon, 2 Feb 2026 15:01:31 +0100 Subject: [PATCH 03/15] Update README with news and acknowledgements --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a73ebc75..6acb9cdb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,15 @@ This is the official implementation of the approach described in the paper:

-## Set up a environment + +## News! + +- [X] Feb 2026: FMPose3D is code and arXiv paper is released - check out the demos here or on our [project page](https://xiu-cs.github.io/FMPose3D/) +- [ ] Planned: This method will be integrated into [DeepLabCut](https://www.mackenziemathislab.org/deeplabcut) + +## Installation + +### Set up an environment Make sure you have Python 3.10+. You can set this up with: ```bash @@ -85,9 +93,11 @@ sh ./scripts/FMPose_test.sh For animal training/testing and demo scripts, see [animals/README.md](animals/README.md). -## Acknowledgement +## Acknowledgements + +We thank the Swiss National Science Foundation (SNSF Project # 320030-227871) and the Kavli Foundation for providing financial support for this project. -Our code is extended from the following repositories. We thank the authors for releasing the codes. +Our code is extended from the following repositories. We thank the authors for releasing the code. - [MHFormer](https://github.com/Vegetebird/MHFormer) - [StridedTransformer-Pose3D](https://github.com/Vegetebird/StridedTransformer-Pose3D) From 3fff999d213db5427bb8847e3d236bab6701c76b Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Mon, 2 Feb 2026 15:10:32 +0100 Subject: [PATCH 04/15] Rename project to 'fmpose3d' and change license Updated project name and license type in pyproject.toml. --- pyproject.toml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5ede62e0..8d2480a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,24 +3,22 @@ requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "fmpose" +name = "fmpose3d" readme = "README.md" requires-python = ">=3.8" dynamic = ["version"] -license = {text = "MIT"} +license = {text = "Apache 2.0"} authors = [ {name = "Ti Wang", email = "ti.wang@epfl.ch"}, {name = "Xiaohang Yu"}, - {name = "Mackenzie Weygandt Mathis"}, + {name = "Mackenzie Weygandt Mathis", email = "mackenzie.mathis@epfl.ch"}, ] keywords = ["pose estimation", "3D pose", "flow matching", "computer vision"] classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: Apache 2.0", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering :: Artificial Intelligence", ] From 699930a7f3d1674523e2555ef34c9a81ff4b99f9 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 15:26:02 +0100 Subject: [PATCH 05/15] Rename FMPose to FMPose3D (#5) * Initial plan * Rename FMPose to FMPose3D in all files Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> * Complete renaming FMPose to FMPose3D Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> * Add .gitignore and remove Python cache files Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> Co-authored-by: Mackenzie Mathis --- .gitignore | 53 +++++++++++++++++++ README.md | 4 +- animals/models/model_animals.py | 6 +-- fmpose/__init__.py | 4 +- fmpose/animals/__init__.py | 2 +- fmpose/animals/models/__init__.py | 2 +- fmpose/animals/models/model_animal3d.py | 6 +-- fmpose/common/__init__.py | 2 +- fmpose/models/__init__.py | 2 +- fmpose/models/model_GAMLP.py | 6 +-- scripts/{FMPose_main.py => FMPose3D_main.py} | 0 scripts/{FMPose_test.sh => FMPose3D_test.sh} | 4 +- .../{FMPose_train.sh => FMPose3D_train.sh} | 8 +-- tests/test_training_pipeline.py | 2 +- 14 files changed, 77 insertions(+), 24 deletions(-) create mode 100644 .gitignore rename scripts/{FMPose_main.py => FMPose3D_main.py} (100%) rename scripts/{FMPose_test.sh => FMPose3D_test.sh} (91%) rename scripts/{FMPose_train.sh => FMPose3D_train.sh} (85%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..d4ac7f6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,53 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyTorch +*.pth +*.pt + +# Jupyter Notebook +.ipynb_checkpoints + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Project specific +checkpoint/ +dataset/ +*.log diff --git a/README.md b/README.md index 6acb9cdb..4bfc91f9 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ The training logs, checkpoints, and related files of each training time will be For training on Human3.6M: ```bash -sh /scripts/FMPose_train.sh +sh /scripts/FMPose3D_train.sh ``` ### Inference @@ -86,7 +86,7 @@ First, download the folder with pre-trained model from [here](https://drive.goog To run inference on Human3.6M: ```bash -sh ./scripts/FMPose_test.sh +sh ./scripts/FMPose3D_test.sh ``` ## Experiments Animals diff --git a/animals/models/model_animals.py b/animals/models/model_animals.py index e2fa4836..59aa847b 100644 --- a/animals/models/model_animals.py +++ b/animals/models/model_animals.py @@ -139,7 +139,7 @@ def forward(self, x): x = res2 + self.drop_path(x) return x -class FMPose(nn.Module): +class FMPose3D(nn.Module): def __init__(self, depth, embed_dim, channels_dim, tokens_dim, adj, drop_rate=0.10, length=27): super().__init__() drop_path_rate = 0.2 @@ -211,7 +211,7 @@ def __init__(self, args): self.encoder_pose_2d = encoder(2, args.channel//2, args.channel//2-self.t_embed_dim//2) self.encoder_y_t = encoder(3, args.channel//2, args.channel//2-self.t_embed_dim//2) - self.FMPose = FMPose(args.layers, args.channel, args.d_hid, args.token_dim, self.A, length=args.n_joints) # 256 + self.FMPose3D = FMPose3D(args.layers, args.channel, args.d_hid, args.token_dim, self.A, length=args.n_joints) # 256 self.pred_mu = decoder(args.channel, args.channel//2, 3) def forward(self, pose_2d, y_t, t): @@ -230,7 +230,7 @@ def forward(self, pose_2d, y_t, t): in_emb = rearrange(in_emb, 'b f j c -> (b f) j c').contiguous() # (B*F,J,in) # encoder -> model -> regression head - h = self.FMPose(in_emb) + h = self.FMPose3D(in_emb) v = self.pred_mu(h) # (B*F,J,3) v = rearrange(v, '(b f) j c -> b f j c', b=b, f=f).contiguous() # (B,F,J,3) diff --git a/fmpose/__init__.py b/fmpose/__init__.py index bd3e6617..4014e09c 100644 --- a/fmpose/__init__.py +++ b/fmpose/__init__.py @@ -1,8 +1,8 @@ """ -FMPose: 3D Pose Estimation via Flow Matching +FMPose3D: 3D Pose Estimation via Flow Matching Official implementation of the paper: -"FMPose: 3D Pose Estimation via Flow Matching" +"FMPose3D: 3D Pose Estimation via Flow Matching" by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis Accepted by IEEE Transactions on Multimedia (TMM), 2025. """ diff --git a/fmpose/animals/__init__.py b/fmpose/animals/__init__.py index 951bd296..21ceac08 100644 --- a/fmpose/animals/__init__.py +++ b/fmpose/animals/__init__.py @@ -1,5 +1,5 @@ """ -Animal-specific components for FMPose. +Animal-specific components for FMPose3D. """ __all__ = [ diff --git a/fmpose/animals/models/__init__.py b/fmpose/animals/models/__init__.py index 89379d73..7420f2b5 100644 --- a/fmpose/animals/models/__init__.py +++ b/fmpose/animals/models/__init__.py @@ -1,5 +1,5 @@ """ -FMPose models. +FMPose3D models. """ from .graph_frames import Graph diff --git a/fmpose/animals/models/model_animal3d.py b/fmpose/animals/models/model_animal3d.py index 5ee38706..993661bd 100644 --- a/fmpose/animals/models/model_animal3d.py +++ b/fmpose/animals/models/model_animal3d.py @@ -139,7 +139,7 @@ def forward(self, x): x = res2 + self.drop_path(x) return x -class FMPose(nn.Module): +class FMPose3D(nn.Module): def __init__(self, depth, embed_dim, channels_dim, tokens_dim, adj, drop_rate=0.10, length=27): super().__init__() drop_path_rate = 0.2 @@ -210,7 +210,7 @@ def __init__(self, args): self.encoder_pose_2d = encoder(2, args.channel//2, args.channel//2-self.t_embed_dim//2) self.encoder_y_t = encoder(3, args.channel//2, args.channel//2-self.t_embed_dim//2) - self.FMPose = FMPose(args.layers, args.channel, args.d_hid, args.token_dim, self.A, length=args.n_joints) # 256 + self.FMPose3D = FMPose3D(args.layers, args.channel, args.d_hid, args.token_dim, self.A, length=args.n_joints) # 256 self.pred_mu = decoder(args.channel, args.channel//2, 3) def forward(self, pose_2d, y_t, t): @@ -229,7 +229,7 @@ def forward(self, pose_2d, y_t, t): in_emb = rearrange(in_emb, 'b f j c -> (b f) j c').contiguous() # (B*F,J,in) # encoder -> model -> regression head - h = self.FMPose(in_emb) + h = self.FMPose3D(in_emb) v = self.pred_mu(h) # (B*F,J,3) v = rearrange(v, '(b f) j c -> b f j c', b=b, f=f).contiguous() # (B,F,J,3) diff --git a/fmpose/common/__init__.py b/fmpose/common/__init__.py index b2a3e3f6..f6a583fc 100644 --- a/fmpose/common/__init__.py +++ b/fmpose/common/__init__.py @@ -1,5 +1,5 @@ """ -Common utilities for FMPose. +Common utilities for FMPose3D. """ from .arguments import opts diff --git a/fmpose/models/__init__.py b/fmpose/models/__init__.py index bc460081..2d8a0c4b 100644 --- a/fmpose/models/__init__.py +++ b/fmpose/models/__init__.py @@ -1,5 +1,5 @@ """ -FMPose models. +FMPose3D models. """ from .graph_frames import Graph diff --git a/fmpose/models/model_GAMLP.py b/fmpose/models/model_GAMLP.py index 5aefe0af..13569fdc 100644 --- a/fmpose/models/model_GAMLP.py +++ b/fmpose/models/model_GAMLP.py @@ -145,7 +145,7 @@ def forward(self, x): x = res2 + self.drop_path(x) return x -class FMPose(nn.Module): +class FMPose3D(nn.Module): def __init__(self, depth, embed_dim, channels_dim, tokens_dim, adj, drop_rate=0.10, length=27): super().__init__() @@ -219,7 +219,7 @@ def __init__(self, args): self.encoder_pose_2d = encoder(2, args.channel//2, args.channel//2-self.t_embed_dim//2) self.encoder_y_t = encoder(3, args.channel//2, args.channel//2-self.t_embed_dim//2) - self.FMPose = FMPose(args.layers, args.channel, args.d_hid, args.token_dim, self.A, length=args.n_joints) # 256 + self.FMPose3D = FMPose3D(args.layers, args.channel, args.d_hid, args.token_dim, self.A, length=args.n_joints) # 256 self.pred_mu = decoder(args.channel, args.channel//2, 3) def forward(self, pose_2d, y_t, t): @@ -241,7 +241,7 @@ def forward(self, pose_2d, y_t, t): in_emb = rearrange(in_emb, 'b f j c -> (b f) j c').contiguous() # (B*F,J,in) # encoder -> model -> regression head - h = self.FMPose(in_emb) + h = self.FMPose3D(in_emb) v = self.pred_mu(h) # (B*F,J,3) v = rearrange(v, '(b f) j c -> b f j c', b=b, f=f).contiguous() # (B,F,J,3) diff --git a/scripts/FMPose_main.py b/scripts/FMPose3D_main.py similarity index 100% rename from scripts/FMPose_main.py rename to scripts/FMPose3D_main.py diff --git a/scripts/FMPose_test.sh b/scripts/FMPose3D_test.sh similarity index 91% rename from scripts/FMPose_test.sh rename to scripts/FMPose3D_test.sh index 985f9a82..de7869ea 100755 --- a/scripts/FMPose_test.sh +++ b/scripts/FMPose3D_test.sh @@ -1,7 +1,7 @@ #inference layers=5 batch_size=1024 -sh_file='scripts/FMPose_test.sh' +sh_file='scripts/FMPose3D_test.sh' weight_softmax_tau=1.0 num_hypothesis_list=1 eval_multi_steps=3 @@ -15,7 +15,7 @@ model_path='pre_trained_models/fmpose_detected2d/model_GAMLP.py' saved_model_path='pre_trained_models/fmpose_detected2d/FMpose_36_4972_best.pth' #Test CFM -python3 scripts/FMPose_main.py \ +python3 scripts/FMPose3D_main.py \ --reload \ --topk ${topk} \ --exp_temp ${exp_temp} \ diff --git a/scripts/FMPose_train.sh b/scripts/FMPose3D_train.sh similarity index 85% rename from scripts/FMPose_train.sh rename to scripts/FMPose3D_train.sh index 613e6040..cb3e0289 100755 --- a/scripts/FMPose_train.sh +++ b/scripts/FMPose3D_train.sh @@ -1,4 +1,4 @@ -#Train FMPose +#Train FMPose3D layers=5 lr=1e-3 decay=0.98 @@ -13,10 +13,10 @@ frames=1 channel_dim=512 model_path="" # when the path is empty, the model will be loaded from the installed fmpose package # model_path='./fmpose/models/model_GAMLP.py' # when the path is not empty, the model will be loaded from the local file path -sh_file='scripts/FMPose_train.sh' -folder_name=FMPose_Publish_layers${layers}_$(date +%Y%m%d_%H%M%S) +sh_file='scripts/FMPose3D_train.sh' +folder_name=FMPose3D_Publish_layers${layers}_$(date +%Y%m%d_%H%M%S) -python3 scripts/FMPose_main.py \ +python3 scripts/FMPose3D_main.py \ --train \ --dataset h36m \ --frames ${frames} \ diff --git a/tests/test_training_pipeline.py b/tests/test_training_pipeline.py index 3e843b22..2dfb9ffb 100644 --- a/tests/test_training_pipeline.py +++ b/tests/test_training_pipeline.py @@ -37,7 +37,7 @@ def optimizer(model): def sample_batch(device): """Create a sample batch for training. - Shapes based on FMPose_main.py train function: + Shapes based on FMPose3D_main.py train function: - input_2D: (B, F, J, 2) - 2D pose input - gt_3D: (B, F, J, 3) - 3D pose ground truth """ From 974a0fd6bf176abdb3ebd1abb9ac42f29447105f Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Feb 2026 15:37:16 +0100 Subject: [PATCH 06/15] Rename package directory from fmpose to fmpose3d (#6) * Initial plan * Rename fmpose directory to fmpose3d and update all imports Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> --- README.md | 4 ++-- animals/demo/vis_animals.py | 6 +++--- animals/models/model_animals.py | 2 +- animals/scripts/main_animal3d.py | 8 ++++---- demo/vis_in_the_wild.py | 10 +++++----- {fmpose => fmpose3d}/__init__.py | 0 {fmpose => fmpose3d}/aggregation_methods.py | 2 +- {fmpose => fmpose3d}/animals/__init__.py | 0 .../animals/common/__init__.py | 0 .../animals/common/animal3d_dataset.py | 0 .../animals/common/animal_visualization.py | 0 .../animals/common/arber_dataset.py | 0 .../animals/common/arguments.py | 0 {fmpose => fmpose3d}/animals/common/camera.py | 0 .../animals/common/graph_utils.py | 0 .../animals/common/lifter3d.py | 0 .../animals/common/mocap_dataset.py | 0 .../animals/common/skeleton.py | 0 {fmpose => fmpose3d}/animals/common/utils.py | 0 .../animals/models/__init__.py | 0 .../animals/models/graph_frames.py | 0 .../animals/models/model_animal3d.py | 2 +- {fmpose => fmpose3d}/common/__init__.py | 0 {fmpose => fmpose3d}/common/arguments.py | 0 {fmpose => fmpose3d}/common/camera.py | 0 {fmpose => fmpose3d}/common/generator.py | 0 {fmpose => fmpose3d}/common/graph_utils.py | 0 {fmpose => fmpose3d}/common/h36m_dataset.py | 6 +++--- {fmpose => fmpose3d}/common/load_data_hm36.py | 6 +++--- {fmpose => fmpose3d}/common/mocap_dataset.py | 0 {fmpose => fmpose3d}/common/skeleton.py | 0 {fmpose => fmpose3d}/common/utils.py | 0 {fmpose => fmpose3d}/lib/__init__.py | 0 {fmpose => fmpose3d}/lib/checkpoint/README.md | 0 .../lib/checkpoint/__init__.py | 0 .../lib/checkpoint/download_checkpoints.py | 0 {fmpose => fmpose3d}/lib/hrnet/__init__.py | 0 .../experiments/w48_384x288_adam_lr1e-3.yaml | 0 {fmpose => fmpose3d}/lib/hrnet/gen_kpts.py | 18 +++++++++--------- .../lib/hrnet/lib/__init__.py | 0 .../lib/hrnet/lib/config/__init__.py | 0 .../lib/hrnet/lib/config/default.py | 0 .../lib/hrnet/lib/config/models.py | 0 .../lib/hrnet/lib/models/__init__.py | 0 .../lib/hrnet/lib/models/pose_hrnet.py | 0 .../lib/hrnet/lib/utils/__init__.py | 0 .../lib/hrnet/lib/utils/coco_h36m.py | 0 .../lib/hrnet/lib/utils/inference.py | 0 .../lib/hrnet/lib/utils/transforms.py | 0 .../lib/hrnet/lib/utils/utilitys.py | 4 ++-- {fmpose => fmpose3d}/lib/preprocess.py | 0 {fmpose => fmpose3d}/lib/sort/__init__.py | 0 {fmpose => fmpose3d}/lib/sort/sort.py | 0 {fmpose => fmpose3d}/lib/yolov3/__init__.py | 0 {fmpose => fmpose3d}/lib/yolov3/bbox.py | 0 .../lib/yolov3/cfg/tiny-yolo-voc.cfg | 0 .../lib/yolov3/cfg/yolo-voc.cfg | 0 {fmpose => fmpose3d}/lib/yolov3/cfg/yolo.cfg | 0 .../lib/yolov3/cfg/yolov3.cfg | 0 {fmpose => fmpose3d}/lib/yolov3/darknet.py | 4 ++-- .../lib/yolov3/data/coco.names | 0 {fmpose => fmpose3d}/lib/yolov3/data/pallete | Bin .../lib/yolov3/data/voc.names | 0 .../lib/yolov3/human_detector.py | 8 ++++---- {fmpose => fmpose3d}/lib/yolov3/preprocess.py | 0 {fmpose => fmpose3d}/lib/yolov3/util.py | 4 ++-- {fmpose => fmpose3d}/models/__init__.py | 0 {fmpose => fmpose3d}/models/graph_frames.py | 0 {fmpose => fmpose3d}/models/model_GAMLP.py | 2 +- pyproject.toml | 2 +- scripts/FMPose3D_main.py | 8 ++++---- tests/test_demo_human.py | 10 +++++----- tests/test_model.py | 2 +- tests/test_training_pipeline.py | 2 +- 74 files changed, 55 insertions(+), 55 deletions(-) rename {fmpose => fmpose3d}/__init__.py (100%) rename {fmpose => fmpose3d}/aggregation_methods.py (99%) rename {fmpose => fmpose3d}/animals/__init__.py (100%) rename {fmpose => fmpose3d}/animals/common/__init__.py (100%) rename {fmpose => fmpose3d}/animals/common/animal3d_dataset.py (100%) rename {fmpose => fmpose3d}/animals/common/animal_visualization.py (100%) rename {fmpose => fmpose3d}/animals/common/arber_dataset.py (100%) rename {fmpose => fmpose3d}/animals/common/arguments.py (100%) rename {fmpose => fmpose3d}/animals/common/camera.py (100%) rename {fmpose => fmpose3d}/animals/common/graph_utils.py (100%) rename {fmpose => fmpose3d}/animals/common/lifter3d.py (100%) rename {fmpose => fmpose3d}/animals/common/mocap_dataset.py (100%) rename {fmpose => fmpose3d}/animals/common/skeleton.py (100%) rename {fmpose => fmpose3d}/animals/common/utils.py (100%) rename {fmpose => fmpose3d}/animals/models/__init__.py (100%) rename {fmpose => fmpose3d}/animals/models/graph_frames.py (100%) rename {fmpose => fmpose3d}/animals/models/model_animal3d.py (99%) rename {fmpose => fmpose3d}/common/__init__.py (100%) rename {fmpose => fmpose3d}/common/arguments.py (100%) rename {fmpose => fmpose3d}/common/camera.py (100%) rename {fmpose => fmpose3d}/common/generator.py (100%) rename {fmpose => fmpose3d}/common/graph_utils.py (100%) rename {fmpose => fmpose3d}/common/h36m_dataset.py (98%) rename {fmpose => fmpose3d}/common/load_data_hm36.py (98%) rename {fmpose => fmpose3d}/common/mocap_dataset.py (100%) rename {fmpose => fmpose3d}/common/skeleton.py (100%) rename {fmpose => fmpose3d}/common/utils.py (100%) rename {fmpose => fmpose3d}/lib/__init__.py (100%) rename {fmpose => fmpose3d}/lib/checkpoint/README.md (100%) rename {fmpose => fmpose3d}/lib/checkpoint/__init__.py (100%) rename {fmpose => fmpose3d}/lib/checkpoint/download_checkpoints.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/__init__.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/experiments/w48_384x288_adam_lr1e-3.yaml (100%) rename {fmpose => fmpose3d}/lib/hrnet/gen_kpts.py (91%) rename {fmpose => fmpose3d}/lib/hrnet/lib/__init__.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/config/__init__.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/config/default.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/config/models.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/models/__init__.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/models/pose_hrnet.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/utils/__init__.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/utils/coco_h36m.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/utils/inference.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/utils/transforms.py (100%) rename {fmpose => fmpose3d}/lib/hrnet/lib/utils/utilitys.py (98%) rename {fmpose => fmpose3d}/lib/preprocess.py (100%) rename {fmpose => fmpose3d}/lib/sort/__init__.py (100%) rename {fmpose => fmpose3d}/lib/sort/sort.py (100%) rename {fmpose => fmpose3d}/lib/yolov3/__init__.py (100%) rename {fmpose => fmpose3d}/lib/yolov3/bbox.py (100%) rename {fmpose => fmpose3d}/lib/yolov3/cfg/tiny-yolo-voc.cfg (100%) rename {fmpose => fmpose3d}/lib/yolov3/cfg/yolo-voc.cfg (100%) rename {fmpose => fmpose3d}/lib/yolov3/cfg/yolo.cfg (100%) rename {fmpose => fmpose3d}/lib/yolov3/cfg/yolov3.cfg (100%) rename {fmpose => fmpose3d}/lib/yolov3/darknet.py (99%) rename {fmpose => fmpose3d}/lib/yolov3/data/coco.names (100%) rename {fmpose => fmpose3d}/lib/yolov3/data/pallete (100%) rename {fmpose => fmpose3d}/lib/yolov3/data/voc.names (100%) rename {fmpose => fmpose3d}/lib/yolov3/human_detector.py (96%) rename {fmpose => fmpose3d}/lib/yolov3/preprocess.py (100%) rename {fmpose => fmpose3d}/lib/yolov3/util.py (98%) rename {fmpose => fmpose3d}/models/__init__.py (100%) rename {fmpose => fmpose3d}/models/graph_frames.py (100%) rename {fmpose => fmpose3d}/models/model_GAMLP.py (99%) diff --git a/README.md b/README.md index 4bfc91f9..5f17f6de 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,9 @@ conda activate fmpose_3d ```bash git clone xxxx.git # clone this repo # TestPyPI (pre-release/testing build) -pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ fmpose==0.0.5 +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ fmpose3d==0.0.5 # Future Official PyPI release -# pip install fmpose +# pip install fmpose3d ``` ## Demo diff --git a/animals/demo/vis_animals.py b/animals/demo/vis_animals.py index 0aad779b..fddb79af 100644 --- a/animals/demo/vis_animals.py +++ b/animals/demo/vis_animals.py @@ -13,8 +13,8 @@ from PIL import Image import matplotlib.gridspec as gridspec import imageio -from fmpose.animals.common.arguments import opts as parse_args -from fmpose.common.camera import normalize_screen_coordinates, camera_to_world +from fmpose3d.animals.common.arguments import opts as parse_args +from fmpose3d.common.camera import normalize_screen_coordinates, camera_to_world sys.path.append(os.getcwd()) @@ -37,7 +37,7 @@ CFM = getattr(module, "Model") else: # Load model from installed fmpose package - from fmpose.models import Model as CFM + from fmpose3d.models import Model as CFM from deeplabcut.pose_estimation_pytorch.apis import superanimal_analyze_images diff --git a/animals/models/model_animals.py b/animals/models/model_animals.py index 59aa847b..3943ff47 100644 --- a/animals/models/model_animals.py +++ b/animals/models/model_animals.py @@ -6,7 +6,7 @@ from einops import rearrange from timm.models.layers import DropPath -from fmpose.animals.models.graph_frames import Graph +from fmpose3d.animals.models.graph_frames import Graph class TimeEmbedding(nn.Module): diff --git a/animals/scripts/main_animal3d.py b/animals/scripts/main_animal3d.py index fb40166f..f3761eb3 100644 --- a/animals/scripts/main_animal3d.py +++ b/animals/scripts/main_animal3d.py @@ -6,9 +6,9 @@ import numpy as np from tqdm import tqdm import torch.optim as optim -from fmpose.animals.common.arguments import opts as parse_args -from fmpose.animals.common.utils import * -from fmpose.animals.common.animal3d_dataset import TrainDataset +from fmpose3d.animals.common.arguments import opts as parse_args +from fmpose3d.animals.common.utils import * +from fmpose3d.animals.common.animal3d_dataset import TrainDataset import time args = parse_args().parse() @@ -30,7 +30,7 @@ CFM = getattr(module, "Model") else: # Load model from installed fmpose package - from fmpose.animals.models import Model as CFM + from fmpose3d.animals.models import Model as CFM def train(opt, actions, train_loader, model, optimizer, epoch): return step('train', opt, actions, train_loader, model, optimizer, epoch) diff --git a/demo/vis_in_the_wild.py b/demo/vis_in_the_wild.py index d53da8a1..8d56e918 100755 --- a/demo/vis_in_the_wild.py +++ b/demo/vis_in_the_wild.py @@ -10,12 +10,12 @@ sys.path.append(os.getcwd()) # Auto-download checkpoint files if missing -from fmpose.lib.checkpoint.download_checkpoints import ensure_checkpoints +from fmpose3d.lib.checkpoint.download_checkpoints import ensure_checkpoints ensure_checkpoints() -from fmpose.lib.preprocess import h36m_coco_format, revise_kpts -from fmpose.lib.hrnet.gen_kpts import gen_video_kpts as hrnet_pose -from fmpose.common.arguments import opts as parse_args +from fmpose3d.lib.preprocess import h36m_coco_format, revise_kpts +from fmpose3d.lib.hrnet.gen_kpts import gen_video_kpts as hrnet_pose +from fmpose3d.common.arguments import opts as parse_args args = parse_args().parse() os.environ["CUDA_VISIBLE_DEVICES"] = args.gpu @@ -30,7 +30,7 @@ spec.loader.exec_module(module) CFM = getattr(module, 'Model') -from fmpose.common.camera import * +from fmpose3d.common.camera import * import matplotlib import matplotlib.pyplot as plt diff --git a/fmpose/__init__.py b/fmpose3d/__init__.py similarity index 100% rename from fmpose/__init__.py rename to fmpose3d/__init__.py diff --git a/fmpose/aggregation_methods.py b/fmpose3d/aggregation_methods.py similarity index 99% rename from fmpose/aggregation_methods.py rename to fmpose3d/aggregation_methods.py index 03daca4e..80a651cb 100644 --- a/fmpose/aggregation_methods.py +++ b/fmpose3d/aggregation_methods.py @@ -1,5 +1,5 @@ import torch -from fmpose.common.utils import project_to_2d +from fmpose3d.common.utils import project_to_2d def average_aggregation(list_hypothesis): return torch.mean(torch.stack(list_hypothesis), dim=0) diff --git a/fmpose/animals/__init__.py b/fmpose3d/animals/__init__.py similarity index 100% rename from fmpose/animals/__init__.py rename to fmpose3d/animals/__init__.py diff --git a/fmpose/animals/common/__init__.py b/fmpose3d/animals/common/__init__.py similarity index 100% rename from fmpose/animals/common/__init__.py rename to fmpose3d/animals/common/__init__.py diff --git a/fmpose/animals/common/animal3d_dataset.py b/fmpose3d/animals/common/animal3d_dataset.py similarity index 100% rename from fmpose/animals/common/animal3d_dataset.py rename to fmpose3d/animals/common/animal3d_dataset.py diff --git a/fmpose/animals/common/animal_visualization.py b/fmpose3d/animals/common/animal_visualization.py similarity index 100% rename from fmpose/animals/common/animal_visualization.py rename to fmpose3d/animals/common/animal_visualization.py diff --git a/fmpose/animals/common/arber_dataset.py b/fmpose3d/animals/common/arber_dataset.py similarity index 100% rename from fmpose/animals/common/arber_dataset.py rename to fmpose3d/animals/common/arber_dataset.py diff --git a/fmpose/animals/common/arguments.py b/fmpose3d/animals/common/arguments.py similarity index 100% rename from fmpose/animals/common/arguments.py rename to fmpose3d/animals/common/arguments.py diff --git a/fmpose/animals/common/camera.py b/fmpose3d/animals/common/camera.py similarity index 100% rename from fmpose/animals/common/camera.py rename to fmpose3d/animals/common/camera.py diff --git a/fmpose/animals/common/graph_utils.py b/fmpose3d/animals/common/graph_utils.py similarity index 100% rename from fmpose/animals/common/graph_utils.py rename to fmpose3d/animals/common/graph_utils.py diff --git a/fmpose/animals/common/lifter3d.py b/fmpose3d/animals/common/lifter3d.py similarity index 100% rename from fmpose/animals/common/lifter3d.py rename to fmpose3d/animals/common/lifter3d.py diff --git a/fmpose/animals/common/mocap_dataset.py b/fmpose3d/animals/common/mocap_dataset.py similarity index 100% rename from fmpose/animals/common/mocap_dataset.py rename to fmpose3d/animals/common/mocap_dataset.py diff --git a/fmpose/animals/common/skeleton.py b/fmpose3d/animals/common/skeleton.py similarity index 100% rename from fmpose/animals/common/skeleton.py rename to fmpose3d/animals/common/skeleton.py diff --git a/fmpose/animals/common/utils.py b/fmpose3d/animals/common/utils.py similarity index 100% rename from fmpose/animals/common/utils.py rename to fmpose3d/animals/common/utils.py diff --git a/fmpose/animals/models/__init__.py b/fmpose3d/animals/models/__init__.py similarity index 100% rename from fmpose/animals/models/__init__.py rename to fmpose3d/animals/models/__init__.py diff --git a/fmpose/animals/models/graph_frames.py b/fmpose3d/animals/models/graph_frames.py similarity index 100% rename from fmpose/animals/models/graph_frames.py rename to fmpose3d/animals/models/graph_frames.py diff --git a/fmpose/animals/models/model_animal3d.py b/fmpose3d/animals/models/model_animal3d.py similarity index 99% rename from fmpose/animals/models/model_animal3d.py rename to fmpose3d/animals/models/model_animal3d.py index 993661bd..8c2e9675 100644 --- a/fmpose/animals/models/model_animal3d.py +++ b/fmpose3d/animals/models/model_animal3d.py @@ -6,7 +6,7 @@ from einops import rearrange from timm.models.layers import DropPath -from fmpose.animals.models.graph_frames import Graph +from fmpose3d.animals.models.graph_frames import Graph class TimeEmbedding(nn.Module): def __init__(self, dim: int, hidden_dim: int = 64): diff --git a/fmpose/common/__init__.py b/fmpose3d/common/__init__.py similarity index 100% rename from fmpose/common/__init__.py rename to fmpose3d/common/__init__.py diff --git a/fmpose/common/arguments.py b/fmpose3d/common/arguments.py similarity index 100% rename from fmpose/common/arguments.py rename to fmpose3d/common/arguments.py diff --git a/fmpose/common/camera.py b/fmpose3d/common/camera.py similarity index 100% rename from fmpose/common/camera.py rename to fmpose3d/common/camera.py diff --git a/fmpose/common/generator.py b/fmpose3d/common/generator.py similarity index 100% rename from fmpose/common/generator.py rename to fmpose3d/common/generator.py diff --git a/fmpose/common/graph_utils.py b/fmpose3d/common/graph_utils.py similarity index 100% rename from fmpose/common/graph_utils.py rename to fmpose3d/common/graph_utils.py diff --git a/fmpose/common/h36m_dataset.py b/fmpose3d/common/h36m_dataset.py similarity index 98% rename from fmpose/common/h36m_dataset.py rename to fmpose3d/common/h36m_dataset.py index 7285acb5..1a42d7e0 100755 --- a/fmpose/common/h36m_dataset.py +++ b/fmpose3d/common/h36m_dataset.py @@ -2,9 +2,9 @@ import numpy as np -from fmpose.common.camera import normalize_screen_coordinates -from fmpose.common.mocap_dataset import MocapDataset -from fmpose.common.skeleton import Skeleton +from fmpose3d.common.camera import normalize_screen_coordinates +from fmpose3d.common.mocap_dataset import MocapDataset +from fmpose3d.common.skeleton import Skeleton h36m_skeleton = Skeleton( parents=[ diff --git a/fmpose/common/load_data_hm36.py b/fmpose3d/common/load_data_hm36.py similarity index 98% rename from fmpose/common/load_data_hm36.py rename to fmpose3d/common/load_data_hm36.py index 03a2a9ba..1985dea3 100755 --- a/fmpose/common/load_data_hm36.py +++ b/fmpose3d/common/load_data_hm36.py @@ -1,9 +1,9 @@ import numpy as np import torch.utils.data as data -from fmpose.common.camera import normalize_screen_coordinates, world_to_camera -from fmpose.common.generator import ChunkedGenerator -from fmpose.common.utils import deterministic_random +from fmpose3d.common.camera import normalize_screen_coordinates, world_to_camera +from fmpose3d.common.generator import ChunkedGenerator +from fmpose3d.common.utils import deterministic_random class Fusion(data.Dataset): diff --git a/fmpose/common/mocap_dataset.py b/fmpose3d/common/mocap_dataset.py similarity index 100% rename from fmpose/common/mocap_dataset.py rename to fmpose3d/common/mocap_dataset.py diff --git a/fmpose/common/skeleton.py b/fmpose3d/common/skeleton.py similarity index 100% rename from fmpose/common/skeleton.py rename to fmpose3d/common/skeleton.py diff --git a/fmpose/common/utils.py b/fmpose3d/common/utils.py similarity index 100% rename from fmpose/common/utils.py rename to fmpose3d/common/utils.py diff --git a/fmpose/lib/__init__.py b/fmpose3d/lib/__init__.py similarity index 100% rename from fmpose/lib/__init__.py rename to fmpose3d/lib/__init__.py diff --git a/fmpose/lib/checkpoint/README.md b/fmpose3d/lib/checkpoint/README.md similarity index 100% rename from fmpose/lib/checkpoint/README.md rename to fmpose3d/lib/checkpoint/README.md diff --git a/fmpose/lib/checkpoint/__init__.py b/fmpose3d/lib/checkpoint/__init__.py similarity index 100% rename from fmpose/lib/checkpoint/__init__.py rename to fmpose3d/lib/checkpoint/__init__.py diff --git a/fmpose/lib/checkpoint/download_checkpoints.py b/fmpose3d/lib/checkpoint/download_checkpoints.py similarity index 100% rename from fmpose/lib/checkpoint/download_checkpoints.py rename to fmpose3d/lib/checkpoint/download_checkpoints.py diff --git a/fmpose/lib/hrnet/__init__.py b/fmpose3d/lib/hrnet/__init__.py similarity index 100% rename from fmpose/lib/hrnet/__init__.py rename to fmpose3d/lib/hrnet/__init__.py diff --git a/fmpose/lib/hrnet/experiments/w48_384x288_adam_lr1e-3.yaml b/fmpose3d/lib/hrnet/experiments/w48_384x288_adam_lr1e-3.yaml similarity index 100% rename from fmpose/lib/hrnet/experiments/w48_384x288_adam_lr1e-3.yaml rename to fmpose3d/lib/hrnet/experiments/w48_384x288_adam_lr1e-3.yaml diff --git a/fmpose/lib/hrnet/gen_kpts.py b/fmpose3d/lib/hrnet/gen_kpts.py similarity index 91% rename from fmpose/lib/hrnet/gen_kpts.py rename to fmpose3d/lib/hrnet/gen_kpts.py index e1b83a3a..f3592a59 100755 --- a/fmpose/lib/hrnet/gen_kpts.py +++ b/fmpose3d/lib/hrnet/gen_kpts.py @@ -15,22 +15,22 @@ import cv2 import copy -from fmpose.lib.hrnet.lib.utils.utilitys import plot_keypoint, PreProcess, write, load_json -from fmpose.lib.hrnet.lib.config import cfg, update_config -from fmpose.lib.hrnet.lib.utils.transforms import * -from fmpose.lib.hrnet.lib.utils.inference import get_final_preds -from fmpose.lib.hrnet.lib.models import pose_hrnet +from fmpose3d.lib.hrnet.lib.utils.utilitys import plot_keypoint, PreProcess, write, load_json +from fmpose3d.lib.hrnet.lib.config import cfg, update_config +from fmpose3d.lib.hrnet.lib.utils.transforms import * +from fmpose3d.lib.hrnet.lib.utils.inference import get_final_preds +from fmpose3d.lib.hrnet.lib.models import pose_hrnet cfg_dir = osp.join(osp.dirname(osp.abspath(__file__)), 'experiments') + '/' # Auto-download checkpoints if missing and get checkpoint paths -from fmpose.lib.checkpoint.download_checkpoints import ensure_checkpoints, get_checkpoint_path +from fmpose3d.lib.checkpoint.download_checkpoints import ensure_checkpoints, get_checkpoint_path ensure_checkpoints() # Loading human detector model -from fmpose.lib.yolov3.human_detector import load_model as yolo_model -from fmpose.lib.yolov3.human_detector import yolo_human_det as yolo_det -from fmpose.lib.sort.sort import Sort +from fmpose3d.lib.yolov3.human_detector import load_model as yolo_model +from fmpose3d.lib.yolov3.human_detector import yolo_human_det as yolo_det +from fmpose3d.lib.sort.sort import Sort def parse_args(): parser = argparse.ArgumentParser(description='Train keypoints network') diff --git a/fmpose/lib/hrnet/lib/__init__.py b/fmpose3d/lib/hrnet/lib/__init__.py similarity index 100% rename from fmpose/lib/hrnet/lib/__init__.py rename to fmpose3d/lib/hrnet/lib/__init__.py diff --git a/fmpose/lib/hrnet/lib/config/__init__.py b/fmpose3d/lib/hrnet/lib/config/__init__.py similarity index 100% rename from fmpose/lib/hrnet/lib/config/__init__.py rename to fmpose3d/lib/hrnet/lib/config/__init__.py diff --git a/fmpose/lib/hrnet/lib/config/default.py b/fmpose3d/lib/hrnet/lib/config/default.py similarity index 100% rename from fmpose/lib/hrnet/lib/config/default.py rename to fmpose3d/lib/hrnet/lib/config/default.py diff --git a/fmpose/lib/hrnet/lib/config/models.py b/fmpose3d/lib/hrnet/lib/config/models.py similarity index 100% rename from fmpose/lib/hrnet/lib/config/models.py rename to fmpose3d/lib/hrnet/lib/config/models.py diff --git a/fmpose/lib/hrnet/lib/models/__init__.py b/fmpose3d/lib/hrnet/lib/models/__init__.py similarity index 100% rename from fmpose/lib/hrnet/lib/models/__init__.py rename to fmpose3d/lib/hrnet/lib/models/__init__.py diff --git a/fmpose/lib/hrnet/lib/models/pose_hrnet.py b/fmpose3d/lib/hrnet/lib/models/pose_hrnet.py similarity index 100% rename from fmpose/lib/hrnet/lib/models/pose_hrnet.py rename to fmpose3d/lib/hrnet/lib/models/pose_hrnet.py diff --git a/fmpose/lib/hrnet/lib/utils/__init__.py b/fmpose3d/lib/hrnet/lib/utils/__init__.py similarity index 100% rename from fmpose/lib/hrnet/lib/utils/__init__.py rename to fmpose3d/lib/hrnet/lib/utils/__init__.py diff --git a/fmpose/lib/hrnet/lib/utils/coco_h36m.py b/fmpose3d/lib/hrnet/lib/utils/coco_h36m.py similarity index 100% rename from fmpose/lib/hrnet/lib/utils/coco_h36m.py rename to fmpose3d/lib/hrnet/lib/utils/coco_h36m.py diff --git a/fmpose/lib/hrnet/lib/utils/inference.py b/fmpose3d/lib/hrnet/lib/utils/inference.py similarity index 100% rename from fmpose/lib/hrnet/lib/utils/inference.py rename to fmpose3d/lib/hrnet/lib/utils/inference.py diff --git a/fmpose/lib/hrnet/lib/utils/transforms.py b/fmpose3d/lib/hrnet/lib/utils/transforms.py similarity index 100% rename from fmpose/lib/hrnet/lib/utils/transforms.py rename to fmpose3d/lib/hrnet/lib/utils/transforms.py diff --git a/fmpose/lib/hrnet/lib/utils/utilitys.py b/fmpose3d/lib/hrnet/lib/utils/utilitys.py similarity index 98% rename from fmpose/lib/hrnet/lib/utils/utilitys.py rename to fmpose3d/lib/hrnet/lib/utils/utilitys.py index 8e756f2b..6174a2c0 100755 --- a/fmpose/lib/hrnet/lib/utils/utilitys.py +++ b/fmpose3d/lib/hrnet/lib/utils/utilitys.py @@ -3,9 +3,9 @@ import torch import json import torchvision.transforms as transforms -from fmpose.lib.hrnet.lib.utils.transforms import * +from fmpose3d.lib.hrnet.lib.utils.transforms import * -from fmpose.lib.hrnet.lib.utils.coco_h36m import coco_h36m +from fmpose3d.lib.hrnet.lib.utils.coco_h36m import coco_h36m import numpy as np joint_pairs = [[0, 1], [1, 3], [0, 2], [2, 4], diff --git a/fmpose/lib/preprocess.py b/fmpose3d/lib/preprocess.py similarity index 100% rename from fmpose/lib/preprocess.py rename to fmpose3d/lib/preprocess.py diff --git a/fmpose/lib/sort/__init__.py b/fmpose3d/lib/sort/__init__.py similarity index 100% rename from fmpose/lib/sort/__init__.py rename to fmpose3d/lib/sort/__init__.py diff --git a/fmpose/lib/sort/sort.py b/fmpose3d/lib/sort/sort.py similarity index 100% rename from fmpose/lib/sort/sort.py rename to fmpose3d/lib/sort/sort.py diff --git a/fmpose/lib/yolov3/__init__.py b/fmpose3d/lib/yolov3/__init__.py similarity index 100% rename from fmpose/lib/yolov3/__init__.py rename to fmpose3d/lib/yolov3/__init__.py diff --git a/fmpose/lib/yolov3/bbox.py b/fmpose3d/lib/yolov3/bbox.py similarity index 100% rename from fmpose/lib/yolov3/bbox.py rename to fmpose3d/lib/yolov3/bbox.py diff --git a/fmpose/lib/yolov3/cfg/tiny-yolo-voc.cfg b/fmpose3d/lib/yolov3/cfg/tiny-yolo-voc.cfg similarity index 100% rename from fmpose/lib/yolov3/cfg/tiny-yolo-voc.cfg rename to fmpose3d/lib/yolov3/cfg/tiny-yolo-voc.cfg diff --git a/fmpose/lib/yolov3/cfg/yolo-voc.cfg b/fmpose3d/lib/yolov3/cfg/yolo-voc.cfg similarity index 100% rename from fmpose/lib/yolov3/cfg/yolo-voc.cfg rename to fmpose3d/lib/yolov3/cfg/yolo-voc.cfg diff --git a/fmpose/lib/yolov3/cfg/yolo.cfg b/fmpose3d/lib/yolov3/cfg/yolo.cfg similarity index 100% rename from fmpose/lib/yolov3/cfg/yolo.cfg rename to fmpose3d/lib/yolov3/cfg/yolo.cfg diff --git a/fmpose/lib/yolov3/cfg/yolov3.cfg b/fmpose3d/lib/yolov3/cfg/yolov3.cfg similarity index 100% rename from fmpose/lib/yolov3/cfg/yolov3.cfg rename to fmpose3d/lib/yolov3/cfg/yolov3.cfg diff --git a/fmpose/lib/yolov3/darknet.py b/fmpose3d/lib/yolov3/darknet.py similarity index 99% rename from fmpose/lib/yolov3/darknet.py rename to fmpose3d/lib/yolov3/darknet.py index 36e73d83..c16753cb 100755 --- a/fmpose/lib/yolov3/darknet.py +++ b/fmpose3d/lib/yolov3/darknet.py @@ -8,8 +8,8 @@ import os import sys -from fmpose.lib.yolov3.util import convert2cpu as cpu -from fmpose.lib.yolov3.util import predict_transform +from fmpose3d.lib.yolov3.util import convert2cpu as cpu +from fmpose3d.lib.yolov3.util import predict_transform class test_net(nn.Module): diff --git a/fmpose/lib/yolov3/data/coco.names b/fmpose3d/lib/yolov3/data/coco.names similarity index 100% rename from fmpose/lib/yolov3/data/coco.names rename to fmpose3d/lib/yolov3/data/coco.names diff --git a/fmpose/lib/yolov3/data/pallete b/fmpose3d/lib/yolov3/data/pallete similarity index 100% rename from fmpose/lib/yolov3/data/pallete rename to fmpose3d/lib/yolov3/data/pallete diff --git a/fmpose/lib/yolov3/data/voc.names b/fmpose3d/lib/yolov3/data/voc.names similarity index 100% rename from fmpose/lib/yolov3/data/voc.names rename to fmpose3d/lib/yolov3/data/voc.names diff --git a/fmpose/lib/yolov3/human_detector.py b/fmpose3d/lib/yolov3/human_detector.py similarity index 96% rename from fmpose/lib/yolov3/human_detector.py rename to fmpose3d/lib/yolov3/human_detector.py index 911b22ed..7783093a 100755 --- a/fmpose/lib/yolov3/human_detector.py +++ b/fmpose3d/lib/yolov3/human_detector.py @@ -9,10 +9,10 @@ import pickle as pkl import argparse -from fmpose.lib.yolov3.util import * -from fmpose.lib.yolov3.darknet import Darknet -from fmpose.lib.yolov3 import preprocess -from fmpose.lib.checkpoint.download_checkpoints import get_checkpoint_path +from fmpose3d.lib.yolov3.util import * +from fmpose3d.lib.yolov3.darknet import Darknet +from fmpose3d.lib.yolov3 import preprocess +from fmpose3d.lib.checkpoint.download_checkpoints import get_checkpoint_path cur_dir = os.path.dirname(os.path.realpath(__file__)) project_root = os.path.join(cur_dir, '../../../') diff --git a/fmpose/lib/yolov3/preprocess.py b/fmpose3d/lib/yolov3/preprocess.py similarity index 100% rename from fmpose/lib/yolov3/preprocess.py rename to fmpose3d/lib/yolov3/preprocess.py diff --git a/fmpose/lib/yolov3/util.py b/fmpose3d/lib/yolov3/util.py similarity index 98% rename from fmpose/lib/yolov3/util.py rename to fmpose3d/lib/yolov3/util.py index fd990ca7..b6cbd1bd 100755 --- a/fmpose/lib/yolov3/util.py +++ b/fmpose3d/lib/yolov3/util.py @@ -4,8 +4,8 @@ import numpy as np import cv2 import os.path as osp -from fmpose.lib.yolov3.bbox import bbox_iou -from fmpose.lib.checkpoint.download_checkpoints import get_checkpoint_dir +from fmpose3d.lib.yolov3.bbox import bbox_iou +from fmpose3d.lib.checkpoint.download_checkpoints import get_checkpoint_dir def get_path(cur_file): diff --git a/fmpose/models/__init__.py b/fmpose3d/models/__init__.py similarity index 100% rename from fmpose/models/__init__.py rename to fmpose3d/models/__init__.py diff --git a/fmpose/models/graph_frames.py b/fmpose3d/models/graph_frames.py similarity index 100% rename from fmpose/models/graph_frames.py rename to fmpose3d/models/graph_frames.py diff --git a/fmpose/models/model_GAMLP.py b/fmpose3d/models/model_GAMLP.py similarity index 99% rename from fmpose/models/model_GAMLP.py rename to fmpose3d/models/model_GAMLP.py index 13569fdc..4ea7d4ef 100644 --- a/fmpose/models/model_GAMLP.py +++ b/fmpose3d/models/model_GAMLP.py @@ -4,7 +4,7 @@ import torch.nn as nn import math from einops import rearrange -from fmpose.models.graph_frames import Graph +from fmpose3d.models.graph_frames import Graph from functools import partial from einops import rearrange, repeat from timm.models.layers import DropPath diff --git a/pyproject.toml b/pyproject.toml index 8d2480a5..0cda58cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ include = ["fmpose*"] "*" = ["*.yaml", "*.cfg", "*.names"] [tool.setuptools.dynamic] -version = {attr = "fmpose.__version__"} +version = {attr = "fmpose3d.__version__"} [tool.black] line-length = 100 diff --git a/scripts/FMPose3D_main.py b/scripts/FMPose3D_main.py index 9ce3a6e5..8140f909 100644 --- a/scripts/FMPose3D_main.py +++ b/scripts/FMPose3D_main.py @@ -9,10 +9,10 @@ import torch.optim as optim from tqdm import tqdm -from fmpose.common import opts, Human36mDataset, Fusion -from fmpose.common.utils import * +from fmpose3d.common import opts, Human36mDataset, Fusion +from fmpose3d.common.utils import * -from fmpose.aggregation_methods import aggregation_RPEA_weighted_by_2D_error +from fmpose3d.aggregation_methods import aggregation_RPEA_weighted_by_2D_error args = opts().parse() os.environ["CUDA_VISIBLE_DEVICES"] = args.gpu @@ -33,7 +33,7 @@ CFM = getattr(module, "Model") else: # Load model from installed fmpose package - from fmpose.models import Model as CFM + from fmpose3d.models import Model as CFM def test_multi_hypothesis( diff --git a/tests/test_demo_human.py b/tests/test_demo_human.py index 9fbf893e..ae9b582d 100644 --- a/tests/test_demo_human.py +++ b/tests/test_demo_human.py @@ -25,8 +25,8 @@ def test_output_dir(tmp_path): def test_2d_pose_estimation(test_image_path, test_output_dir): """Test that 2D pose estimation runs and produces output.""" # Import here to avoid import issues at collection time - from fmpose.lib.hrnet.gen_kpts import gen_video_kpts as hrnet_pose - from fmpose.lib.preprocess import h36m_coco_format, revise_kpts + from fmpose3d.lib.hrnet.gen_kpts import gen_video_kpts as hrnet_pose + from fmpose3d.lib.preprocess import h36m_coco_format, revise_kpts # Run 2D pose estimation keypoints, scores = hrnet_pose(test_image_path, det_dim=416, num_peroson=1, gen_output=True, type='image') @@ -52,9 +52,9 @@ def test_2d_pose_estimation(test_image_path, test_output_dir): def test_demo_pipeline_runs(test_image_path): """Test that the full demo pipeline can be imported and key components work.""" # Test imports - from fmpose.lib.hrnet.gen_kpts import gen_video_kpts - from fmpose.lib.preprocess import h36m_coco_format, revise_kpts - from fmpose.models import Model + from fmpose3d.lib.hrnet.gen_kpts import gen_video_kpts + from fmpose3d.lib.preprocess import h36m_coco_format, revise_kpts + from fmpose3d.models import Model assert gen_video_kpts is not None assert h36m_coco_format is not None diff --git a/tests/test_model.py b/tests/test_model.py index 0ccec900..90a1541c 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -1,6 +1,6 @@ import pytest import torch -from fmpose.models import Model +from fmpose3d.models import Model class Args: """Mock args for model configuration.""" diff --git a/tests/test_training_pipeline.py b/tests/test_training_pipeline.py index 2dfb9ffb..5c5b8c1d 100644 --- a/tests/test_training_pipeline.py +++ b/tests/test_training_pipeline.py @@ -1,7 +1,7 @@ import pytest import torch import torch.optim as optim -from fmpose.models import Model +from fmpose3d.models import Model class Args: From 86ff2fd9f41ad9be3efc3264373a92b0c3f55c74 Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 21:52:04 +0100 Subject: [PATCH 07/15] Update version to 0.0.1 and rename aggregation method to 'aggregation_RPEA_joint_level' --- fmpose3d/__init__.py | 6 +++--- fmpose3d/aggregation_methods.py | 2 +- scripts/FMPose3D_main.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fmpose3d/__init__.py b/fmpose3d/__init__.py index 2ef5e312..db93a0e6 100644 --- a/fmpose3d/__init__.py +++ b/fmpose3d/__init__.py @@ -7,7 +7,7 @@ Licensed under Apache 2.0 """ -__version__ = "0.0.5" +__version__ = "0.0.1" __author__ = "Ti Wang, Xiaohang Yu, Mackenzie Weygandt Mathis" __license__ = "Apache 2.0" @@ -15,7 +15,7 @@ from .aggregation_methods import ( average_aggregation, aggregation_select_single_best_hypothesis_by_2D_error, - aggregation_RPEA_weighted_by_2D_error, + aggregation_RPEA_joint_level, ) # Import 2D pose detection utilities @@ -27,7 +27,7 @@ # Aggregation methods "average_aggregation", "aggregation_select_single_best_hypothesis_by_2D_error", - "aggregation_RPEA_weighted_by_2D_error", + "aggregation_RPEA_joint_level", # 2D pose detection "gen_video_kpts", "h36m_coco_format", diff --git a/fmpose3d/aggregation_methods.py b/fmpose3d/aggregation_methods.py index 80a651cb..928adec1 100644 --- a/fmpose3d/aggregation_methods.py +++ b/fmpose3d/aggregation_methods.py @@ -87,7 +87,7 @@ def aggregation_select_single_best_hypothesis_by_2D_error(args, return agg -def aggregation_RPEA_weighted_by_2D_error( +def aggregation_RPEA_joint_level( args, list_hypothesis, batch_cam, input_2D, gt_3D, topk=3 ): """ diff --git a/scripts/FMPose3D_main.py b/scripts/FMPose3D_main.py index 8140f909..d155c837 100644 --- a/scripts/FMPose3D_main.py +++ b/scripts/FMPose3D_main.py @@ -12,7 +12,7 @@ from fmpose3d.common import opts, Human36mDataset, Fusion from fmpose3d.common.utils import * -from fmpose3d.aggregation_methods import aggregation_RPEA_weighted_by_2D_error +from fmpose3d.aggregation_methods import aggregation_RPEA_joint_level args = opts().parse() os.environ["CUDA_VISIBLE_DEVICES"] = args.gpu @@ -121,7 +121,7 @@ def euler_sample(x2d, y_local, steps): output_3D_s[:, :, 0, :] = 0 list_hypothesis.append(output_3D_s) - output_3D_s = aggregation_RPEA_weighted_by_2D_error(args, + output_3D_s = aggregation_RPEA_joint_level(args, list_hypothesis, batch_cam, input_2D_nonflip, gt_3D, args.topk ) From 72209fc76ba3d2381f9857baaf7589ce5126ec92 Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 22:22:52 +0100 Subject: [PATCH 08/15] Update license description in pyproject.toml from 'Apache 2.0' to 'Apache Software License' --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0cda58cd..af3810a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ keywords = ["pose estimation", "3D pose", "flow matching", "computer vision"] classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", - "License :: OSI Approved :: Apache 2.0", + "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering :: Artificial Intelligence", From 09e5cc83c29121acdca7620a1e961c1717091ebc Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 22:23:05 +0100 Subject: [PATCH 09/15] Update version to 0.0.4 in __init__.py --- fmpose3d/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmpose3d/__init__.py b/fmpose3d/__init__.py index db93a0e6..35457664 100644 --- a/fmpose3d/__init__.py +++ b/fmpose3d/__init__.py @@ -7,7 +7,7 @@ Licensed under Apache 2.0 """ -__version__ = "0.0.1" +__version__ = "0.0.4" __author__ = "Ti Wang, Xiaohang Yu, Mackenzie Weygandt Mathis" __license__ = "Apache 2.0" From 2105290f8c6df960b2ac9b5d3bbcfd16e1e170a8 Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 22:44:58 +0100 Subject: [PATCH 10/15] Update model path in test_animal3d.sh to point to the pre-trained weights for animal3d --- animals/scripts/test_animal3d.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animals/scripts/test_animal3d.sh b/animals/scripts/test_animal3d.sh index 65b61779..3c858854 100644 --- a/animals/scripts/test_animal3d.sh +++ b/animals/scripts/test_animal3d.sh @@ -11,7 +11,7 @@ n_joints=26 out_joints=26 epochs=300 # model_path='models/model_animals.py' -model_path="" # when the path is empty, the model will be loaded from the installed fmpose package +model_path='./pre_trained_models/animal3d_pretrained_weights/model_animal3d.py' # when the path is empty, the model will be loaded from the installed fmpose package saved_model_path='./pre_trained_models/animal3d_pretrained_weights/CFM_154_4403_best.pth' # root path denotes the path to the original dataset root_path="./dataset/" From e8d146b4be1043ca8d0a201e58a667c900e15ff8 Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 23:00:58 +0100 Subject: [PATCH 11/15] Update model path in vis_animals.sh to reference pre-trained weights for animal3d --- animals/demo/vis_animals.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animals/demo/vis_animals.sh b/animals/demo/vis_animals.sh index 66a7f0b9..38793919 100644 --- a/animals/demo/vis_animals.sh +++ b/animals/demo/vis_animals.sh @@ -7,7 +7,7 @@ sh_file='vis_animals.sh' # n_joints=26 # out_joints=26 -model_path='../../fmpose/animals/models/model_animal3d.py' +model_path='../pre_trained_models/animal3d_pretrained_weights/model_animal3d.py' saved_model_path='../pre_trained_models/animal3d_pretrained_weights/CFM_154_4403_best.pth' # path='./images/image_00068.jpg' # single image From ea2d711074ddf07ebf098bc81c76822405a8cf48 Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 23:16:02 +0100 Subject: [PATCH 12/15] update version --- fmpose3d/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmpose3d/__init__.py b/fmpose3d/__init__.py index 35457664..8a9a4716 100644 --- a/fmpose3d/__init__.py +++ b/fmpose3d/__init__.py @@ -7,7 +7,7 @@ Licensed under Apache 2.0 """ -__version__ = "0.0.4" +__version__ = "0.0.7" __author__ = "Ti Wang, Xiaohang Yu, Mackenzie Weygandt Mathis" __license__ = "Apache 2.0" From 05ea0c87c9483f7a904a5daabfcc5121d3bbf032 Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 23:16:26 +0100 Subject: [PATCH 13/15] Update numpy dependency to allow versions >=1.18.5 and add pandas and deeplabcut as new dependencies in pyproject.toml --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index af3810a4..bd3e8a0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "torchvision==0.19.1", "timm>=1.0.0", "einops==0.4.0", - "numpy==2.1.1", + "numpy>=1.18.5,<2.0", "tqdm>=4.60.0", "scipy>=1.7.0", "yacs>=0.1.8", @@ -36,6 +36,8 @@ dependencies = [ "numba>=0.56.0", "scikit-image>=0.19.0", "filterpy>=1.4.5", + "pandas>=1.0.1", + "deeplabcut==3.0.0rc13", ] [project.optional-dependencies] From 89cba15db7e3353b7e750e428c26582f35334d21 Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 23:16:35 +0100 Subject: [PATCH 14/15] Update installation command in README.md to specify fmpose3d version 0.0.7 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f17f6de..e56521d3 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ conda activate fmpose_3d ```bash git clone xxxx.git # clone this repo # TestPyPI (pre-release/testing build) -pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ fmpose3d==0.0.5 +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ fmpose3d==0.0.7 # Future Official PyPI release # pip install fmpose3d ``` From e552070945dbb819ef29416fca82471d1b52a1ee Mon Sep 17 00:00:00 2001 From: ti Date: Mon, 2 Feb 2026 23:21:21 +0100 Subject: [PATCH 15/15] Update installation command in README.md to specify fmpose3d version 0.0.7 --- dataset/readme.txt | 1 + 1 file changed, 1 insertion(+) create mode 100755 dataset/readme.txt diff --git a/dataset/readme.txt b/dataset/readme.txt new file mode 100755 index 00000000..336d5ad7 --- /dev/null +++ b/dataset/readme.txt @@ -0,0 +1 @@ +Download the preprocessed datasets from [here](https://drive.google.com/drive/folders/112GPdRC9IEcwcJRyrLJeYw9_YV4wLdKC?usp=sharing) and place them in this folder. \ No newline at end of file