最近immich更新,带来了更好的NLLB模型支持。按翻译来看,中文用户的智能搜索模型除了XLM-Roberta-Large-Vit-B-16Plus
又多了一个选择:nllb-clip-large-siglip__v1
:
Better multilingual searching with NLLB models
原文:
The NLLB model family performs the best for most languages excluding English, but Immich didn’t use them optimally. This release lets them perform at their best and brings a new tradeoff for searching: NLLB models give the best results for most languages, in exchange for the model interpreting a user’s searches as being in the user’s UI language.
If your users mainly search in a single non-English language, then these models are definitely worth a look. Each user can search in a different language since it’s based on the user’s UI language, applying to both the web app and mobile app (the latter must be updated to 1.131.0 or later for it to apply). If you’d like the flexibility for the same user to search in different languages, or if your users mainly search in English, then other models will work better for those usages.
See the documentation for more info on how to pick and change the search model.
机翻:
NLLB 模型系列在大多数语言中表现最佳,但不包括英语,然而 Immich 没有充分利用它们。此次发布让它们能够发挥最佳性能,并带来一个新的权衡:NLLB 模型为大多数语言提供最佳结果,但需要模型将用户的搜索解释为用户界面语言。
如果您的用户主要使用一种非英语语言进行搜索,那么这些模型绝对值得一看。每个用户可以使用不同的语言进行搜索,因为它是基于用户界面语言的,适用于网页应用和移动应用(后者必须更新到1.131.0或更高版本才能应用)。如果您希望同一个用户能够使用不同的语言进行搜索,或者您的用户主要使用英语进行搜索,那么其他模型将更适合这些用途。
查看文档以获取更多关于如何选择和更改搜索模型的信息。
于是我就尝下鲜。换个模型试试。
配置
immich运行在家庭服务器里,服务器的cpu是羸弱的j4125。
服务器自带的核显intel HD600在运行immich的机器模型时有问题。所以一直都是纯CPU运行的。
后来我嫌慢,把家里的冥王峡谷(cpu i7-8809g,4核心8线程,采用Intel 14nm制程,单核最高睿频4.2GHz,全核最高睿频3.9GHz,核显是intel HD 630。自带的amd的显卡这里用不上
)也部署了immich的机器学习模型(纯CPU运行的),供服务器在内网远程调用。
升级模型的代价是:需要给我3万多张照片喂给模型重新跑一遍(用的是照片元数据,不是照片本体,数据量很小)。突然想到试试冥王峡谷的核显HD630,毕竟是核显,应该比cpu快吧?
实践
-
在冥王峡谷使用docker额外部署了
image: ghcr.io/immich-app/immich-machine-learning:v1.131.3-openvino
,此时冥王峡谷上有2个immich机器学习服务,一个纯CPU(端口3003),一个纯核显(端口3004)。 -
immich的机器学习的服务url配置切换到冥王的核显服务。
盯着任务面板剩余任务数量,发现任务执行地好像变慢了。
然后我又做了测试证实了这个结果:
核显openvino与纯CPU的效率区别
分别使用2个服务进行了20分钟测试:
服务模式 | 效率(个/小时) | immich任务并发设置 | 任务cpu占用 | 核显占用 | 内存 | 功率 |
---|---|---|---|---|---|---|
纯cpu | 1377 | 4 | 65%-75%(全核参与,3.8Ghz) | 0 | 3.5G | 100W |
核显openvino | 651 | 4 | 0 | 间歇100% | 3.5G | 50W |
可以看到,实际上cpu的效率反而比核显效率高(功耗比核显高一倍),确实和预期相反。
观察一段时间任务管理器发现:
- 纯cpu模式:cpu全时占用,多任务并行,并发设置越高,cpu负载越大
- 核显模式:核显间歇占用,任务按顺序单个执行,核显负载和任务并发设置无关
所以原因是:核显利用率没有起来,核显执行任务时,两个任务之间有等待、空闲的时间。
结论
核显比cpu是否更强这个我没法得出结论,但是immich大模型镜像对核显的调度效率不高应该是个事实。
还是回归我的cpu模式吧,就是费点电的事。
后来我在纯cpu模式继续监测了2个小时,得出效率是2172张照片每小时。
其他
从huggingface
下载这两个模型很慢,用代理(https://hf-mirror.com)会快些。提前告知下当前(2025年4月)版本的模型大小(网页上看不到):
模型 | 硬盘占用 |
---|---|
XLM-Roberta-Large-Vit-B-16Plus | 15.39GB |
nllb-clip-large-siglip__v1 | 27.77GB |