尧图网络 高端网站定制 · 原创设计
免费咨询热线
400-888-6620
免费获取方案
03.Windows编译运行VideoRAG算法
一、项目介绍1.1 仓库地址GIT URL: https://github.com/HKUDS/VideoRAG/tree/main/VideoRAG-algorithm1.2 项目说明VideoRAG 引入了一种新颖的双通道架构该架构协同结合图驱动的文本知识归一化用于建模跨视频语义关系以及层次化的多模态上下文编码以保留时空视觉模式通过动态构建的知识图实现无限制长度的视频理解这些知识图在多视频上下文中保持语义一致性同时通过自适应的多模态融合机制优化检索效率。高效的极长上下文视频处理利用单个 NVIDIA RTX 3090 GPU24G理解数百小时的视频内容结构化视频知识索引多模态知识索引框架将数百小时的视频提炼成简洁、结构化的知识图谱用于全面响应的多模态检索多模态检索范式将文本语义和视觉内容对齐以识别最相关的视频实现全面响应新建的长视频基准新建立的 LongerVideos 基准测试包含超过 160 个视频总时长超过 134 小时涵盖讲座、纪录片和娱乐内容二、配置运行环境2.1 conda环境conda create--namevideoragpython3.11conda activate videorag# Core numerical and deep learning librariespipinstallnumpy1.26.4 pipinstalltorch2.1.2torchvision0.16.2torchaudio2.1.2 pipinstallaccelerate0.30.1 pipinstallbitsandbytes0.43.1# Video processing utilitiespipinstallmoviepy1.0.3 pipinstallgithttps://github.com/facebookresearch/pytorchvideo.git28fe037d212663c6a24f373b94cc5d478c8c1a1d pipinstall--no-deps githttps://github.com/facebookresearch/ImageBind.git3fcf5c9039de97f6ff5528ee4a9dce903c5979b3# Multi-modal and vision librariespipinstalltimm ftfy regex einops fvcore eva-decord0.6.1 iopath matplotlib types-regex cartopy# Audio processing and vector databasespipinstallctranslate24.4.0faster_whisper1.0.3 neo4j hnswlib xxhash nano-vectordb# Language models and utilitiespipinstalltransformers4.37.1 pipinstalltiktoken openai tenacity pipinstallollama0.5.32.2 模型下载下载 MiniCPM-V、Whisper 和 ImageBind 所需的检查点到从仓库根目录。# Ensure git-lfs is installedgitlfsinstall# Download MiniCPM-V modelgitlfs clone https://huggingface.co/openbmb/MiniCPM-V-2_6-int4# Download Whisper modelgitlfs clone https://huggingface.co/Systran/faster-distil-whisper-large-v3# Download ImageBind checkpointmkdir.checkpointscd.checkpointswgethttps://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pthcd../三、问题修复如果上面两个项目没有提前clone可以修改以下截图所圈的地方。modelWhisperModel(Systran/faster-distil-whisper-large-v3,devicecpu,compute_typeint8)四、使用方式目前VideoRAG 仅在英语环境中进行了测试。要处理多种语言的视频建议修改 asr.py 中的 WhisperModel 。更多详情请参考 faster-whisper。首先让 VideoRAG 从给定的视频中提取和索引知识只需一个配备 24GB 内存的 GPU 即可例如 RTX 3090importosimportloggingimportwarningsimportmultiprocessing warnings.filterwarnings(ignore)logging.getLogger(httpx).setLevel(logging.WARNING)# Please enter your openai keyos.environ[OPENAI_API_KEY]fromvideorag._llmimportopenai_4o_mini_configfromvideoragimportVideoRAG,QueryParamif__name____main__:multiprocessing.set_start_method(spawn)# Please enter your video file path in this list; there is no limit on the length.# Here is an example; you can use your own videos instead.video_paths[movies/Iron-Man.mp4,movies/Spider-Man.mkv,]videoragVideoRAG(llmopenai_4o_mini_config,working_dirf./videorag-workdir)videorag.insert_video(video_path_listvideo_paths)然后对视频提出任何问题以下是一个示例importosimportloggingimportwarningsimportmultiprocessing warnings.filterwarnings(ignore)logging.getLogger(httpx).setLevel(logging.WARNING)# Please enter your openai keyos.environ[OPENAI_API_KEY]fromvideorag._llmimport*fromvideoragimportVideoRAG,QueryParamif__name____main__:multiprocessing.set_start_method(spawn)queryWhat is the relationship between Iron Man and Spider-Man? How do they meet, and how does Iron Man help Spider-Man?paramQueryParam(modevideorag)# if param.wo_reference False, VideoRAG will add reference to video clips in the responseparam.wo_referenceTruevideoragvideoragVideoRAG(llmopenai_4o_mini_config,working_dirf./videorag-workdir)videorag.load_caption_model(debugFalse)responsevideorag.query(queryquery,paramparam)print(response)
RELATED

