LibreLaMab-restore
Mask-guided LaMa inpainting under LibreYOLO's existing restore task. This
checkpoint embeds the exact fixed-512 QDQ ONNX graph published by OpenCV Zoo.
Every nonzero mask pixel means fill; zero means preserve.
OpenCV Zoo publishes the exact ONNX artifact under Apache-2.0. The graph was trained on Places365-Challenge, whose image-download terms are limited to non-commercial research and education. Those terms do not expressly define trained-model redistribution, and commercial training-data clearance was not independently established. No Places365 image is included here.
pip install "libreyolo[onnx]"
from libreyolo import LibreYOLO
model = LibreYOLO("LibreLaMab-restore.pt")
result = model("photo.jpg", mask="erase-mask.png")
result.restored.save("inpainted.png")
The image and mask must share one canvas. LibreYOLO restores the source size and copies every unmasked source pixel back exactly.
Provenance
- Artifact repository: opencv/inpainting_lama
- Revision:
aee6d22f0a13e5e35af1c9a1c3afd62841fc6f3f - Source file:
inpainting_lama_2025jan.onnx, 92,591,623 bytes - Source SHA-256:
7df918ac3921d3daf0aae1d219776cf0dc4e4935f035af81841b40adcf74fdf2 - Converted SHA-256:
2cb9a47f76ced186749b641a0ba5ff86e534203ad34c362d30abfad5b9e3a8be - OpenCV Zoo source: opencv/opencv_zoo at
966be4cb6eefc2a4f586ed0581bf4bbaa2533070
The ONNX bytes are unchanged and are stored as one persistent uint8
state-dict buffer. LibreYOLO verifies the embedded bytes before creating the
ONNX Runtime session. OpenCV 4.x cannot execute this opset-21 graph; the
LibreYOLO runtime requires ONNX Runtime 1.18 or newer.
License
OpenCV Zoo declares all files in the model directory Apache-2.0. See
LICENSE and NOTICE. The Places365 caveat above
is retained separately.