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

[FR] Decouple loading video samples from their frames? #859

Closed
brimoor opened this issue Feb 11, 2021 · 0 comments · Fixed by #877
Closed

[FR] Decouple loading video samples from their frames? #859

brimoor opened this issue Feb 11, 2021 · 0 comments · Fixed by #877
Assignees
Labels
enhancement Code enhancement

Comments

@brimoor
Copy link
Contributor

brimoor commented Feb 11, 2021

Originally posted by @brimoor in #858 (comment)

I'd like to find a clean way to decouple loading the Frames of a video Sample from loading the sample itself. Currently we have this behavior:

import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart-video")

# takes a non-trivial amount of time since the frames are always 
# attached, even if I don't want them
print(dataset.first())

I'd rather make frame loading JIT if possible (noting that, when DatasetViews are involved, the aggregation pipeline may have internally attached and then detached frames in order to compute which samples are in the view):

for sample in video_dataset:
    # `sample` loads fast because `frames` haven't been loaded yet
    print(sample.id)
    
    # now frames are loaded
    print(len(sample.frames))
@brimoor brimoor added enhancement Code enhancement needs discussion An issue that needs more discussion before action is taken and removed needs discussion An issue that needs more discussion before action is taken labels Feb 11, 2021
@brimoor brimoor changed the title Decouple loading video samples from their frames? [FR] Decouple loading video samples from their frames? Feb 17, 2021
sashankaryal added a commit that referenced this issue Sep 30, 2024
sashankaryal added a commit that referenced this issue Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Code enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants