| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
chore: Upgrade PyO3 to 0.28 (#6383) FIxed some warnings that popped up. | 7 个月前 | |
feat: add a new subtype of file for video ops (#5346) ## Changes Made ### Summary - adds a mediatype argument for file datatype. DataType.file(MediaType.unknown() |MediaType.video()) - adds new uv/pip category: daft[video] - adds a new VideoFile subclass that is used in place of daft.File (for udfs) if it's known to be a video file. Examples py df = daft.from_glob_paths("**/*.mp4) df = df.select(daft.functions.video_file(df["path"]).alias("video")) # can also enable runtime validation of the video files df = df.select(daft.functions.video_file(df["path"], verify=True).alias("video")) # get the metadata from the files df = df.select("*", daft.functions.video_metadata(df["video"]).unnest()) # get the keyframes df = df.select("*", daft.functions.video_keyframes(df["video"])) Can also use these in udfs py from daft.file.typing import VideoMetadata df = daft.from_glob_paths("**/*.mp4) df = df.select(daft.functions.video_file(df["path"]).alias("video")) @daft.func def metadata(f: daft.VideoFile)->VideoMetadata: return f.metadata() @daft.func def keyframes(f: daft.VideoFile)->list[PIL.Image.Image] return list(f.keyframes()) df = df.select(metadata(df["video"]), keyframes(df["video"])) can also use them as standalone python objects py file = daft.VideoFile("path/to/video.mp4") keyframes = list(file.keyframes()) Additional notes. I had to get rid of the common-file and just move all of that in to daft-core ## Related Issues <!-- Link to related GitHub issues, e.g., "Closes #123" --> ## Checklist - [ ] Documented in API Docs (if applicable) - [ ] Documented in User Guide (if applicable) - [ ] If adding a new documentation page, doc is added to docs/mkdocs.yml navigation - [ ] Documentation builds and is formatted properly | 11 个月前 |