Skip to content
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

Add blueprint to Face Tracking example #5616

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/re_viewport/src/viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ impl<'a, 'b> egui_tiles::Behavior<SpaceViewId> for TabViewer<'a, 'b> {
// TODO(#4433): This should go to analytics

if cfg!(debug_assertions) {
re_log::warn_once!(
re_log::debug_once!(
"Visualizers for space view {:?} haven't been executed prior to display. This should never happen, please report a bug.",
space_view_blueprint.display_name_or_default()
);
Expand Down
14 changes: 13 additions & 1 deletion examples/python/face_tracking/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import numpy.typing as npt
import requests
import rerun as rr # pip install rerun-sdk
import rerun.blueprint as rrb
import tqdm
from mediapipe.tasks.python import vision

Expand Down Expand Up @@ -430,7 +431,18 @@ def main() -> None:
args, unknown = parser.parse_known_args()
for arg in unknown:
logging.warning(f"unknown arg: {arg}")
rr.script_setup(args, "rerun_example_mp_face_detection")

rr.script_setup(
args,
"rerun_example_mp_face_detection",
# The Viewer's automatic Space View creation gets the layout for this example almost right!
# But depending on soon how data comes it might create undesired views at first.
# So instead, we specify the Blueprint manually to get the desired layout even if face has been detected yet.
blueprint=rrb.Horizontal(
rrb.Spatial3DView(origin="reconstruction"),
rrb.Vertical(rrb.Spatial2DView(origin="video"), rrb.TimeSeriesView(origin="blendshapes")),
),
)

if args.demo_image:
if not SAMPLE_IMAGE_PATH.exists():
Expand Down