-
Notifications
You must be signed in to change notification settings - Fork 6
Add high-level API for the pose3d inference pipeline #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Extracted skeleton connection definitions and left/right color masks into constants for better maintainability. - Updated the show2Dpose and show3Dpose functions to utilize these constants. - Changed output image format from JPG to PNG for pose saving.
- Changed GPU ID from 1 to 0 for compatibility. - Updated model and saved model paths to point to the fmpose3d_h36m directory. - Renamed input_images_folder to target_path for clarity in specifying input sources.
- Removed commented-out test argument for clarity. - Renamed model_path argument to model_weights_path for better specificity.
- Changed model_path to point to the fmpose3d_h36m directory. - Updated saved_model_path to model_weights_path for consistency with recent refactoring. - Adjusted test command to use the new model weights path.
- Renamed saved_model_path to model_weights_path for consistency with recent refactoring. - Updated command-line argument to reflect the new model weights path.
- Revised model_path comment to reflect the correct package name as fmpose3d. - Adjusted folder_name variable to improve clarity by removing 'Publish' from the name.
- Removed unused variable tau - Cleaned up commented-out code for better readability.
- Introduced a new command-line argument --model_path for specifying the model file path. - Removed the deprecated --saved_model_path argument for clarity and consistency.
- Updated the backup file logic to use the new model_weights_path instead of saved_model_path for consistency. - Cleaned up commented-out code and streamlined the backup process for better readability and maintainability.
…ncy with recent refactoring. This change simplifies the script by eliminating an unused parameter.
… refactoring - Changed model_path from args.saved_model_path to args.model_weights_path for consistency with other updates.
Updated README to reflect changes in project description, citation format, and demo section.
This is a security vulnerability and triggers deprecation warnings in pytorch.
Variable has been deprecated since PyTorch 0.4 (2018). We should use tensors directly.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Minor refactors
- New ABC base_model as template. - Easy access to defined set of models. - Modularly extendable with new implementations.
…FMPose3D into jaap/add_config_and_registry
- This is an adapter of the `gen_video_kpts` function - it can read arrays instead of image paths - can be configured with HRNetConfig
Collaborator
|
Looks good to me, thanks! @deruyter92 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces fmpose3d/fmpose3d.py:
A clean, high-level inference API that wraps the full FMPose3D pipeline (2D pose estimation → 3D lifting) into a single module.
Key components
HRNetPose2dmodule inside the hrnet lib, that is configurable without argparser and can handle image arrays intead of pathsHRNetEstimator— Thin wrapper around HRNetPose2d + YOLO that lazily loads models and converts COCO keypoints to H36M format following the demo scriptFMPose3DInference— Main entry point with a two-step workflow:prepare_2d(source)— Runs HRNet to produce 2D keypoints from flexible input (image path, directory of images, numpy array, or list of paths/arrays).pose_3d(keypoints_2d, image_size)— Lifts 2D keypoints to 3D via Euler ODE sampling with optional flip-augmentation and camera-to-world transform.predict(source)— Convenience method that chains both steps end-to-end.Design choices
Example usage
More elaborate script for comparing with demo