rk3588 上运行smolvlm-realtime-webcam,将视频转为文字描述

smolvlm-realtime-webcam 是一个开源项目,结合了轻量级多模态模型 SmolVLM 和本地推理引擎 llama.cpp,能够在本地实时处理摄像头视频流,生成自然语言描述, 开源项目地址

https://github.com/ngxson/smolvlm-realtime-webcamhttps://github.com/ngxson/smolvlm-realtime-webcam需要依赖https://github.com/ggml-org/llama.cpp/releases/tag/b5581https://github.com/ggml-org/llama.cpp/releases/tag/b5581但是问题来了,如果直接下载现成的llama-b5581-bin-ubuntu-arm64.zip

下载命令资源后会提示

Illegal instruction

需要自己编译一下https://github.com/ggml-org/llama.cpp 才可以在rk3588上运行

复制代码
Build llama.cpp locally

The main product of this project is the llama library. Its C-style interface can be found in include/llama.h.

The project also includes many example programs and tools using the llama library. The examples range from simple, minimal code snippets to sophisticated sub-projects such as an OpenAI-compatible HTTP server.

To get the Code:

git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp

The following sections describe how to build with different backends and options.
CPU Build

Build llama.cpp using CMake:

sudo apt install curl
sudo apt install libcurl4-openssl-dev
cmake -B build
cmake --build build --config Release

在rk3588上大约要编译个十来分钟,算是大工程了。最后生成的文件在

/build/bin中

运行试一下,要用代理下载哦

复制代码
export http_proxy=http://你的代理IP:端口
export https_proxy=http://你的代理IP:端口

./llama-server -hf ggml-org/SmolVLM-500M-Instruct-GGUF

最后出现

就表示成功了,这时运行,https://github.com/ngxson/smolvlm-realtime-webcam.git 工程中的index.html就会打开摄像头

另外这个缺省的模型对中文不太友好,可以换成 中文的,但是速度就不太行了,推荐在有gpu的情况下使用。

复制代码
# Gemma 3
(tool_name) -hf ggml-org/gemma-3-4b-it-GGUF
(tool_name) -hf ggml-org/gemma-3-12b-it-GGUF
(tool_name) -hf ggml-org/gemma-3-27b-it-GGUF

# SmolVLM
(tool_name) -hf ggml-org/SmolVLM-Instruct-GGUF
(tool_name) -hf ggml-org/SmolVLM-256M-Instruct-GGUF
(tool_name) -hf ggml-org/SmolVLM-500M-Instruct-GGUF
(tool_name) -hf ggml-org/SmolVLM2-2.2B-Instruct-GGUF
(tool_name) -hf ggml-org/SmolVLM2-256M-Video-Instruct-GGUF
(tool_name) -hf ggml-org/SmolVLM2-500M-Video-Instruct-GGUF

# Pixtral 12B
(tool_name) -hf ggml-org/pixtral-12b-GGUF

# Qwen 2 VL
(tool_name) -hf ggml-org/Qwen2-VL-2B-Instruct-GGUF
(tool_name) -hf ggml-org/Qwen2-VL-7B-Instruct-GGUF

# Qwen 2.5 VL
(tool_name) -hf ggml-org/Qwen2.5-VL-3B-Instruct-GGUF
(tool_name) -hf ggml-org/Qwen2.5-VL-7B-Instruct-GGUF
(tool_name) -hf ggml-org/Qwen2.5-VL-32B-Instruct-GGUF
(tool_name) -hf ggml-org/Qwen2.5-VL-72B-Instruct-GGUF

# Mistral Small 3.1 24B (IQ2_M quantization)
(tool_name) -hf ggml-org/Mistral-Small-3.1-24B-Instruct-2503-GGUF

# InternVL 2.5 and 3
(tool_name) -hf ggml-org/InternVL2_5-1B-GGUF
(tool_name) -hf ggml-org/InternVL2_5-4B-GGUF
(tool_name) -hf ggml-org/InternVL3-1B-Instruct-GGUF
(tool_name) -hf ggml-org/InternVL3-2B-Instruct-GGUF
(tool_name) -hf ggml-org/InternVL3-8B-Instruct-GGUF
(tool_name) -hf ggml-org/InternVL3-14B-Instruct-GGUF

