LaMa
LaMa fills masked regions of an image.
- Задачі
- restoration
- Встановлення
pip install "libreyolo[onnx]"- Рівень підтримки
- Лише інференс, починаючи з v1.6.0. Лише передбачення, валідація та експорт. Функції навчання не застосовуються.
- Ліцензії
- Код: MIT, ваги: Apache-2.0. Комерційне використання
Install
pip install "libreyolo[onnx]"Predict
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreLaMab-restore.pt", device="cpu")import numpy as npfrom PIL import Image image = Image.open(SAMPLE_IMAGE).convert("RGB")mask = np.zeros((image.height, image.width), dtype=np.uint8)mask[image.height//3:2*image.height//3, image.width//3:2*image.width//3] = 255result = model(image, mask=mask)result.restored.save("inpainted.png")Pass mask= for single-image inference: nonzero pixels mark the region to fill. The checkpoint embeds an ONNX graph and requires ONNX Runtime 1.18 or later. Training and export are not supported.
Validate
from libreyolo import LibreYOLO model = LibreYOLO("LibreLaMab-restore.pt", device="cpu")# Restore dataset YAML with paired inputs/targets folders plus a mask_dir keymetrics = model.val(data="path/to/your/restore.yaml", workers=0)print(metrics)Use the dataset format for this task. Validation explains the dataset requirements and returned metrics.
Checkpoints
| Файл | Ліцензія ваг |
|---|---|
| Restoration | |
| LibreLaMab-restore.pt | apache-2.0 |
Кожен наведений вище файл уже доступний у організації LibreYOLO і завантажується під час першого використання.
Licensing
Перевіряйте ліцензію в репозиторії Hugging Face конкретних ваг, які завантажуєте. Кожна контрольна точка в організації LibreYOLO має ліцензію, і вона не завжди однакова для всього сімейства. Цей репозиторій є авторитетним джерелом, а наведене нижче резюме описує умови на момент останньої перевірки сторінки.
Це опис відповідних ліцензій, а не юридична консультація. Якщо відповідь має комерційне значення, самостійно прочитайте ліцензії та зверніться по юридичну консультацію.
- Оригінальна робота
- LaMa, Samsung Research
- Ліцензія першоджерела
- Apache-2.0
- Джерело першоджерела
- github.com/advimman/lama
- Код LibreYOLO
- MIT
- Ваги
- Apache-2.0, повторно опубліковано на huggingface.co/LibreYOLO
- Тлумачення
- The mirrored ONNX artifact carries the OpenCV publisher's Apache-2.0 declaration.
Citation
@article{suvorov2021resolution,
title={Resolution-robust Large Mask Inpainting with Fourier Convolutions},
author={Suvorov, Roman and Logacheva, Elizaveta and Mashikhin, Anton and Remizova, Anastasia and Ashukha, Arsenii and Silvestrov, Aleksei and Kong, Naejin and Goka, Harshith and Park, Kiwoong and Lempitsky, Victor},
journal={arXiv preprint arXiv:2109.07161},
year={2021}
}Скопійовано з блоку цитування авторів на сторінці raw.githubusercontent.com/advimman/lama/main/README.md.