Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2f69e4e
Add Makefile for Docker build and run management
xiu-cs Apr 6, 2026
530a886
Add Dockerfile for FMPose3D environment setup
xiu-cs Apr 6, 2026
43aef6e
Ensure checkpoints are downloaded only when HRNet is requested in gen…
xiu-cs Apr 6, 2026
bb79602
Update FMPose3D_test.sh to allow optional local model weights
xiu-cs Apr 6, 2026
d66a0a0
Update vis_in_the_wild.sh to allow optional local model weights
xiu-cs Apr 6, 2026
c43b46b
Enhance model weight loading in vis_in_the_wild.py to support automat…
xiu-cs Apr 6, 2026
74d2dab
Enhance FMPose3D_main.py to support automatic downloading of model we…
xiu-cs Apr 7, 2026
30eb7fc
Refactor model weight loading in vis_in_the_wild.py to utilize resolv…
xiu-cs Apr 7, 2026
53aefde
Refactor model weight loading in FMPose3D_main.py to utilize resolve_…
xiu-cs Apr 7, 2026
1ff5d01
Refactor FMPose3D to import Hugging Face repository ID from utils. Th…
xiu-cs Apr 7, 2026
8768cc4
Add utility for resolving and downloading FMPose3D model weights
xiu-cs Apr 7, 2026
ce1c4f0
Add __init__.py file to utils directory for FMPose3D
xiu-cs Apr 7, 2026
e122e51
add header
xiu-cs Apr 7, 2026
3d1253a
add header
xiu-cs Apr 7, 2026
ec10769
Update test for SuperAnimalPrediction to handle ImportError for missi…
xiu-cs Apr 7, 2026
6254cc8
Fix typo: num_peroson -> num_person in gen_kpts.py and call sites
Copilot Apr 7, 2026
d6e1fdb
Remove build_production target from Makefile and update help message …
xiu-cs Apr 7, 2026
3bb81e5
Fix typos in comments for clarity in lifter3d.py, correcting "matrics…
xiu-cs Apr 7, 2026
f1631c9
Remove temporary weights validation sentinel from fmpose3d.py, stream…
xiu-cs Apr 7, 2026
962f395
Fix typo in comment of bbox.py, correcting "corrdinates" to "coordina…
xiu-cs Apr 7, 2026
09ce42f
Fix typo in comment of darknet.py, correcting "anotation" to "annotat…
xiu-cs Apr 7, 2026
94b5100
Fix typos in comments for clarity in human_detector.py, correcting "a…
xiu-cs Apr 7, 2026
b2151a6
Remove unused import of plot_keypoint and write from gen_kpts.py, str…
xiu-cs Apr 7, 2026
ef803e7
Fix typos in comments for clarity in utils.py, correcting "origial" t…
xiu-cs Apr 7, 2026
bdd95b1
Fix typo in animal3d_dataset.py, correcting "hight" to "height" for i…
xiu-cs Apr 7, 2026
6107a7a
Fix typos in comments for clarity in utils.py, correcting "origial" t…
xiu-cs Apr 7, 2026
2b1626d
Remove unused functions plot_keypoint, write, and load_json from util…
xiu-cs Apr 7, 2026
c944d25
Add testpaths configuration to pytest in pyproject.toml for improved …
xiu-cs Apr 7, 2026
e185185
Update Dockerfile to install FMPose3D from GitHub instead of PyPI, en…
xiu-cs Apr 7, 2026
11ab3d3
Update HF_REPO_ID
xiu-cs Apr 7, 2026
2f5f771
Update README.md to clarify pre-trained model setup, highlighting aut…
xiu-cs Apr 7, 2026
52c2497
fix test_hugginface.py: change huggingface repo ID (use centralized c…
deruyter92 Apr 8, 2026
89ff316
Refactor vis_in_the_wild.py: remove redundant import of resolve_weigh…
xiu-cs Apr 8, 2026
9f46de8
Update Dockerfile
xiu-cs Apr 9, 2026
478abcd
Update Makefile
xiu-cs Apr 9, 2026
8098412
Update Makefile
xiu-cs Apr 9, 2026
1eb00b4
Update Makefile
xiu-cs Apr 9, 2026
8b402c3
Refactor FMPose3D_main.py: move import of resolve_weights_path to the…
xiu-cs Apr 9, 2026
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
64 changes: 64 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
FROM pytorch/pytorch:2.4.1-cuda12.4-cudnn9-runtime

ARG USERNAME=fmpose3d
ARG USER_UID=1000
ARG USER_GID=1000
RUN groupadd ${USERNAME} --gid ${USER_GID}
RUN useradd -m -s /bin/bash -g ${USERNAME} -u ${USER_UID} ${USERNAME}
Comment on lines +6 to +7
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be safe, you could change this to the below suggestion, since the current command may fail if the user allready exists (e.g. in the parent image). But I don't expect that this is a realistic scenario, so you can also keep yours, for better readability.

Suggested change
RUN groupadd ${USERNAME} --gid ${USER_GID}
RUN useradd -m -s /bin/bash -g ${USERNAME} -u ${USER_UID} ${USERNAME}
RUN set -eux; \
if getent group "${USER_GID}" >/dev/null; then \
GROUP_NAME="$(getent group "${USER_GID}" | cut -d: -f1)"; \
else \
groupadd --gid "${USER_GID}" "${USERNAME}"; \
GROUP_NAME="${USERNAME}"; \
fi; \
if id -u "${USER_UID}" >/dev/null 2>&1; then \
EXISTING_USER="$(getent passwd "${USER_UID}" | cut -d: -f1)"; \
usermod -l "${USERNAME}" "${EXISTING_USER}" || true; \
usermod -d "/home/${USERNAME}" -m "${USERNAME}" || true; \
usermod -g "${GROUP_NAME}" "${USERNAME}" || true; \
else \
useradd -m -s /bin/bash -u "${USER_UID}" -g "${GROUP_NAME}" "${USERNAME}"; \
fi

RUN mkdir /app /logs /data

ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
RUN apt-get update -y && apt-get install -yy --no-install-recommends \
vim zsh tmux wget curl htop git sudo ssh git-lfs \
python3 python3-pip \
libgl1-mesa-glx libglib2.0-0 \
ffmpeg \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

ENV PATH="/opt/conda/bin:${PATH}"

# Initialize conda for root just in case and fix symlinks
RUN ln -fs /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh

# --- Install FMPose3D from PyPI (as documented in README) ---
RUN python -m pip install --no-cache-dir --upgrade pip && \
python -m pip install --no-cache-dir "fmpose3d[animals,viz]" gdown

# Allow non-root user to download DLC model weights at runtime
RUN mkdir -p /opt/conda/lib/python3.11/site-packages/deeplabcut/modelzoo/checkpoints && \
chown -R ${USERNAME}:${USERNAME} /opt/conda/lib/python3.11/site-packages/deeplabcut/modelzoo
Comment thread
xiu-cs marked this conversation as resolved.
Outdated

# Set your user as owner of the home directory before switching
RUN chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}

ENV NVIDIA_DRIVER_CAPABILITIES=all

# --- SWITCH TO USER ---
USER ${USERNAME}
ENV HOME=/home/${USERNAME}
WORKDIR ${HOME}

# Ensure dotfiles exist
RUN touch ${HOME}/.bashrc ${HOME}/.zshrc && \
chmod 644 ${HOME}/.bashrc ${HOME}/.zshrc

# Install Oh My Zsh and plugins (MUST come before conda init, since OMZ overwrites .zshrc)
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended \
&& git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
&& sed -i 's/^plugins=(.*)$/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc \
&& echo "export PATH=\$PATH:${HOME}/.local/bin" >> ~/.zshrc

# Initialize conda AFTER Oh My Zsh (so conda init block is not overwritten)
RUN /opt/conda/bin/conda init bash && /opt/conda/bin/conda init zsh

# Add conda activation to bashrc and zshrc
RUN echo "conda activate base" >> ${HOME}/.bashrc && \
echo "conda activate base" >> ${HOME}/.zshrc

SHELL ["/bin/zsh", "-c"]
CMD ["zsh"]
79 changes: 79 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# [USER: ADJUST PATH]
PROJECT_NAME := fmpose3d
project_name_lo := $(shell echo $(PROJECT_NAME) | tr '[:upper:]' '[:lower:]')
Comment thread
xiu-cs marked this conversation as resolved.
Outdated
#######
# RUN #
#######

# for local server
IMG_NAME := fmpose3d
IMG_TAG := v0.1
DOCKERFILE := Dockerfile
HOST_UID := $(shell id -u)
HOST_GID := $(shell id -g)
Comment thread
xiu-cs marked this conversation as resolved.
Outdated
BUILD_ARGS := \
--build-arg USERNAME=fmpose3d \
--build-arg USER_GID=$(HOST_GID) \
--build-arg USER_UID=$(HOST_UID)

build:
docker build $(BUILD_ARGS) \
-t $(IMG_NAME):$(IMG_TAG) -f $(DOCKERFILE) .

