-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/detect format function (#144)
* CDL: minor doc typo fix * Undoing some changes that got mixed in * Add detect_pose_format function and SupportedPoseFormat Literal * detect_known_pose_format and tests for it. * various cleanup changes, style changes * missing import * undo black formatting for face contours and ignore_names * SupportedPoseFormat->KnownPoseFormat * Unreachable raise ValueErrors fixed * generic utils type annotations * change detect_known_format to take Pose or PoseHeader * Reraise ImportError if mediapipe is not installed * conftest update to supply unknown-format fake poses * nicer formatting for plane_info and line_info * fix import in generic_test.py * add some pylint disables, consistent with pose-evaluation * Change import in conftest.py * change import style in generic.py * change more imports * Fix a few type issues * Change matrix strategy fail-fast to false, so that we can still run tests if Python 3.8 does not work * Union for type annotation backwards compatibility * Add checks for NotImplementedError * Fix correct_wrist modifying input, and wrong shape for stacked conf. Also added a function to check fake_pose and its outputs * Simplify get_component_names and fix spacing * fix test_get_component_names
- Loading branch information
Showing
12 changed files
with
419 additions
and
74 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
.idea/ | ||
.DS_Store | ||
.vscode/ | ||
.coverage | ||
.coveragerc | ||
coverage.lcov |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import copy | ||
from typing import List, get_args | ||
import pytest | ||
from pose_format.pose import Pose | ||
from pose_format.utils.generic import get_standard_components_for_known_format, fake_pose, KnownPoseFormat | ||
|
||
@pytest.fixture | ||
def fake_poses(request) -> List[Pose]: | ||
# Access the parameter passed to the fixture | ||
known_format = request.param | ||
count = getattr(request, "count", 3) | ||
known_formats = get_args(KnownPoseFormat) | ||
if known_format in known_formats: | ||
|
||
components = get_standard_components_for_known_format(known_format) | ||
return copy.deepcopy([fake_pose(i * 10 + 10, components=components) for i in range(count)]) | ||
else: | ||
# get openpose | ||
fake_poses_list = [fake_pose(i * 10 + 10) for i in range(count)] | ||
for i, pose in enumerate(fake_poses_list): | ||
for component in pose.header.components: | ||
component.name = f"unknown_component_{i}_formerly_{component.name}" | ||
return copy.deepcopy(fake_poses_list) |
Oops, something went wrong.