BEN2
BEN2 predicts a soft foreground alpha matte for background removal.
- Task
- background removal
- Dimensioni
- b at 1024 px
- Installa
pip install libreyolo- Livello di supporto
- Solo inferenza, dalla v1.6.0. Solo predizione, validazione ed esportazione. Le funzionalità di addestramento non si applicano.
- Licenze
- Codice MIT, pesi MIT. Uso commerciale
Install
pip install "libreyolo"Predict
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreBEN2b-matte.pt", device="cpu")result = model(SAMPLE_IMAGE)print(result.matte.array.shape)result.save("cutout.png")Prediction uses a fixed 1024-pixel canvas. Native prediction accepts batches; exports require batch 1. result.save() writes a transparent cutout. Training is not supported.
Validate
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreBEN2b-matte.pt", device="cpu")# data: a matte dataset YAML, or a folder with images/ and mattes/ (grayscale alpha, same file stems)metrics = model.val(data="path/to/your/matte_dataset.yaml", workers=0)print(metrics)Use the dataset format for this task. Validation explains the dataset requirements and returned metrics.
Export
| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Background removal | Background removal to ONNX: supportato | Background removal to TorchScript: supportato | Background removal to ExecuTorch: supportato | Background removal to TensorRT: supportato | Background removal to OpenVINO: supportato | Background removal to Paddle: non supportato | Background removal to MNN: non supportato | Background removal to RKNN: non supportato | Background removal to ncnn: supportato | Background removal to TFLite: non supportato | Background removal to CoreML: non supportato | Background removal to Core AI: non supportato |
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreBEN2b-matte.pt", device="cpu")model.export(format="onnx")Export setup lists format dependencies and loading exported artifacts.
Checkpoints
| File | Licenza dei pesi |
|---|---|
| Background removal | |
| LibreBEN2b-matte.pt | mit |
Oggi tutti i file elencati sopra sono presenti nell<link>organizzazione LibreYOLO</link> e vengono scaricati al primo utilizzo.
Licensing
Controlla la licenza nel repository Hugging Face degli specifici pesi che scarichi. Ogni checkpoint nell<link>organizzazione LibreYOLO</link> ne include una e non è sempre la stessa per tutta la famiglia. Quel repository è la fonte autorevole; il riepilogo seguente descrive le condizioni applicabili al momento dellultima verifica di questa pagina.
Questa è una descrizione delle licenze coinvolte, non una consulenza legale. Se la risposta è importante a fini commerciali, leggi personalmente le licenze e chiedi una consulenza indipendente.
- Lavoro originale
- BEN2, Prama LLC
- Licenza upstream
- MIT
- Sorgente upstream
- github.com/PramaLLC/BEN2
- Codice LibreYOLO
- MIT
- Pesi
- MIT, ripubblicati su huggingface.co/LibreYOLO
- Interpretazione
- The publisher declares MIT for the source and pretrained model.