File size: 1,607 Bytes
ef3cdb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
license: apache-2.0
library_name: coreml
pipeline_tag: image-to-image
tags: [inpainting, lama, coreml, apple-silicon, object-removal]
base_model: smartywu/big-lama
---

# LaMa (big-lama) for Core ML — object removal

What `img erase` in the arraypress tools downloads: give it a picture and a mask of what to
remove, and LaMa fills the hole plausibly. 800×800 image and mask in, image out; outside the
mask the input passes through untouched.

## Provenance and verification

- **Weights:** big-lama from [advimman/lama](https://github.com/advimman/lama) (Apache-2.0),
  via [smartywu/big-lama](https://huggingface.co/smartywu/big-lama) — the download the official
  README gives (`curl -LJO https://huggingface.co/smartywu/big-lama/resolve/main/big-lama.zip`).
- **This package:** the Core ML conversion published at `jerhoads/lama-coreml`
  (commit `da9859ec149712a4bba6dfb2946f097b026bc8ec`), which states no licence of its own.
  Re-hosted unmodified (file hashes identical) so the fleet does not depend on a third-party repo.
- **Verified against the official weights** (`verify_against_official.py`): the original PyTorch
  generator (`FFCResNetGenerator`, `models/best.ckpt`) and this package run on CPU on three
  scenes (gradient + shapes, noise texture, a stock photo) × two masks:
  - inside the mask: **58.9 dB PSNR** in every case — 8-bit rounding, i.e. the same model;
  - outside the mask: identical to the input (max difference 0).
- Conversion metadata: coremltools 7.2 from a TorchScript trace (torch 2.2.0), ML Program.

## Licence

Apache-2.0 — see `LICENSE` and `NOTICE`.