fix(ai): pin protobuf<5 on arm64 so mediapipe face landmarks work (#417)

* fix(ai): pin protobuf<5 on arm64 so mediapipe face landmarks work

aarch64 has no mediapipe wheel above 0.10.18, and 0.10.18 calls
MessageFactory.GetPrototype (removed in protobuf 5+). With protobuf
unpinned, the paddle/onnxruntime deps pull protobuf 7.x into the shared
AI venv and break mediapipe FaceLandmarker, so red-eye-removal fails on
every input (blur-faces and smart-crop keep working via a prebuilt graph).

Split mediapipe by platform and pin protobuf>=4.25.3,<5 for aarch64 only.
x86_64 keeps mediapipe 0.10.35, which works with protobuf 7, so
requirements-gpu.txt (amd64 only) stays unpinned. Also fixes a latent
issue where mediapipe>=0.10.21 was unsatisfiable on aarch64.

Verified live on the arm64 container: red-eye-removal completes on real
jpg and heic faces; OCR (tesseract) and paddle import unaffected.

Claude-Session: https://claude.ai/code/session_01VtvE6K8iEr5jGFJJpHEaPA

* fix(ai): pin protobuf<5 in arm64 bundles lacking a mediapipe constraint

Bundles are built from docker/feature-manifest.json, not requirements.txt, so
this is the change that actually fixes the shipped arm64 bundles. On arm64,
object-eraser-colorize (onnxruntime), ocr (paddle) and transcription
(faster-whisper pulls onnxruntime) install a protobuf-dependent package with no
mediapipe to cap protobuf, so they bake protobuf 7.x. All bundles share one
/data/ai/venv at install time, so whichever of those installs last overwrites
protobuf to 7.x and breaks mediapipe FaceLandmarker (red-eye-removal). Pin
protobuf>=4.25.3,<5 in those three arm64 lists (appended last so it downgrades
after the puller installs). The four mediapipe bundles already resolve <5.

Dry-run on aarch64 confirmed paddle + protobuf 4.25.9 resolve with no conflict.

Claude-Session: https://claude.ai/code/session_01VtvE6K8iEr5jGFJJpHEaPA

* refactor(ai): keep protobuf fix in feature-manifest.json only

requirements.txt is not consumed by the Docker image build (the base
/opt/venv is installed from a hardcoded package list, and the ML libs
ship via bundles), so the requirements changes had no effect on shipped
artifacts and only tripped the dependency-review scanner on the protobuf
range. Revert them; the operative arm64 bundle fix lives entirely in
docker/feature-manifest.json.

Claude-Session: https://claude.ai/code/session_01VtvE6K8iEr5jGFJJpHEaPA
This commit is contained in:
SnapOtter
2026-07-04 12:34:14 +08:00
committed by GitHub
parent 8b3f1e6884
commit 2c2fb65fca
+7 -3
View File
@@ -142,7 +142,7 @@
"packages": {
"common": ["huggingface-hub"],
"amd64": ["onnxruntime-gpu==1.20.1"],
"arm64": ["onnxruntime==1.20.1"]
"arm64": ["onnxruntime==1.20.1", "protobuf>=4.25.3,<5"]
},
"pipFlags": {},
"postInstall": [],
@@ -419,7 +419,11 @@
"paddlepaddle-gpu>=3.2.1 --index-url https://www.paddlepaddle.org.cn/packages/stable/cu126/ --extra-index-url https://pypi.org/simple/",
"paddleocr[doc-parser]>=3.4.0,<3.5.0"
],
"arm64": ["paddlepaddle>=3.2.1", "paddleocr[doc-parser]>=3.4.0,<3.5.0"]
"arm64": [
"paddlepaddle>=3.2.1",
"paddleocr[doc-parser]>=3.4.0,<3.5.0",
"protobuf>=4.25.3,<5"
]
},
"pipFlags": {},
"postInstall": [],
@@ -488,7 +492,7 @@
"packages": {
"common": ["faster-whisper>=1.0.0"],
"amd64": [],
"arm64": []
"arm64": ["protobuf>=4.25.3,<5"]
},
"pipFlags": {},
"postInstall": [],