相关推荐

04.WSL环境下编译安装NBIS指纹分析实战指南

04.WSL环境下编译安装NBIS指纹分析实战指南

一、引言 指纹识别作为生物识别技术的重要组成部分,广泛应用于安全认证、身份识别等领域。NBIS(NIST Biometric Image Software)作为FBI和美国国土安全部联合开发的指纹特征提取软件,以其高效、准确的特点,成为该领域的…

📅 2026/9/10 12:27:41
【达芬奇-导入外部剪辑做调色】

【达芬奇-导入外部剪辑做调色】

导入外部剪辑视频做调色快捷键场景剪切多机位剪辑套底快捷键 新建时间线:Command N 场景剪切 软件自动对剪辑好未调色的成片进行分割 右侧选择并用上 & 下 进行校验 删除多余剪辑点,添加未标记点 记得调整有叠转场的片段覆盖上一层轨道。 多…

📅 2026/9/10 21:39:48
老Mac改造服务器全攻略:从配置到优化

老Mac改造服务器全攻略:从配置到优化

1. 老Mac变身服务器的价值与可行性 对于许多Mac用户来说,随着设备更新换代,家里总会闲置几台性能尚可的老款Mac电脑。与其让它们吃灰,不如将这些老Mac改造成服务器,发挥余热。我手头这台2015款的MacBook Pro虽然已经不适合日常使用…

📅 2026/9/10 7:57:29
MORE NEWS

更多资讯

📰

Agent Lightning 异步训练详解:Collocated Asynchronous Rollout 的开启、原理与调优

Agent Lightning 异步训练详解:Collocated Asynchronous Rollout 的开启、原理与调优 【免费下载链接】agent-lightning The absolute trainer to light up AI agents. 项目地址: https://gitcode.com/GitHub_Trending/ag/agent-lightning 长时程 Agent 的 r…

📰

如何用 Sunshine 把 PC 游戏串流到手机和电视:新手完整配置指南

如何用 Sunshine 把 PC 游戏串流到手机和电视:新手完整配置指南 【免费下载链接】Sunshine Self-hosted game stream host for Moonlight. 项目地址: https://gitcode.com/GitHub_Trending/su/Sunshine 想在手机、平板或客厅电视上直接玩 PC 上的游戏&#x…

📰

gs-quant 价差均值回归策略实战:从安装、写信号到回测解读

gs-quant 价差均值回归策略实战:从安装、写信号到回测解读 【免费下载链接】gs-quant Python toolkit for quantitative finance 项目地址: https://gitcode.com/GitHub_Trending/gs/gs-quant 发现10年期与2年期利率互换的价差连续两周被拉高,直觉…

📰

Pipecat 部署全解:从本地调试到生产上线的完整清单

Pipecat 部署全解:从本地调试到生产上线的完整清单 【免费下载链接】pipecat Open Source framework for voice agents, multimodal apps, and realtime AI. Maintained by Daily and the community. 项目地址: https://gitcode.com/GitHub_Trending/pi/pipecat …

📰

PDF解除限制3步搞定:免费去除复制、打印限制完整指南

PDF解除限制3步搞定:免费去除复制、打印限制完整指南 【免费下载链接】PDFPatcher PDF补丁丁——PDF工具箱,可以编辑书签、剪裁旋转页面、解除限制、提取或合并文档,探查文档结构,提取图片、转成图片等等 项目地址: https://git…

📰

树莓派Pico呼吸灯:MicroPython硬件PWM与伽马校正实战

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

TODAY

今日更新

THIS WEEK

本周精选

THIS MONTH

本月热门

读完文章,想聊聊您的网站?

告诉我们您的行业与需求,资深顾问一对一梳理方案与报价,全程免费。

📞 💬