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 video frames extractor and split_video command #555

Merged
merged 65 commits into from
Jan 17, 2022

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Nov 17, 2021

Summary

  • Added video frames extractor (read problems below)
  • Added tests
  • Added datum util split_video command to split video
  • Added docs
  • Added MediaManager class (TBD: remove ImageCache)
  • Allowed file paths in datum import
  • Addition of video_frames source produces a warning about unstable results
  • Prohibited calling add, import and export without a project
  • Calling make_dataset on empty project tree now properly produces the error
  • image_dir format extractor:
    • Added the --subset CLI parameter
    • Removed the exts and depth parameters

TBD / Problems:

  • Closing of the video file descriptor on exit. Requires a subsystem to manage Dataset resources, or something similar.
    • Possible workaround: try to read all frames into memory. Unlikely to be working IRL.
    • Possible workaround: add global media resource manager
    • Possible workaround: require video metafile, build such if none provided.
  • Video splitting docs
  • A warning on video frames import in Project

How to test

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@zhiltsov-max zhiltsov-max changed the title [WIP] Add video frames extractor Add video frames extractor and split_video command Dec 28, 2021
Comment on lines 56 to 59
def push(self, key, media):
if self.capacity <= len(self.items):
self.items.popitem(last=True)
self.items[key] = media

Choose a reason for hiding this comment

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

Why here is no required to close item that was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it needs. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines +10 to +13
Splits a video into separate frames and saves them in a directory.
After the splitting, the images can be added into a project using
the [`import` command](./sources/#source-import) and the `image_dir` format.

Choose a reason for hiding this comment

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

I see that split_video -> image_dir and video_frames that two alternative approaches to import video dataset.
Maybe it will be useful to add import argument --subset for image_dir format to make these approaches fully alternative

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The both have this parameter. Do you mean, in CLI?

Choose a reason for hiding this comment

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

Yes, I mean in CLI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@zhiltsov-max zhiltsov-max force-pushed the zm/video-extractor branch 2 times, most recently from b76916a to 5c2b9d4 Compare January 14, 2022 09:10
@zhiltsov-max zhiltsov-max merged commit f6dea6a into develop Jan 17, 2022
@zhiltsov-max zhiltsov-max deleted the zm/video-extractor branch January 17, 2022 12:55
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.

Importing a video-based datasets Support video import
3 participants