build-clean:
docker build --no-cache $(BUILD_ARGS) \
-t $(IMG_NAME):$(IMG_TAG) -f $(DOCKERFILE) .


CONTAINER_NAME := fmpose3d_dev1
# [USER: ADJUST] Mount the project root into the container
HOST_SRC := $(shell pwd)
DOCKER_SRC := /fmpose3d
VOLUMES := \
--volume $(HOST_SRC):$(DOCKER_SRC)
Comment thread
xiu-cs marked this conversation as resolved.
Outdated


run:
docker run -it --gpus all --shm-size=64g --name $(CONTAINER_NAME) -w $(DOCKER_SRC) $(VOLUMES) $(IMG_NAME):$(IMG_TAG)

exec:
docker exec -it -w $(DOCKER_SRC) $(CONTAINER_NAME) /bin/zsh

exec_bash:
docker exec -it -w $(DOCKER_SRC) $(CONTAINER_NAME) /bin/bash

stop:
docker stop $(CONTAINER_NAME)

rm:
docker rm $(CONTAINER_NAME)


#######################
# BUILD CORE WITH SRC #
#######################
# [USER: ADJUST SRC PATH]
SRC_PATH="/home/user/project"
build_production:
cp -r $(SRC_PATH) src
docker build $(BUILD_ARGS) --build-arg src=src \
-t $(IMG_NAME):$(IMG_TAG) -f $(DOCKERFILE) .
rm -r src

# Help message
help:
@echo "Available targets:"
@echo " build - Build Docker image for local server."
@echo " run - Run a Docker container with GPU."
@echo " exec - Attach to running container (zsh)."
@echo " exec_bash - Attach to running container (bash)."
@echo " stop - Stop the running container."
@echo " rm - Remove the stopped container."
@echo " build_production - Build a Docker image with source code."
@echo " help - Show this help message."
@echo ""
@echo "Usage:"
@echo " 1. make build"
@echo " 2. make run"
@echo " 3. Inside container: pip install -e '.[animals,viz]'"
@echo " 4. Inside container: sh scripts/FMPose3D_train.sh"
Comment on lines +65 to +66
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the dockerfile allready installs fmpose, right?

Suggested change
@echo " 3. Inside container: pip install -e '.[animals,viz]'"
@echo " 4. Inside container: sh scripts/FMPose3D_train.sh"
@echo " 3. Inside container: sh scripts/FMPose3D_train.sh"

8 changes: 5 additions & 3 deletions demo/vis_in_the_wild.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def show3Dpose(vals, ax):
def get_pose2D(path, output_dir, type):

print('\nGenerating 2D pose...')
keypoints, scores = hrnet_pose(path, det_dim=416, num_peroson=1, gen_output=True, type=type)
keypoints, scores = hrnet_pose(path, det_dim=416, num_person=1, gen_output=True, type=type)
keypoints, scores, valid_frames = h36m_coco_format(keypoints, scores)
re_kpts = revise_kpts(keypoints, scores, valid_frames)
print('Generating 2D pose successful!')
Expand Down Expand Up @@ -278,8 +278,10 @@ def get_pose3D(path, output_dir, type='image'):

# if args.reload:
model_dict = model['CFM'].state_dict()
model_path = args.model_weights_path
print(model_path)
from fmpose3d.utils.weights import resolve_weights_path
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to move to the top, unless you intentionally want it to load only locally in this function ('lazy loading'). But since it is a lighweight import I don't think it provides a real benefit to keep it here.

model_path = resolve_weights_path(args.model_weights_path, args.model_type)

print(f"Loading weights from: {model_path}")
pre_dict = torch.load(model_path, map_location=device, weights_only=True)
for name, key in model_dict.items():
model_dict[name] = pre_dict[name]
Expand Down
6 changes: 5 additions & 1 deletion demo/vis_in_the_wild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ batch_size=1
sh_file='vis_in_the_wild.sh'

model_type='fmpose3d_humans'
model_weights_path='../pre_trained_models/fmpose3d_h36m/FMpose3D_pretrained_weights.pth'

# By default, weights are automatically downloaded from Hugging Face Hub.
# To use local weights instead, uncomment the line below:
# model_weights_path='../pre_trained_models/fmpose3d_h36m/FMpose3D_pretrained_weights.pth'
model_weights_path=''

target_path='./images/' # folder containing multiple images
# target_path='./images/xx.png' # single image
Expand Down
3 changes: 1 addition & 2 deletions fmpose3d/inference_api/fmpose3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
ProgressCallback = Callable[[int, int], None]


#: HuggingFace repository hosting the official FMPose3D checkpoints.
_HF_REPO_ID: str = "deruyter92/fmpose_temp"
from fmpose3d.utils.weights import HF_REPO_ID as _HF_REPO_ID
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix, thanks! Maybe just move it to the import block with the other from fmpose3d ... imports.


# Default camera-to-world rotation quaternion (from the demo script).
_DEFAULT_CAM_ROTATION = np.array(
Expand Down
20 changes: 11 additions & 9 deletions fmpose3d/lib/hrnet/gen_kpts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

# Auto-download checkpoints if missing and get checkpoint paths
from fmpose3d.lib.checkpoint.download_checkpoints import ensure_checkpoints, get_checkpoint_path
ensure_checkpoints()

# Loading human detector model
from fmpose3d.lib.yolov3.human_detector import load_model as yolo_model
Expand Down Expand Up @@ -100,7 +99,7 @@ def model_load(config):

return model

def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=416, num_peroson=1, gen_output=False):
def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=416, num_person=1, gen_output=False):

bboxs, scores = yolo_det(frame, human_model, reso=det_dim, confidence=args.thred_score)
if bboxs is None or not bboxs.any():
Expand All @@ -118,7 +117,7 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41
if people_track.shape[0] == 1:
people_track_ = people_track[-1, :-1].reshape(1, 4)
elif people_track.shape[0] >= 2:
people_track_ = people_track[-num_peroson:, :-1].reshape(num_peroson, 4)
people_track_ = people_track[-num_person:, :-1].reshape(num_person, 4)
people_track_ = people_track_[::-1]
else:
return [], []
Expand All @@ -130,7 +129,7 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41

with torch.no_grad():
# bbox is coordinate location
inputs, origin_img, center, scale = PreProcess(frame, track_bboxs, cfg, num_peroson)
inputs, origin_img, center, scale = PreProcess(frame, track_bboxs, cfg, num_person)

inputs = inputs[:, [2, 1, 0]]

Expand All @@ -141,8 +140,8 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41
# compute coordinate
preds, maxvals = get_final_preds(cfg, output.clone().cpu().numpy(), np.asarray(center), np.asarray(scale))

kpts = np.zeros((num_peroson, 17, 2), dtype=np.float32)
scores = np.zeros((num_peroson, 17), dtype=np.float32)
kpts = np.zeros((num_person, 17, 2), dtype=np.float32)
scores = np.zeros((num_person, 17), dtype=np.float32)
for i, kpt in enumerate(preds):
kpts[i] = kpt

Expand All @@ -152,7 +151,10 @@ def gen_from_image(args, frame, people_sort, human_model, pose_model, det_dim=41
return kpts, scores


def gen_video_kpts(path, det_dim=416, num_peroson=1, gen_output=False, type='image'):
def gen_video_kpts(path, det_dim=416, num_person=1, gen_output=False, type='image'):
# Ensure checkpoints are downloaded only when HRNet is actually requested
ensure_checkpoints()

# Updating configuration
args1 = parse_args()
reset_config(args1)
Expand All @@ -166,7 +168,7 @@ def gen_video_kpts(path, det_dim=416, num_peroson=1, gen_output=False, type='ima
scores_result = []
if type == "image":
frame = cv2.imread(path)
kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_peroson=num_peroson, gen_output=gen_output)
kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_person=num_person, gen_output=gen_output)
kpts_result.append(kpts)
scores_result.append(scores)

Expand All @@ -178,7 +180,7 @@ def gen_video_kpts(path, det_dim=416, num_peroson=1, gen_output=False, type='ima
if not ret:
continue

kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_peroson=num_peroson, gen_output=gen_output)
kpts, scores = gen_from_image(args1, frame, people_sort, human_model, pose_model, det_dim=det_dim, num_person=num_person, gen_output=gen_output)
kpts_result.append(kpts)
scores_result.append(scores)

Expand Down
8 changes: 8 additions & 0 deletions fmpose3d/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
FMPose3D: monocular 3D Pose Estimation via Flow Matching

Official implementation of the paper:
"FMPose3D: monocular 3D Pose Estimation via Flow Matching"
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
Licensed under Apache 2.0
"""
49 changes: 49 additions & 0 deletions fmpose3d/utils/weights.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"""
FMPose3D: monocular 3D Pose Estimation via Flow Matching

Official implementation of the paper:
"FMPose3D: monocular 3D Pose Estimation via Flow Matching"
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
Licensed under Apache 2.0
"""

"""Shared helpers for resolving / downloading FMPose3D model weights."""
Comment on lines +8 to +10
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""
"""Shared helpers for resolving / downloading FMPose3D model weights."""
Shared helpers for resolving / downloading FMPose3D model weights.
"""


