当前位置: 首页 > news >正文

Ollama视觉模型实测

我简单地拍了几张营养标签的照片,并使用提示转换为 JSON。然后我针对一堆自托管模型和 Mistral Open API 进行了测试。它们都表现得相当好,但 Mistral API 是最好的。

你知道,击败基准测试是一回事。但基准测试通常是自我报告的随机变量,就像驾照考试和驾驶并不完全一样,它们不能保证给定的现实生活问题会以可行的方式解决。这就是为什么我想给它一个真实的测试用例。

测试很简单:我拍了一堆营养标签的照片,就像下面这张:

视觉模型在将其转换为 JPEG 方面有多好?

我尝试提取以下格式的 JSON:

{ "calories": 180, "serving_size": 28.0, "unit": "g" }

我使用的提示:

The image is the label of a packaged food product. Extract the following information from the nutrition facts label and return ONLY a JSON object with no additional text: - calories: total calories per serving (integer) - serving_size: numeric serving size value (float) - unit: unit of measurement for serving size (string, e.g., "g", "ml", "oz", "cup") Use this exact format: ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "calories": { "type": "integer", "description": "Total calories per serving" }, "serving_size": { "type": "number", "description": "Numeric serving size" }, "unit": { "type": "string", "description": "Unit of measurement (e.g., g, ml, oz, cups)" } }, "required": ["calories", "serving_size", "unit"] }

Example:

{"calories":180,"serving_size":28.0,"unit":"g"}

If any value cannot be determined from the label, use null for that field.

我运行同样的东西 50 次,看看是否能得到期望的结果。 我使用的评估标准:

prompt_path: “…/prompts/calories_and_serving_size.md”
repeat: 50
threshold: 0
cases:

  • id: calories-label-180
    steps:

    • input:
      image_path: “images/IMG_B768CE83-9FEC-461A-BE63-CDDF64EBEB58.jpeg”
      max_tokens: 64
      expectations:
      • type: equals
        value:
        calories: 180
        serving_size: 40.0
        unit: g
  • id: calories-label-harvest-trail-mix-1
    steps:

    • input:
      image_path: “images/IMG_3236.HEIC”
      max_tokens: 64
      expectations:
      • type: oneOf
        values:
        • calories: 220
          serving_size: 50.0
          unit: g
        • calories: 220
          serving_size: 0.5
          unit: cup
        • calories: 220
          serving_size: 50.0
          unit: grams
  • id: calories-label-chunky-supreme-granola-exact
    steps:

    • input:
      image_path: “images/IMG_3228.HEIC”
      max_tokens: 64
      expectations:
      • type: equals
        value:
        calories: 630
        serving_size: 140.0
        unit: g
  • id: calories-label-maple-eh-granola-exact
    steps:

    • input:
      image_path: “images/IMG_3231.HEIC”
      max_tokens: 64
      expectations:
      • type: equals
        value:
        calories: 570
        serving_size: 130.0
        unit: g
  • id: calories-label-harvest-trail-mix-2
    steps:

    • input:
      image_path: “images/IMG_3232.HEIC”
      max_tokens: 64
      expectations:
      • type: oneOf
        values:
        • calories: 220
          serving_size: 50.0
          unit: g
        • calories: 220
          serving_size: 0.5
          unit: cup
        • calories: 220
          serving_size: 50.0
          unit: grams
  • id: calories-label-harvest-trail-mix-3
    steps:

    • input:
      image_path: “images/IMG_3237.HEIC”
      max_tokens: 64
      expectations:
      • type: oneOf
        values:
        • calories: 220
          serving_size: 50.0
          unit: g
        • calories: 220
          serving_size: 0.5
          unit: cup
        • calories: 220
          serving_size: 50.0
          unit: grams
  • id: calories-label-hersheys-christmas-cookies-exact
    steps:

    • input:
      image_path: “images/IMG_3276.HEIC”
      max_tokens: 64
      expectations:
      • type: equals
        value:
        calories: 200
        serving_size: 41.0
        unit: g
  • id: calories-label-mnm-mint-chocolate-candy-1
    steps:

    • input:
      image_path: “images/IMG_3279.HEIC”
      max_tokens: 64
      expectations:
      • type: oneOf
        values:
        • calories: 190
          serving_size: 40.0
          unit: g
        • calories: 220
          serving_size: 0.25
          unit: cup
  • id: calories-label-hersheys-candy-cane-kisses
    steps:

    • input:
      image_path: “images/IMG_3280.HEIC”
      max_tokens: 64
      expectations:
      • type: equals
        value:
        calories: 220
        serving_size: 42.0
        unit: g
  • id: calories-label-milk-chocolate-christmas-balls
    steps:

    • input:
      image_path: “images/IMG_3282.HEIC”
      max_tokens: 64
      expectations:
      • type: oneOf
        values:
        • calories: 200
          serving_size: 40.0
          unit: g
        • calories: 200
          serving_size: 6.0
          unit: pcs
        • calories: 200
          serving_size: 6.0
          unit: pieces
  • id: calories-label-mnm-mint-chocolate-candy-2
    steps:

    • input:
      image_path: “images/IMG_3284.HEIC”
      max_tokens: 64
      expectations:
      • type: oneOf
        values:
        • calories: 190
          serving_size: 40.0
          unit: g
        • calories: 220
          serving_size: 0.25
          unit: cup
  • id: calories-label-jumbo-sour-sukkers
    steps:

    • input:
      image_path: “images/IMG_3286.HEIC”
      max_tokens: 64
      expectations:
      • type: equals
        value:
        calories: 150
        serving_size: 40.0
        unit: g
      • type: oneOf
        values:
        • calories: 150
          serving_size: 40.0
          unit: g
        • calories: 150
          serving_size: 2.0
          unit: pcs
        • calories: 150
          serving_size: 2.0
          unit: pieces
  • id: calories-label-quality-street
    steps:

    • input:
      image_path: “images/IMG_3288.HEIC”
      max_tokens: 64
      expectations:
      • type: oneOf
        values:
        • calories: 200
          serving_size: 42.0
          unit: g
        • calories: 200
          serving_size: 5.0
          unit: pcs
        • calories: 200
          serving_size: 5.0
          unit: pieces
