Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 models + functions #814
base: main
Are you sure you want to change the base?
Add video models + functions #814
Changes from 4 commits
75877d1
031b9df
548bbd5
b55149a
2cd6d62
5892ab9
f3dc66a
65529f3
b044082
2a77047
89ee2f0
5f522ad
e2f5a3a
67beb9f
60c5848
d3b1619
e31210c
bcd95b1
08edd27
dbefa5f
258454e
328c1a7
a1a47b2
5b2f45b
14caa08
746fd73
0fe47dd
1598c4c
0c3f3b4
bf824af
428d865
b7549b1
8639246
3376449
5b2e437
213b1d8
43389f7
5a20c4e
b72c440
55cd044
69a4385
7859e16
3f47d12
17118d1
cc05da9
8d9f6c2
23514f7
8a8dd64
1a04dd0
0c95c3d
e55405d
8e2a673
9c910ec
a2b8c9a
63448d9
abe39f5
3b7b829
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 236 in src/datachain/lib/file.py
Codecov / codecov/patch
src/datachain/lib/file.py#L236
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.
why do we need this separate model?
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.
Same as for video info (
Video
model). I can remove it from this PR 🤔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.
it's just a bit weird that we have ImageFile and Image (that contains only some basic metadata) 🤔
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.
It was
VideoMeta
(andImageMeta
) before, but Dmitry was asked to rename these models here. I agree havingVideo
(Image
) model with just meta looks odd. I think you're right and we should inherit this model fromVideoFile
(ImageFile
) to extend files with meta, than it will make sense. If no, what do you think aboutVideoInfo
(andImageInfo
)?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.
I would suggest to rename those back to SomethingMeta if we keep this approach
it is super confusing - VideoFrame and Frame - which one is the main class?
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.
cc @dmpetrov
Check warning on line 544 in src/datachain/lib/file.py
Codecov / codecov/patch
src/datachain/lib/file.py#L544
Check warning on line 3 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L1-L3
Check warning on line 5 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L5
Check warning on line 18 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L14-L18
Check warning on line 25 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L25
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.
Could you please avoid using erm
meta
? How aboutfile_to_video(file: File)
?Btw... not just File as input type?
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.
Renamed to
video_info
, also addedget_info
method toVideoFile
model.Check warning on line 36 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L35-L36
Check warning on line 41 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L38-L41
Check warning on line 43 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L43
Check warning on line 53 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L53
Check warning on line 65 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L65
Check warning on line 67 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L67
Check warning on line 70 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L70
Check warning on line 83 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L82-L83
Check warning on line 86 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L86
Check warning on line 102 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L101-L102
Check warning on line 105 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L105
Check warning on line 124 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L124
Check warning on line 127 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L127
Check warning on line 129 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L129
Check warning on line 131 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L131
Check warning on line 135 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L135
Check warning on line 140 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L140
Check warning on line 142 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L142
Check warning on line 145 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L144-L145
Check warning on line 148 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L148
Check warning on line 169 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L169
Check warning on line 172 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L172
Check warning on line 194 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L194
Check warning on line 200 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L197-L200
Check warning on line 203 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L203
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.
It looks like it needs to be renamed to
save_subvideo()
In the class names, we use term
Clip
for virtual videos (start-end) while in this case you are creating just another Video, not clip.So, it needs to be renamed or we need to avoid this Clip-as-virtual-reference terminology.
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.
Renamed to
save_video_fragment
(very common name), same forVideoClip
model — renamed toVideoFragment
. Open to discussion here.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.
It would be great to generalize the single and plural methods. We just need to come up with output format like
output="{name}{:06d}.{ext}")
and provide a string in case of a single file.Also, this method will require generalization for writing to cloud like
output={source}/tmp/{name}{:06d}.{ext}
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.
Agree, not done yet 🤔
Check warning on line 222 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L222
Check warning on line 225 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L225
Check warning on line 229 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L227-L229
Check warning on line 232 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L232
Check warning on line 253 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L252-L253
Check warning on line 255 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L255
Check warning on line 260 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L259-L260
Check warning on line 263 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L263
Check warning on line 266 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L266
Check warning on line 269 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L269
Check warning on line 271 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L271
Check warning on line 273 in src/datachain/lib/video.py
Codecov / codecov/patch
src/datachain/lib/video.py#L273