Update README.md
Browse files
README.md
CHANGED
|
@@ -8,152 +8,180 @@ tags:
|
|
| 8 |
- immich
|
| 9 |
---
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
</p>
|
| 18 |
-
<h3 align="center">High performance self-hosted photo and video management solution</h3>
|
| 19 |
-
<br/>
|
| 20 |
-
<a href="https://immich.app">
|
| 21 |
-
<img src="asset/immich-screenshots.png" title="Main Screenshot">
|
| 22 |
-
</a>
|
| 23 |
-
<br/>
|
| 24 |
-
<p align="center">
|
| 25 |
|
| 26 |
-
Immich
|
| 27 |
-
Immich helps you browse, search, and organize your photos and videos with ease, without compromising your privacy.
|
| 28 |
-
For the original project's official website and GitHub repository, please visit
|
| 29 |
|
| 30 |
-
|
| 31 |
-
- https://github.com/immich-app/immich.
|
| 32 |
|
| 33 |
-
|
| 34 |
-
By leveraging these accelerator cards for computational offloading, we aim to enhance Immich's efficiency in processing photos.
|
| 35 |
-
Through this example, we hope to guide Immich users in expanding high-efficiency deployments of Immich across a broader range of hardware platforms by adding dedicated AI accelerator cards.
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
| 44 |
-
- AX650N DEMO Board
|
| 45 |
-
- [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
|
| 46 |
-
- [M.2 Accelerator card](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_introduction.html#id4)
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
-
we have adopted larger-parameter models: **CLIP-L/14-336** and **CN-CLIP-L/14-336**. Precompiled models optimized for Axera AI accelerator cards are available at the following links:
|
| 52 |
|
| 53 |
-
- [CLIP-L/14-336 (English)](https://huggingface.co/AXERA-TECH/ViT-L-14-336__axera)
|
| 54 |
-
- [CN-CLIP-L/14-336 (Chinese)](https://huggingface.co/AXERA-TECH/ViT-L-14-336-CN__axera)
|
|
|
|
| 55 |
|
| 56 |
-
##
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|-------|-------------|--------------|----------------|
|
| 60 |
-
| `cnclip_vit_l14_336px_vision_u16u8.axmodel` | 1 x 3 x 336 x 336 | 88.475 ms | 304 MB |
|
| 61 |
-
| `cnclip_vit_l14_336px_text_u16.axmodel` | 1 x 52 | 4.576 ms | 122 MB |
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
#
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
|
| 75 |
|
| 76 |
-
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
|
|
| 81 |
|
|
|
|
| 82 |
|
| 83 |
```bash
|
| 84 |
-
|
| 85 |
-
```
|
| 86 |
|
| 87 |
-
|
|
|
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
| 91 |
```
|
| 92 |
|
| 93 |
-
##
|
| 94 |
-
Follow these steps to prepare the software environment on Raspberry Pi 5 (or other supported platforms):
|
| 95 |
|
| 96 |
-
###
|
| 97 |
-
Refer to the official AXCL documentation for detailed instructions:
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
-
Key steps include:
|
| 102 |
-
|
| 103 |
-
Update Raspberry Pi firmware and enable PCIe:
|
| 104 |
```bash
|
| 105 |
-
|
|
|
|
|
|
|
| 106 |
```
|
| 107 |
|
| 108 |
-
|
| 109 |
|
| 110 |
-
```
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
|
|
|
| 115 |
|
| 116 |
-
Reboot and verify device detection using lspci.
|
| 117 |
-
Install the AXCL .deb package:
|
| 118 |
```bash
|
| 119 |
-
|
|
|
|
| 120 |
```
|
| 121 |
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
```bash
|
| 124 |
-
|
|
|
|
| 125 |
```
|
| 126 |
|
| 127 |
-
###
|
| 128 |
-
Refer to the PyAXEngine documentation:
|
| 129 |
|
| 130 |
-
|
| 131 |
|
| 132 |
-
|
| 133 |
|
| 134 |
```bash
|
| 135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
```
|
| 137 |
|
| 138 |
-
|
| 139 |
-
|
|
|
|
| 140 |
|
| 141 |
```bash
|
| 142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
```
|
| 144 |
|
| 145 |
-
|
| 146 |
|
| 147 |
-
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
+------------------------------------------------------------------------------------------------+
|
| 150 |
-
| AXCL-SMI V3.
|
| 151 |
+-----------------------------------------+--------------+---------------------------------------+
|
| 152 |
| Card Name Firmware | Bus-Id | Memory-Usage |
|
| 153 |
| Fan Temp Pwr:Usage/Cap | CPU NPU | CMM-Usage |
|
| 154 |
|=========================================+==============+=======================================|
|
| 155 |
-
| 0
|
| 156 |
-
| --
|
| 157 |
+-----------------------------------------+--------------+---------------------------------------+
|
| 158 |
|
| 159 |
+------------------------------------------------------------------------------------------------+
|
|
@@ -161,117 +189,86 @@ You should see output similar to:
|
|
| 161 |
| Card PID Process Name NPU Memory Usage |
|
| 162 |
|================================================================================================|
|
| 163 |
```
|
| 164 |
-
If you see the AX650N card listed with valid memory usage, your hardware and software setup is successful.
|
| 165 |
|
| 166 |
-
|
| 167 |
|
| 168 |
-
|
| 169 |
|
|
|
|
|
|
|
| 170 |
```
|
| 171 |
-
hf download AXERA-TECH/immich --local-dir AXERA-TECH/immich
|
| 172 |
-
cd AXERA-TECH/immich
|
| 173 |
-
```
|
| 174 |
-
|
| 175 |
-
#### Setup immich server
|
| 176 |
|
| 177 |
-
|
| 178 |
-
sudo docker load -i ax-immich-server-aarch64.tar.gz
|
| 179 |
-
unzip docker-deploy.zip
|
| 180 |
-
cp example.env .env
|
| 181 |
-
sudo docker compose -f docker-compose.yml -f docker-compose.override.yml up -d
|
| 182 |
-
```
|
| 183 |
|
| 184 |
-
|
| 185 |
|
| 186 |
-
```
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
[+] Running 3/3
|
| 190 |
-
✔ Container immich_redis Running 0.0s
|
| 191 |
-
✔ Container immich_postgres Started 1.8s
|
| 192 |
-
✔ Container immich_server Started 1.3s
|
| 193 |
```
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
-
|
| 198 |
-
cd ~/.cache/immich_ml/clip
|
| 199 |
-
hf download AXERA-TECH/ViT-L-14-336-CN__axera --local-dir ViT-L-14-336-CN__axera
|
| 200 |
-
```
|
| 201 |
|
| 202 |
-
|
| 203 |
|
| 204 |
-
```
|
| 205 |
-
|
| 206 |
-
.
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
│ ├── merges.txt
|
| 211 |
-
│ ├── model.axmodel
|
| 212 |
-
│ ├── special_tokens_map.json
|
| 213 |
-
│ ├── tokenizer_config.json
|
| 214 |
-
│ ├── tokenizer.json
|
| 215 |
-
│ └── vocab.json
|
| 216 |
-
└── visual
|
| 217 |
-
├── model.axmodel
|
| 218 |
-
└── preprocess_cfg.json
|
| 219 |
```
|
| 220 |
|
| 221 |
-
|
| 222 |
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
```
|
| 226 |
-
pip install -r requirements.txt
|
| 227 |
-
pip install immich_ml-1.129.0-py3-none-any.whl
|
| 228 |
-
python -m immich_ml
|
| 229 |
```
|
| 230 |
|
| 231 |
-
|
| 232 |
|
| 233 |
-
|
| 234 |
-
(immich) axera@raspberrypi:~/samples/immich $ python -m immich_ml
|
| 235 |
-
[10/08/25 11:11:40] INFO Starting gunicorn 23.0.0
|
| 236 |
-
[10/08/25 11:11:40] INFO Listening at: http://[::]:3003 (3145057)
|
| 237 |
-
[10/08/25 11:11:40] INFO Using worker: immich_ml.config.CustomUvicornWorker
|
| 238 |
-
[10/08/25 11:11:40] INFO Booting worker with pid: 3145062
|
| 239 |
-
[INFO] Available providers: ['AXCLRTExecutionProvider']
|
| 240 |
-
```
|
| 241 |
|
| 242 |
-
|
| 243 |
|
| 244 |
-
|
| 245 |
-
you can access the Immich login page by opening a browser on any device within the same local network and navigating to
|
| 246 |
|
| 247 |
-
```
|
| 248 |
-
http://10.126.33.241:2283/
|
| 249 |
-
```
|
| 250 |
|
| 251 |
-
|
|
|
|
|
|
|
|
|
|
| 252 |
|
| 253 |
-
|
| 254 |
-
|
|
|
|
|
|
|
| 255 |
|
| 256 |
-
|
| 257 |
|
| 258 |
-

|
| 261 |
|
| 262 |
-
](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
|
| 33 |
+
- [**M.2 Accelerator card**](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_introduction.html#id4)
|
| 34 |
|
| 35 |
+
# 四、支持模型
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
在 Immich 项目中,CLIP 模型是实现智能相册功能且计算需求最高的核心组件。为了进一步提升识别准确率,我们采用了参数量更大的模型:**CLIP-L/14-336** 和 **CN-CLIP-L/14-336**。
|
| 38 |
|
| 39 |
+
针对爱芯元智(Axera)AI 加速卡优化后的预编译模型,可参考以下版本获取:
|
|
|
|
| 40 |
|
| 41 |
+
- [**CLIP-L/14-336 (English)**](https://huggingface.co/AXERA-TECH/ViT-L-14-336__axera)
|
| 42 |
+
- [**CN-CLIP-L/14-336 (Chinese)**](https://huggingface.co/AXERA-TECH/ViT-L-14-336-CN__axera)
|
| 43 |
+
# 五、部署操作
|
| 44 |
|
| 45 |
+
## **1. 系统配置与代码获取**
|
| 46 |
|
| 47 |
+
### (1)前置准备与依赖安装(必做)
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
在开始部署前,必须更新系统并安装核心依赖组件。
|
| 50 |
+
```bash
|
| 51 |
+
apt-get update
|
| 52 |
+
apt-get install -y unzip libgl1
|
| 53 |
+
```
|
| 54 |
|
| 55 |
+
### **扩充存储空间(可选)**
|
| 56 |
+
- **挂载 SD Card**:若系统内部空间不够,可选择挂载 SD Card 来存放数据。首先需将 SD Card 格式化为 `ext4` 格式并挂载。
|
| 57 |
+
```bash
|
| 58 |
+
lsblk
|
| 59 |
|
| 60 |
+
#格式化SD Card 注意保存数据
|
| 61 |
+
# mkfs.ext4 /dev/mmcblk1p1
|
| 62 |
|
| 63 |
+
mkdir /mnt/sdcard
|
| 64 |
+
mount /dev/mmcblk1p1 /mnt/sdcard
|
| 65 |
+
```
|
| 66 |
|
| 67 |
+
- **配置开机自动挂载**:通过 `blkid /dev/mmcblk1p1` 获取 UUID 后,修改 `/etc/fstab` 文件以实现开机自启。配置示例如 `UUID=13054439-9d76-47ca-b8ed-c7cd8d208a5d /mnt/sdcard ext4 defaults 0 2`。
|
| 68 |
|
| 69 |
+
### (3) 获取部署代码(必做)
|
| 70 |
|
| 71 |
+
- **方案一:使用 Git**:安装 `git-lfs` 后,直接从 HuggingFace 拉取代码仓库(空间不足时可选择拉取至 SD Card 目录)。
|
| 72 |
|
| 73 |
+
```bash
|
| 74 |
+
apt-get install git-lfs
|
| 75 |
+
git clone https://huggingface.co/AXERA-TECH/immich
|
| 76 |
+
```
|
| 77 |
|
| 78 |
+
- **方案二:使用 HuggingFace**:若 Git 因为网络问题导致拉取失败,可安装 `huggingface_hub` 工具并使用 `hf download` 进行本地下载。
|
| 79 |
|
| 80 |
```bash
|
| 81 |
+
apt-get install -y python3.11
|
|
|
|
| 82 |
|
| 83 |
+
#若无法直接访问 可使用国内代理
|
| 84 |
+
export HF_ENDPOINT=https://hf-mirror.com
|
| 85 |
|
| 86 |
+
pip install -U huggingface_hub
|
| 87 |
+
hf download AXERA-TECH/immich --local-dir .
|
| 88 |
```
|
| 89 |
|
| 90 |
+
## 2. Docker 服务部署
|
|
|
|
| 91 |
|
| 92 |
+
### (1) 解压配置文件(必做)
|
|
|
|
| 93 |
|
| 94 |
+
- 进入拉取的 `immich` 代码目录,解压部署文件并创建 `.env` 环境变量文件。
|
| 95 |
|
|
|
|
|
|
|
|
|
|
| 96 |
```bash
|
| 97 |
+
cd immich
|
| 98 |
+
unzip -o docker-deploy.zip
|
| 99 |
+
cp example.env .env
|
| 100 |
```
|
| 101 |
|
| 102 |
+
### (2)Docker 环境配置(可选)
|
| 103 |
|
| 104 |
+
- **修改数据目录**:若内部空间不够,可修改 Docker 镜像路径至 SD Card。创建 `/mnt/sdcard/docker_data` 目录后,修改 `/lib/systemd/system/docker.service`,在 `ExecStart` 后面添加 `-data-root=/mnt/sdcard/docker_data` 并重启服务。请务必确保 SD Card 已配置开机自动挂载。
|
| 105 |
+
- **设置 Docker 代理**:若由于网络问题无法访问外部镜像,可为 Docker 添加 HTTP/HTTPS 代理配置(写入 `/etc/systemd/system/docker.service.d/http-proxy.conf` 并重启服务)或直接改用国内镜像源。
|
| 106 |
+
|
| 107 |
+
### (3)导入并启动镜像(必做)
|
| 108 |
+
|
| 109 |
+
- 加载离线 Docker 镜像包,并使用 Docker Compose 启动容器服务。
|
| 110 |
|
|
|
|
|
|
|
| 111 |
```bash
|
| 112 |
+
docker load -i ax-immich-server-aarch64.tar.gz
|
| 113 |
+
docker compose -f docker-compose.yml -f docker-compose.override.yml up -d
|
| 114 |
```
|
| 115 |
|
| 116 |
+
- 可通过 `docker ps` 查看容器状态。若长时间处于 "starting" 状态,建议使用 `docker logs immich_server --tail 20` 等命令排查启动日志。
|
| 117 |
+
- 启动正常后,通过浏览器访问 `http://<开发板IP>:2283` 即可进入网页端进行注册和登录。
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
## 3. 机器学习 (ML) 服务部署
|
| 121 |
+
|
| 122 |
+
### (1)配置 Python 虚拟环境(可选)
|
| 123 |
+
|
| 124 |
+
- 若主存储空间不够,可安装 `python3.11-venv` 并在 SD Card 上创建虚拟环境 `/mnt/sdcard/immich_venv` 以节省空间。
|
| 125 |
+
|
| 126 |
```bash
|
| 127 |
+
apt-get install -y python3.11-venv
|
| 128 |
+
python3.11 -m venv /mnt/sdcard/immich_venv
|
| 129 |
```
|
| 130 |
|
| 131 |
+
### (2)安装 ML 依赖包(必做)
|
|
|
|
| 132 |
|
| 133 |
+
- 可根据自身情况选择直接**全局安装**或进入**虚拟环境安装**(二选一),建议使用虚拟环境。
|
| 134 |
|
| 135 |
+
**全局安装:**
|
| 136 |
|
| 137 |
```bash
|
| 138 |
+
#注意安装py 3.11版本(v2.7.5 immich官方指定)
|
| 139 |
+
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
|
| 140 |
+
|
| 141 |
+
# 安装依赖
|
| 142 |
+
pip install -r requirements.txt
|
| 143 |
+
|
| 144 |
+
#建议选择PyAXEngine最新版本 当前最新0.1.3.rc3
|
| 145 |
+
pip install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc3/axengine-0.1.3-py3-none-any.whl
|
| 146 |
+
|
| 147 |
+
#安装Wheel包
|
| 148 |
+
pip install immich_ml-2.7.5-py3-none-any.whl
|
| 149 |
```
|
| 150 |
|
| 151 |
+
**虚拟环境安装**
|
| 152 |
+
|
| 153 |
+
为了避免存储不够,安装时可通过 `TMPDIR` 和 `-cache-dir` 参数将临时文件与缓存放到 SD Card 上。
|
| 154 |
|
| 155 |
```bash
|
| 156 |
+
# 激活虚拟环境(若使用了venv)
|
| 157 |
+
source /mnt/sdcard/immich_venv/bin/activate
|
| 158 |
+
|
| 159 |
+
# 安装依赖
|
| 160 |
+
TMPDIR=/mnt/sdcard pip install -r requirements.txt --cache-dir /mnt/sdcard/.pip_cache
|
| 161 |
+
|
| 162 |
+
#建议选择PyAXEngine最新版本 当前最新0.1.3.rc3
|
| 163 |
+
TMPDIR=/mnt/sdcard pip install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc3/axengine-0.1.3-py3-none-any.whl --cache-dir /mnt/sdcard/.pip_cache
|
| 164 |
+
|
| 165 |
+
#安装Wheel包
|
| 166 |
+
TMPDIR=/mnt/sdcard pip install immich_ml-2.7.5-py3-none-any.whl --cache-dir /mnt/sdcard/.pip_cache
|
| 167 |
```
|
| 168 |
|
| 169 |
+
PyAXEngine最新版本获取:[**PyAXEngine GitHub**](https://github.com/AXERA-TECH/pyaxengine)
|
| 170 |
|
| 171 |
+
### (3) 启动 ML 服务(必做)
|
| 172 |
+
|
| 173 |
+
- **算力卡检测**:若需要使用算力卡,通过指令 axcl-smi 确定算力卡是否正常,可见类似输出:
|
| 174 |
+
|
| 175 |
+
```bash
|
| 176 |
+
root@ax650:/opt/bin/axcl# ./axcl-smi
|
| 177 |
+------------------------------------------------------------------------------------------------+
|
| 178 |
+
| AXCL-SMI V3.15.0_20260609020154 Driver V3.15.0_20260609020154 |
|
| 179 |
+-----------------------------------------+--------------+---------------------------------------+
|
| 180 |
| Card Name Firmware | Bus-Id | Memory-Usage |
|
| 181 |
| Fan Temp Pwr:Usage/Cap | CPU NPU | CMM-Usage |
|
| 182 |
|=========================================+==============+=======================================|
|
| 183 |
+
| 0 AX8850 V3.15.0 | 0001:81:00.0 | 148 MiB / 945 MiB |
|
| 184 |
+
| -- 39C -- / -- | 1% 0% | 18 MiB / 7040 MiB |
|
| 185 |
+-----------------------------------------+--------------+---------------------------------------+
|
| 186 |
|
| 187 |
+------------------------------------------------------------------------------------------------+
|
|
|
|
| 189 |
| Card PID Process Name NPU Memory Usage |
|
| 190 |
|================================================================================================|
|
| 191 |
```
|
|
|
|
| 192 |
|
| 193 |
+
- **启动immich_ml服务**:激活对应的 Python 环境,配置主机与端口信息后启动 `immich_ml` 服务(若使用虚拟环境需要注意是否处于虚拟环境中)。
|
| 194 |
|
| 195 |
+
**标准启动:**
|
| 196 |
|
| 197 |
+
```bash
|
| 198 |
+
IMMICH_HOST=0.0.0.0 IMMICH_PORT=3003 python -m immich_ml
|
| 199 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
|
| 201 |
+
**指定缓存目录启动方式(推荐空间不足者使用):**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
|
| 203 |
+
若需进一步节省根分区空间,可指定 `MACHINE_LEARNING_CACHE_FOLDER` 与 `HF_HOME` 环境变量将模型缓存存放至 SD Card。
|
| 204 |
|
| 205 |
+
```bash
|
| 206 |
+
mkdir -p /mnt/sdcard/immich_ml_cache /mnt/sdcard/huggingface
|
| 207 |
+
MACHINE_LEARNING_CACHE_FOLDER=/mnt/sdcard/immich_ml_cache HF_HOME=/mnt/sdcard/huggingface IMMICH_HOST=0.0.0.0 IMMICH_PORT=3003 python -m immich_ml
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
```
|
| 209 |
|
| 210 |
+
**使用本地模型启动(推荐网络无法访问者使用):**
|
| 211 |
|
| 212 |
+
immich在启动ml服务时,会通过网络检测有无模型更新需求,若无法访问网络,可以获取模型后使用本地模型启动。
|
|
|
|
|
|
|
|
|
|
| 213 |
|
| 214 |
+
如若使用[**CN-CLIP-L/14-336 (Chinese)**](https://huggingface.co/AXERA-TECH/ViT-L-14-336-CN__axera)模型,拉取模型放到模型目录(实际目录可根据immich_ml日志进行查看),可能目录如下:
|
| 215 |
|
| 216 |
+
```bash
|
| 217 |
+
#采用标准启动,可能路径为:
|
| 218 |
+
/root/.cache/immich_ml/clip/ViT-L-14-336-CN__axera
|
| 219 |
+
|
| 220 |
+
#指定目录启动,根据目录路径进行查找,比如:
|
| 221 |
+
/mnt/sdcard/immich_ml_cache/clip/ViT-L-14-336-CN__axera
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
```
|
| 223 |
|
| 224 |
+
指定 `HF_HUB_OFFLINE=1` 进行启动,如:
|
| 225 |
|
| 226 |
+
```bash
|
| 227 |
+
HF_HUB_OFFLINE=1 IMMICH_HOST=0.0.0.0 IMMICH_PORT=3003 python -m immich_ml
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
```
|
| 229 |
|
| 230 |
+
## 4. 功能验证与设置
|
| 231 |
|
| 232 |
+
### **(1)查询网关 IP**:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
|
| 234 |
+
在宿主机通过命令 `docker network inspect immich_default | grep Gate` 查看 IP(通常类似于 `172.19.0.1`)。
|
| 235 |
|
| 236 |
+
### **(2)配置 ML 服务**:
|
|
|
|
| 237 |
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
+
登录 Immich **网页端**,点击左上角**头像**,选择**Administration**,进入**设置**,选择**机器学习设置**,配置上一步获取到的 IP,并填写模型,如填为`ViT-L-14-336-CN__axera`。
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
### **(3)上传与测试**:
|
| 243 |
|
| 244 |
+
- 在网页端上传图片
|
| 245 |
+
- 创建智能搜索任务
|
| 246 |
+
- 任务处理完毕后,执行智能搜索以验证 ML 服务是否正常解析图像特征。
|
| 247 |
+
|
| 248 |
|
| 249 |
+

|
| 250 |
|
| 251 |
+

|
| 252 |
|
|
|
|
| 253 |
|
| 254 |
+

|
| 255 |
|
| 256 |
+
### (4)APP测试
|
| 257 |
|
| 258 |
+
- 下载app,并使手机在同一网络环境下
|
| 259 |
+
- 填写ip和账号密码进入
|
| 260 |
+
- 进行智能搜索
|
| 261 |
|
| 262 |
+

|
| 263 |
|
| 264 |
+
# 六、性能评估
|
| 265 |
|
| 266 |
+
在当前测试场景下,Immich 服务由 Docker 中的 `server/postgres/redis` 与宿主机 `immich_ml` 组成。由于模型懒加载、运行时缓存、数据库缓存以及AX CMM 分配策略等因素,MEM与 CMM 占用会受操作影响。
|
| 267 |
|
| 268 |
+
AX650板卡采用 `AxEngineExecutionProvider`,处理182张图片。
|
| 269 |
|
| 270 |
+
智能搜索任务处理期间观察到的资源占用峰值约为:
|
| 271 |
|
| 272 |
+
- CPU:整机总 CPU 约 5%~6%
|
| 273 |
+
- MEM:约 1.5~1.6 GiB
|
| 274 |
+
- CMM:约 600 MiB
|