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

About saving npy files #129

Open
htowa opened this issue Apr 17, 2024 · 3 comments
Open

About saving npy files #129

htowa opened this issue Apr 17, 2024 · 3 comments

Comments

@htowa
Copy link

htowa commented Apr 17, 2024

sorry

When extracting features from a video and saving it as an npy file, it seems that "video_name_timestamps_ms and video_name_fps" are also saved together.

How can I avoid saving these files and only save "video_name_rgb"?

@v-iashin
Copy link
Owner

v-iashin commented Apr 27, 2024

sorry about the super late reply. i've missed it completely.

it is easy to fix by commenting the keys you don't wanna save:

features_with_meta = {
self.feature_type: np.array(vid_feats),
'fps': np.array(video.fps),
'timestamps_ms': np.array(timestamps_ms)
}

and

features_with_meta = {
self.feature_type: np.array(vid_feats),
'fps': np.array(video.fps),
'timestamps_ms': np.array(timestamps_ms)

depending on the feature extractor you are using.

also, I'd love to merge a pull request that implements it.

@htowa
Copy link
Author

htowa commented May 1, 2024

返信が激遅くなってすみません。すっかり見落としてしまいました。

保存したくないキーをコメントすることで簡単に修正できます。

features_with_meta = {
self.feature_type: np.array(vid_feats),
'fps': np.array(video.fps),
'timestamps_ms': np.array(timestamps_ms)
}

そして

features_with_meta = {
self.feature_type: np.array(vid_feats),
'fps': np.array(video.fps),
'timestamps_ms': np.array(timestamps_ms)

使用している特徴抽出器によって異なります。

また、それを実装するプルリクエストをマージしたいと思います。

I see, TXH!

@WuZhuoran
Copy link

Hi Author @v-iashin

You defined this attribute:

https://github.com/v-iashin/video_features/blob/master/models/_base/base_framewise_extractor.py#L44

as output_feat_key, If we pass the value as self.output_feat_keys = [self.feature_type], will it only save feature_type npy files?

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

No branches or pull requests

3 participants