1作者: sohamrj15 天前原帖
Gemini Embedding 2 可以将原始视频直接投影到一个768维的向量空间中,同时处理文本。无需转录,无需逐帧标注,也不需要中间文本。像“绿色汽车切入我前面”这样的查询可以直接与30秒的视频片段在向量层面进行比较。 我利用这个功能构建了一个命令行界面(CLI),将数小时的录像索引到ChromaDB中,然后通过自然语言进行搜索,并自动剪辑匹配的片段。演示视频可以在GitHub的自述文件中找到。 索引的成本大约为每小时录像2.50美元。静帧检测可以跳过闲置片段,因此监控摄像头或哨兵模式下的录像成本会更低。
1作者: jdereg15 天前原帖
我在 json-io 这个 Java 序列化库中实现了 TOON 支持。TOON 是一种基于缩进的格式,专为 LLM 应用设计,因为在这些应用中,每个令牌都需要付费并占用上下文窗口。<p>与 JSON 相同的数据,令牌数量减少约 40-50%。没有大括号、方括号、逗号或不必要的引号。统一对象的数组会自动转换为类似 CSV 的表格。<p>JSON: {&quot;team&quot;:&quot;Rockets&quot;,&quot;players&quot;:[{&quot;name&quot;:&quot;John&quot;,&quot;age&quot;:30},{&quot;name&quot;:&quot;Sue&quot;,&quot;age&quot;:27}]}<p>TOON: team: Rockets players: name, age John, 30 Sue, 27<p>json-io 可以读取和写入 JSON、JSON5 和 TOON,支持 60 多种内置 Java 类型,具有循环支持和零配置。此外,还有一个 Spring Boot 启动器和 Spring AI 模块。<p>GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;jdereg&#x2F;json-io" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jdereg&#x2F;json-io</a> TOON 规范: <a href="https:&#x2F;&#x2F;toonformat.dev" rel="nofollow">https:&#x2F;&#x2F;toonformat.dev</a> Baeldung 文章: <a href="https:&#x2F;&#x2F;www.baeldung.com&#x2F;java-json-toon-format-libraries" rel="nofollow">https:&#x2F;&#x2F;www.baeldung.com&#x2F;java-json-toon-format-libraries</a>