HF_REPO_ID: str = "deruyter92/fmpose_temp"


def resolve_weights_path(model_weights_path: str, model_type: str) -> str:
"""Return a local weights path, downloading from Hugging Face Hub if needed.

Parameters
----------
model_weights_path : str
User-supplied local path. If falsy the weights are fetched from the
Hugging Face Hub automatically.
model_type : str
Model variant name used to derive the remote filename
(e.g. ``"fmpose3d_humans"`` -> ``fmpose3d_humans.pth``).

Returns
-------
str
Absolute path to the weight file on disk.
"""
if model_weights_path:
return model_weights_path
Comment on lines +32 to +33
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider some validation, to avoid difficult-to-debug downstream errors:

Suggested change
if model_weights_path:
return model_weights_path
def _validate_local_path(fn: str)
p = Path(fn).expanduser().resolve()
if not p.exists():
raise FileNotFoundError(f"Model weights path does not exist: {p}")
if not p.is_file():
raise ValueError(f"Model weights path is not a file: {p}")
if p.suffix.lower() != ".pth":
raise ValueError(f"Expected a .pth checkpoint file, got: {p}")
if model_weights_path:
_validate_local_path(model_weights_path)
return model_weights_path


try:
from huggingface_hub import hf_hub_download
except ImportError:
raise ImportError(
"huggingface_hub is required to download model weights. "
"Install it with: pip install huggingface_hub\n"
"Or download the weights manually and pass the local path."
) from None

filename = f"{model_type}.pth"
print(
f"No local weights path specified. "
f"Downloading '{filename}' from Hugging Face ({HF_REPO_ID})..."
)
return hf_hub_download(repo_id=HF_REPO_ID, filename=filename)
12 changes: 9 additions & 3 deletions scripts/FMPose3D_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ def print_error_action(action_error_sum, is_train):
args.checkpoint = "./checkpoint/" + folder_name
elif args.train == False:
# create a new folder for the test results
args.previous_dir = os.path.dirname(args.model_weights_path)
if args.model_weights_path:
args.previous_dir = os.path.dirname(args.model_weights_path)
else:
# HuggingFace-downloaded weights: no local dir, use ./checkpoint/
args.previous_dir = "./checkpoint"
args.checkpoint = os.path.join(args.previous_dir, folder_name)

if not os.path.exists(args.checkpoint):
Expand Down Expand Up @@ -337,8 +341,10 @@ def print_error_action(action_error_sum, is_train):

if args.reload:
model_dict = model["CFM"].state_dict()
model_path = args.model_weights_path
print(model_path)
from fmpose3d.utils.weights import resolve_weights_path
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider moving this to the top.

model_path = resolve_weights_path(args.model_weights_path, args.model_type)

print(f"Loading weights from: {model_path}")
pre_dict = torch.load(model_path, map_location=device, weights_only=True)
for name, key in model_dict.items():
model_dict[name] = pre_dict[name]
Expand Down
6 changes: 5 additions & 1 deletion scripts/FMPose3D_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ exp_temp=0.005
folder_name=test_s${eval_multi_steps}_${mode}_h${num_hypothesis_list}_$(date +%Y%m%d_%H%M%S)

model_type='fmpose3d_humans'
model_weights_path='./pre_trained_models/fmpose3d_h36m/FMpose3D_pretrained_weights.pth'

# By default, weights are automatically downloaded from Hugging Face Hub.
# To use local weights instead, uncomment the line below:
# model_weights_path='./pre_trained_models/fmpose3d_h36m/FMpose3D_pretrained_weights.pth'
model_weights_path=''

#Test
python3 scripts/FMPose3D_main.py \
Expand Down
4 changes: 2 additions & 2 deletions tests/fmpose3d_api/test_fmpose3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,8 @@ def test_predict_raises_clear_error_without_deeplabcut(self):
frames = np.random.randint(0, 255, (1, 64, 64, 3), dtype=np.uint8)

with patch(
"fmpose3d.inference_api.fmpose3d.importlib.util.find_spec",
return_value=None,
"fmpose3d.inference_api.fmpose3d._require_superanimal_analyze_images",
side_effect=ImportError('pip install "fmpose3d[animals]"'),
):
with pytest.raises(ImportError, match=r"fmpose3d\[animals\]"):
estimator.predict(frames)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_demo_human.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_2d_pose_estimation(test_image_path, test_output_dir):
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')
keypoints, scores = hrnet_pose(test_image_path, det_dim=416, num_person=1, gen_output=True, type='image')

# Check output shapes
assert keypoints is not None, "Keypoints should not be None"
Expand Down