LaMa

LaMa fills masked regions of an image.

Zadania
restoration
Instalacja
pip install "libreyolo[onnx]"
Poziom obsługi
Tylko inferencja, od wersji v1.6.0. Tylko predykcja, walidacja i eksport. Funkcje trenowania nie mają zastosowania.
Projekt źródłowy
LaMa, autorzy: Samsung Research, licencja: Apache-2.0. Publikacja, kod źródłowy
Licencje
Kod: MIT, wagi: Apache-2.0. Użycie komercyjne

Install

bash
pip install "libreyolo[onnx]"

Predict

Python
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

Python
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

PlikLicencja wag
Restoration
LibreLaMab-restore.ptapache-2.0

Każdy z powyższych plików jest obecnie dostępny w organizacji LibreYOLO i pobierany przy pierwszym użyciu.

Licensing

Sprawdź licencję w repozytorium konkretnych pobieranych wag na Hugging Face. Każdy checkpoint w organizacji LibreYOLO ma licencję, która nie zawsze jest taka sama w całej rodzinie. To repozytorium jest źródłem rozstrzygającym, a poniższe podsumowanie opisuje stan z chwili ostatniej weryfikacji tej strony.

To opis obowiązujących licencji, a nie porada prawna. Jeśli odpowiedź ma znaczenie komercyjne, przeczytaj licencje i zasięgnij własnej porady prawnej.

Oryginalna praca
LaMa, Samsung Research
Licencja projektu źródłowego
Apache-2.0
Kod źródłowy projektu
github.com/advimman/lama
Kod LibreYOLO
MIT
Wagi
Apache-2.0, ponownie opublikowane w huggingface.co/LibreYOLO
Interpretacja
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}
}

Skopiowano z bloku cytowania autorów w raw.githubusercontent.com/advimman/lama/main/README.md.

Zweryfikowano z LibreYOLO v1.6.0. Tabele obsługi, checkpointy i wyniki benchmarków na tej stronie są generowane na podstawie wydanej biblioteki i opublikowanych wag, a nie wpisywane ręcznie.

Architektura LaMa

Wybierz wariant lub przegląd rodziny, a następnie blok, aby zobaczyć szczegóły. Otwórz pełny diagram, aby powiększyć go lub pobrać SVG i PNG. Diagramy są w języku angielskim.