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

Improve support for labels in VideoReader. #1500

Merged
merged 4 commits into from
Dec 12, 2019

Conversation

a-sansanwal
Copy link
Contributor

@a-sansanwal a-sansanwal commented Nov 25, 2019

Signed-off-by: Abhishek Sansanwal asansanwal@nvidia.com

Why we need this PR?

Pick one

  • It fixes a bug bug description
  • It adds new feature needed because why we need this feature
    Add's support for applying labels to part parts of a video. Either using timestmap or frame number through file_list.
    Add's support for outputting frame_numbers and timestamps of the decoded frames using enable_frame_num and enable_timestamps parameters

Addresses #940, #1458, #753, #666

  • Refactoring to improve what

What happened in this PR?

  • Explain solution of the problem, new feature added.
    Two additional columns can be provided as input using the plaintxt file passed through file_list argument.
    The two values are interpreted as start/end timestamps. If they are skipped the label is applied to the entire video. If file_list_frame_num is set to true, then the timestamps are interpreted as frame numbers instead of timestamps.

  • What was changed, added, removed?
    Parsing the input file_list was modified.
    Logic to generate sequences was changed to apply labels to sequences that fall within the start/end range specified.

  • What is most important part that reviewers should focus on?
    filesystem::get_file_label_pair() in video_loader.cc
    PrepareMetadataImpl() in video_loader.h

  • Was this PR tested? How?
    Tested using gtest test app.Using gtest_filter=VideoReaderTest.StartEndLabels:VideoReaderTest.FrameLabels:VideoReaderTest.FrameLabelsWithFileListFrameNum:VideoReaderTest.TimestampLabels

  • Were docs and examples updated, if necessary?
    Docs updated.

Needs NVIDIA/DALI_extra#35 for test cases

Future to-do ?

Support reading input from csv files instead of plaintext files.

JIRA TASK: [DALI-XXXX]

Copy link
Contributor

@JanuszL JanuszL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some test for this?
Maybe some generation of file_list on the fly inside of the test and verification if we get the expected lables would suffice.

Signed-off-by: Abhishek Sansanwal <asansanwal@nvidia.com>
Signed-off-by: Abhishek Sansanwal <asansanwal@nvidia.com>
@a-sansanwal a-sansanwal force-pushed the videoreader_file_list_clips_label branch from db906b0 to 018e096 Compare December 3, 2019 05:15
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1015170]: BUILD STARTED

@a-sansanwal a-sansanwal changed the title Add support for speciyfing labels to parts of a video Improve support for labels in VideoReader. Dec 3, 2019
@a-sansanwal a-sansanwal force-pushed the videoreader_file_list_clips_label branch from 018e096 to bae68fb Compare December 4, 2019 10:38
@a-sansanwal a-sansanwal force-pushed the videoreader_file_list_clips_label branch from bae68fb to b8920a7 Compare December 6, 2019 04:49
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1020646]: BUILD STARTED

Description: Added gtest cases for enable_frame_num, enable_timestamps,
file_list_frame_num and labels to parts of a video.

Signed-off-by: Abhishek Sansanwal <asansanwal@nvidia.com>
@a-sansanwal a-sansanwal force-pushed the videoreader_file_list_clips_label branch from b8920a7 to f9d31a2 Compare December 6, 2019 06:20
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1020778]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1020823]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1020823]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1020823]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1020823]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1020823]: BUILD PASSED

@a-sansanwal a-sansanwal force-pushed the videoreader_file_list_clips_label branch from f9d31a2 to af864d7 Compare December 6, 2019 19:28
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1024370]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1024370]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1024549]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1024549]: BUILD PASSED

Signed-off-by: Abhishek Sansanwal <asansanwal@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants