GitHub 上获 3.5k 星标的分布式查询引擎 Daft,能解决多模态数据处理中工具分散、环境配置复杂的问题,其核心优势包括可直接解析图片 EXIF、视频关键帧以减少工具切换成本的多模态处理能力、依托自动资源分配的高效分布式处理效能及表格化交互界面;还提供了提取图片 EXIF 拍摄日期、读取视频关键帧、处理 URL 图片三大实操案例,并支持图片预览、数据筛选排序等可视化交互,适合计算机视觉项目开发、多模态数据分析及需避免复杂环境搭建的用户,可通过 pip install daft 体验。
In [1]:
import daft
In [6]:
# Load a dataframe from filepaths in an S3 bucket
df = daft.from_glob_path("images/") #非常方便的查阅图片,以表格的形式查看。
In [3]:
df = daft.read_video_frames(r"D:\installed\WeChat_Files\WeChat Files\***\FileStorage\Video\2023-06",
image_height=480,
image_width=640,
is_key_frame=True, # select only the key frames
) # 非常方便的查阅微信其中的视频
In [9]:
# 1. Download column of image URLs as a column of bytes
# 2. Decode the column of bytes into a column of images
df = df.with_column("image", df["path"].url.download().image.decode())
In [10]:
# Resize each image into 32x32
df = df.with_column("resized", df["image"].image.resize(32, 32))
In [12]:
df.show(30)
| ... | ... | ... | ... | ... |
Cell Details
Click on a cell to view its full content
In [ ]: