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
Formalizing Featurizer interfaces #238
Conversation
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.
LGTM. Left a few minor comments, mostly about doc strings.
eta/core/features.py
Outdated
'''Configuration settings for an ORBFeaturizer.''' | ||
def get_feature_paths(self): | ||
'''Returns a list of absolute paths to the features on disk.''' | ||
return etau.list_files(self.backing_dir, abs_paths=True) |
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.
What if there are other files in the backing directory besides the feature directories?
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.
Good point. I added in a basic .endswith(".npz")
filter.
As a general principle, we should avoid putting more than one type of thing in directories that contain sequences like %06.<ext>
. For example, eta.core.utils.parse_dir_pattern
is used heavily throughout the pipeline system, and it will get confused if there are multiple types of sequences in there.
@mattphotonman thanks for the careful review! |
This PR addresses #235.
Change log
ImageFeaturizer
,VideoFramesFeaturizer
, andVideoFeaturizer
interfaces toeta.core.features
that encapsulate the various image/tensor/video contracts that featurizers can useeta.core.features.VideoFramesFeaturizer
with a neweta.core.features.CachingVideoFeaturizer
class.CachingVideoFeaturizer
has the same basic functionality as the formerVideoFramesFeaturizer
class with the addition of improved functionality for accessing the features on disk. Also formalizes theBackingManager
interfaceImageFeaturizer
,VideoFramesFeaturizer
, andVideoFeaturizer
interfacesexamples/demo_embed_vgg16
to use the newCachingVideoFeaturizer
class