不再废话,以下是结果: ![无](https://i-blog.csdnimg.cn/img_convert/4d6a03e2259cc129d7eae5c3fae24b4c.webp?x-oss-process=image/format,png) 测试用例的平均模型准确度让我们分解一下:我认为 Llava 失败了。我认为 Llava 是一个 OCR 模型,旨在像 DeepSeek-OCR 一样使用。这些模型不属于这里,它们不遵循像"以 JSON 格式输出"这样的具体指令。 第二个学习是:Qwen3,8B 参数,在 16GB-VRAM 机器上工作得很好。但是,在现实设置中,它们可能并没有比在更小机器上也能工作的 Qwen3:2B 带来太多 —— 它们可能即使在 6GB VRAM 上也能正常工作。使用 8B 来实现与统计噪音无法区分的性能提升可能是不可行的。 另一个观点是,Qwen3:2B 似乎比 Qwen3:4B 更好。我不知道这是否真的是改进,或者只是统计波动。我目前的想法是:如果应用程序实际上需要一个小窗口,那么增加上下文窗口确实没有意义。不仅会增加成本,实际上可能还会降低性能。 最后一个学习:托管 Ollama 时,打开流式传输!否则,当请求超过 60 秒时,请求会被丢弃。我听说这是可定制的,但默认为流式传输可能更容易,尽管需要额外的代码。 --- 原文链接:[Ollama视觉模型实测 - 汇智网](https://www.hubwiz.com/blog/ollama-vision-models-test/)
http://www.jsqmd.com/news/410587/

相关文章:

  • 3个突破限制的资源获取功能:开发者的跨平台模组管理方案
  • 2026年全性能安全门窗十大品牌推荐筑牢居家安全防线 - 资讯焦点
  • 分析水空调地暖安装方案怎么选,杭州德能给出专业解答 - myqiye
  • Python从0到100完整学习指南(必看导航)
  • 3个免费用Claude Code的方法
  • 主流GEO优化系统技术对比评测
  • 2026男性抗衰保健品深度评测:高活(GoHealth)如何以科学矩阵重塑细胞活力 - 资讯焦点
  • 强烈安利10个AI论文平台!MBA毕业论文+开题报告高效写作指南
  • 继《小爱音响》详细说下怎么部署,尤其是关于Docker部分
  • 三月七小助手:游戏辅助工具如何重构玩家的智能任务体验
  • 3大核心功能解决中文文献管理难题:Zotero茉莉花插件终极指南
  • 3个革命性技巧:Jasminum让学术研究者效率提升87%
  • 碧蓝航线自动化革新解决方案:智能任务调度与多维度游戏管理
  • tts-vue离线语音包配置与优化指南:从需求到迭代的全流程实践
  • 吉时利2420 2450 2470 2460 2410数字源表
  • A-Frame与WebXR:构建丰富的VR及AR体验
  • 系统巡检:企业规范设备升级、路由配置与配置管理流程
  • 突破语言屏障:GitHub全界面中文化方案深度测评
  • 学术资源解锁工具:研究人员的知识获取助手
  • PCB电容/二极管/稳压管批量击穿
  • 优化Gofile资源获取效率:从问题诊断到深度优化的完整方案
  • 是德科技E36233A E36313A E36232A程控电源
  • 告别城通网盘限速困扰:3种高效方法获取直连下载地址
  • 传输标准:企业应如何统一资源分级、负载配置与广域连通
  • 音乐格式转换解密工具:QMCDecode破解QQ音乐加密文件跨设备播放全攻略
  • 《植物大战僵尸融合版V3.2.1下载》2026终极指南:安全安装+深度玩法+性能优化全解析 - PC修复电脑医生
  • ViGEmBus:游戏控制器虚拟化技术原理与实践指南
  • 小白程序员必看:4种大模型部署模式,手把手教你让AI智能体跑起来
  • 数字孪生项目的开发框架
  • [发布到npm仓库]