-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: LEAP-1367: Add TimelineLabels to mark parts of the video #6191
Conversation
- new control tag TimelineLabels with corresponding result type - new TimelineRegion to store values in `ranges` field - new data format, shorter than `sequence` to represent timespans - adjustments to Video tag to support new kind of results - UX draft to draw timeline regions at any point, will definitely be improved - fix deserialization to properly read new results
Now they are timespans with distinct borders
Video tag has `mergeLabelsAndResults: true` so it created extra `labels` property, messing with results. Now there are 3 cases: - usual tags and regions: all results - video with rectangles: labels added to rectangles - video with timeline labels: usual labels result with extra values
- fix types - remove excess hooks - react on video region changes
✅ Deploy Preview for heartex-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for label-studio-docs-new-theme ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Add it when the label is selected but no regions or selected, so user has intent to create a new region with label.
…nto fb-leap-1362/timeline-regions
/git merge develop
|
Split controls, detect correct video region type, etc.
New region was created every time user worked with video rectangle on timeline. That was because timeline behaviour kicked in even without proper control in place.
/git merge
|
Much better check for not being on labels area. Plus no excess check for classname, it's already checked by `!regionRow`
Create regions only when labels are selected.
Apply labels in a regular way via `resultValue` in `createResult()`. Respect “select region after” and “keep label selected” settings. Add comments about multi-labels.
Toggle Keypoint and Toggle Interpolation are disabled for them.
To not break the usual flow with video rectangles.
/git merge
|
- fix usage of wrong units: - positions are 1-based - offsets are 0-based, so in calculations positions should be deducted by 1 - positions are offsets * steps, they were mixed up together - calculate start and end of currently visible window correctly to hop back and forth without skipping frames - fix conditions for hopping, hop back was unreachable - fix scrubbing on random page when it's not aligned with `framesInView`; jump to next page only if we are moving outside of current view - fix value stored as previous scroll to be the correct unit - don't reset current position when video is not fully loaded - add more meaningful comments
/git merge
|
Fix region type detection in our crazy dispatcher in Area.
We don't focus on half-visible frames now, so that had to be fixed. Plus now test logic is more flexible and bulletproof.
/git merge
|
/docker build
|
@ellipsis-dev review this |
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.
❌ Changes requested. Reviewed everything up to f1272b6 in 51 seconds
More details
- Looked at
1159
lines of code in22
files - Skipped
1
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. web/libs/editor/src/components/Timeline/Timeline.tsx:6
- Draft comment:
ThefixMobxObserve
function is imported but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
InTimeline.tsx
, thefixMobxObserve
function is imported but not used. This is unnecessary and should be removed to clean up the code.
Workflow ID: wflow_IQNeJsSffboi4oVH
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
|
||
if (!isDefined(start)) { | ||
if (!isDefined(end)) return []; | ||
return { frame: end, enabled: false }; |
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.
The rangeToSequence
function returns an object when only end
is defined, but it should return an array to maintain consistency with other return types. Consider returning an array with a single object instead.
@@ -172,6 +174,8 @@ const TimelineComponent: FC<TimelineProps> = ({ | |||
</Elem> | |||
); | |||
|
|||
regions.map((reg) => fixMobxObserve(reg.sequence)); |
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.
The regions.map
call on this line is not used and can be removed to improve performance.
ranges
fieldsequence
to represent time spansVideo timelineHeight
param to adjust the timeline areaPR fulfills these requirements
Describe the reason for change
This is a helpful feature, requested for a long time. This first iteration is focused on instant and short time spans with not so many expected regions for annotation.
What alternative approaches were there?
per-frame choices, which are less flexible and have a worse fit into our architecture.
What feature flags were used to cover this change?
none, this feature considered an add-on, not changing much any core and existing functionality.
Does this PR introduce a breaking change?
What level of testing was included in the change?
tests will follow
Summary:
Introduced
TimelineLabels
for video annotation, enabling frame classification and timeline region marking, with updates across models, components, and documentation.Key points:
TimelineLabels
tag for video frame classification indocs/source/tags/timelinelabels.md
.TimelineRegion
model inweb/libs/editor/src/regions/TimelineRegion.js
to store time ranges.Video
tag inweb/libs/editor/src/tags/object/Video/Video.js
to supporttimelineHeight
parameter.Timeline
component inweb/libs/editor/src/components/Timeline/Timeline.tsx
to handle new drawing events.Frames
view inweb/libs/editor/src/components/Timeline/Views/Frames/Frames.tsx
to support timeline region drawing.Result
model inweb/libs/editor/src/regions/Result.js
to includetimelinelabels
.Label
component inweb/libs/editor/src/tags/control/Label.jsx
to supportTimelineLabels
.web/libs/editor/tests/e2e/tests/regression-tests/video-timeline-seek-indicator.test.js
.Generated with ❤️ by ellipsis.dev