-
Notifications
You must be signed in to change notification settings - Fork 13
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
Passing VideoReader to video models #383
Conversation
This is the right thing to do but two comments/questions:
|
|
@@ -472,11 +473,12 @@ class VideoClassifier(Classifier): | |||
that featurizes the frames of the input video. | |||
''' | |||
|
|||
def predict(self, video_path): | |||
def predict(self, video_reader): |
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.
Isn't there some code in the concrete subclasses that needs to be modified accordingly? Or are there currently no concrete subclasses of VideoClassifier
?
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 are no concrete subclasses.
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.
LTGM!
This PR updates the
eta.core.learning
interface for models that previously took paths to videos on disk to instead takeVideoReader
instances that can read the frames.This is preferable because it separates the abstraction of loading the video from applying the model.
The impetus for this was the need to write modules that apply video models to either a video path/frames sequence, which can be read by
eta.core.video.FFmpegVideoReader
or a video frames directory containing not necessarily sequential frames, which can be read byeta.core.video.SampledFramesVideoReader
. Much easier to do now!Note that this is safe to do now because there are not yet any concrete instances of
VideoModel
,VideoClassifier
, orVideoObjectDetector
indevelop
.