-
Notifications
You must be signed in to change notification settings - Fork 373
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
Only log Clear
s when needed in face tracking
example
#4950
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced about this change. It would yield weird result when face(s) are no longer detected.
@@ -239,7 +239,6 @@ def detect_and_log(self, image: npt.NDArray[np.uint8], frame_time_nano: int) -> | |||
) | |||
rr.log("video/landmarker/faces", rr.Clear(recursive=True)) | |||
rr.log("reconstruction/faces", rr.Clear(recursive=True)) | |||
rr.log("blendshapes", rr.Clear(recursive=True)) | |||
|
|||
for i, (landmark, blendshapes) in enumerate( | |||
zip(detection_result.face_landmarks, detection_result.face_blendshapes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those clear happen because the number of face detected can vary from 0 to N. That's why we clear faces/**
and the re-populate faces/$i/**
. Maybe a cleaner way to go about this would be to detect when faces disappear and clear only those ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the intent here.
Clearing effectively doesn't affect range queries at all, so what is the expected behavior we should expect? I don't get it.
I.e. this:
for step in range(0, 64):
rr.set_time_sequence("step", step)
rr.log("scalar", rr.TimeSeriesScalar(math.sin(step / 10.0)))
results in the same exact graph as this:
for step in range(0, 64):
rr.set_time_sequence("step", step)
rr.log("scalar", rr.TimeSeriesScalar(math.sin(step / 10.0)))
rr.log("scalar", rr.Clear(recursive=True))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haaa interesting! Let me see if there's something quick we can do about this.
4acdc98
to
1a7ce62
Compare
I've updated the code to only clear faces when they disappear. I might come up with a follow up PR soon so that the timeseries view interprets those clears as plot breakpoints. |
Nice! |
Integrate plots with the `Clear` archetype in a useful way. Before: https://github.com/rerun-io/rerun/assets/2910679/7088e5e5-95db-4971-8824-818fb1fee425 After: https://github.com/rerun-io/rerun/assets/2910679/4d5446e3-7df3-431b-9d01-2783b2bf2bda - Related: #4950 - Related: #4186
face tracking
exampleClear
s when needed in face tracking
example
This is what caused the deadlocks/crashes we were after (which I'm glad it did -- those have been fixed in #4949).
Even though they are not a problem anymore, I'm not sure why they're here to begin with? Clearing scalars does nothing unless you specifically intend to use them with latest-at queries (i.e. not plots, which isn't the case here), otherwise it's just inefficient with no upside (which I'd rather not teach users). Am I missing something? 🤔
Checklist
main
build: app.rerun.ionightly
build: app.rerun.io