# Llama 4 Scout
(tool_name) -hf ggml-org/Llama-4-Scout-17B-16E-Instruct-GGUF

# Moondream2 20250414 version
(tool_name) -hf ggml-org/moondream2-20250414-GGUF

使用下面的模型就可以返回中文了

复制代码
 llama-server -hf ggml-org/Qwen2.5-VL-3B-Instruct-GGUF

smolvlm-realtime-webcam 是一个开源项目,结合了轻量级多模态模型 SmolVLM 和本地推理引擎 llama.cpp,能够在本地实时处理摄像头视频流,生成自然语言描述。


🧠 项目概述

  • 实时图像理解:通过调用摄像头,项目将捕获的图像发送到本地运行的 llama.cpp 服务器,使用 SmolVLM 模型进行处理,返回对图像的自然语言描述。

  • 轻量级部署:SmolVLM 模型参数量在 256M 到 500M 之间,设计上优化了计算效率,适合在资源受限的设备上运行。

  • 本地运行,无需联网:所有处理均在本地完成,增强了隐私保护,降低了部署门槛


🚀 实际用途

  1. 辅助视觉障碍者:为视力受限人士提供实时的环境描述,增强其独立性。

  2. 智能家居监控:识别家中异常情况,如宠物行为、火灾迹象等,提升家庭安全。

  3. 教育与学习:在教学中实时描述实验过程或自然现象,增强学习体验。

  4. 工业质量控制:在生产线上实时检测产品缺陷,提高生产效率。

  5. 机器人视觉系统:为机器人提供实时环境理解,提升其自主导航和操作能力。


🌈 创意扩展

  • 实时字幕生成:为视频或直播内容生成实时字幕,提升可访问性。

  • 个性化虚拟助手:结合语音识别和图像理解,创建更智能的个人助手。

  • 增强现实(AR)应用:在 AR 设备中实时识别和标注现实世界中的物体,增强用户体验。

  • 艺术创作工具:将实时图像描述转化为诗歌或故事,激发创作灵感。

  • 环境数据收集:在野外部署设备,实时记录和描述自然环境变化,用于科研。


🔧 快速上手

  1. 安装 llama.cpp:按照官方指南编译并运行 llama.cpp。

  2. 下载 SmolVLM 模型:获取适用于 llama.cpp 的 SmolVLM 模型文件。

  3. 运行服务器:启动 llama.cpp 服务器,并加载 SmolVLM 模型。

  4. 启动前端界面 :打开项目中的 index.html 文件,连接摄像头,开始实时描述。


该项目展示了在本地设备上实现实时多模态 AI 应用的可能性,为边缘计算和隐私保护提供了新的解决方案。

相关推荐
上海合宙LuatOS14 小时前
LuatOS核心库API——【audio 】
java·网络·单片机·嵌入式硬件·物联网·音视频·硬件工程
Android系统攻城狮15 小时前
Android16进阶之音频播放定位MediaPlayer.seekTo调用流程与实战(二百二十七)
音视频·mediaplayer·android16·音频进阶·音频性能实战
晚霞的不甘16 小时前
Flutter for OpenHarmony 可视化教学:A* 寻路算法的交互式演示
人工智能·算法·flutter·架构·开源·音视频
听麟16 小时前
HarmonyOS 6.0+ 跨端智慧政务服务平台开发实战:多端协同办理与电子证照管理落地
笔记·华为·wpf·音视频·harmonyos·政务
晚霞的不甘17 小时前
Flutter for OpenHarmony 实现计算几何:Graham Scan 凸包算法的可视化演示
人工智能·算法·flutter·架构·开源·音视频
零一iTEM18 小时前
MAX98357A_音频输出测试
单片机·嵌入式硬件·开源·音视频·硬件工程
Android系统攻城狮19 小时前
Android16进阶之获取播放位置MediaPlayer.getCurrentPosition调用流程与实战(二百二十八)
音视频·android16·音频进阶·音频性能实战
愚公搬代码21 小时前
【愚公系列】《AI短视频创作一本通》020-AI短视频创作实例精解(文旅宣传AI短视频实例精解)
人工智能·音视频
有位神秘人21 小时前
Android获取设备中本地音频
android·音视频
硫酸锌0121 小时前
使用ffmpeg合并文件夹内的所有*.mp4格式视频
ffmpeg·音视频