Skip to content

Commit

Permalink
Fix not logging 3D gesture z component correctly in Gesture Detection…
Browse files Browse the repository at this point in the history
… example (#5630)

Thanks to @Wumpf, we identified a problem in the 3D view and fixed it.
It was a typo (y instead z) and made the view look 2D instead of 3D.

<!--
Open the PR up as a draft until you feel it is ready for a proper
review.

Do not make PR:s from your own `main` branch, as that makes it difficult
for reviewers to add their own fixes.

Add any improvements to the branch as new commits to make it easier for
reviewers to follow the progress. All commits will be squashed to a
single commit once the PR is merged into `main`.

Make sure you mention any issues that this PR closes in the description,
as well as any other related issues.

To get an auto-generated PR description you can put "copilot:summary" or
"copilot:walkthrough" anywhere.
-->

### What

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5630/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5630/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5630/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5630)
- [Docs
preview](https://rerun.io/preview/914724bb330117effecfc3521136802d84f45a0b/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/914724bb330117effecfc3521136802d84f45a0b/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
andreasnaoum authored Mar 21, 2024
1 parent 740bbd9 commit 62c79c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/python/gesture_detection/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def convert_landmarks_to_image_coordinates(

@staticmethod
def convert_landmarks_to_3d(hand_landmarks: list[list[NormalizedLandmark]]) -> list[tuple[float, float, float]]:
return [(lm.x, lm.y, lm.y) for hand_landmark in hand_landmarks for lm in hand_landmark]
return [(lm.x, lm.y, lm.z) for hand_landmark in hand_landmarks for lm in hand_landmark]

def detect_and_log(self, image: npt.NDArray[np.uint8], frame_time_nano: int) -> None:
# Recognize gestures in the image
Expand Down

0 comments on commit 62c79c7

Please sign in to comment.