BEN2
BEN2 predicts a soft foreground alpha matte for background removal.
- Tâches
- background removal
- Tailles
- b at 1024 px
- Installer
pip install libreyolo- Niveau de support
- Inférence uniquement, depuis v1.6.0. Prédiction, validation et export uniquement. Les fonctionnalités d'entraînement ne s'appliquent pas.
- Licences
- Code MIT, poids MIT. Usage commercial
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
| Tâche | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Background removal | Background removal to ONNX : pris en charge | Background removal to TorchScript : pris en charge | Background removal to ExecuTorch : pris en charge | Background removal to TensorRT : pris en charge | Background removal to OpenVINO : pris en charge | Background removal to Paddle : non pris en charge | Background removal to MNN : non pris en charge | Background removal to RKNN : non pris en charge | Background removal to ncnn : pris en charge | Background removal to TFLite : non pris en charge | Background removal to CoreML : non pris en charge | Background removal to Core AI : non pris en charge |
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
| Fichier | Licence des poids |
|---|---|
| Background removal | |
| LibreBEN2b-matte.pt | mit |
Tous les fichiers ci-dessus sont actuellement disponibles dans l<link>organisation LibreYOLO</link> et sont téléchargés à la première utilisation.
Licensing
Vérifiez la licence dans le dépôt Hugging Face des poids précis que vous téléchargez. Chaque checkpoint de l<link>organisation LibreYOLO</link> en possède une, et elles ne sont pas toujours identiques au sein dune même famille. Ce dépôt fait autorité ; le résumé ci-dessous décrit les conditions applicables lors de la dernière vérification de cette page.
Ceci décrit les licences concernées et ne constitue pas un conseil juridique. Si la réponse a une importance commerciale, lisez vous-même les licences et consultez votre propre avocat.
- Travail d'origine
- BEN2, Prama LLC
- Licence du projet d'origine
- MIT
- Source du projet d'origine
- github.com/PramaLLC/BEN2
- Code de LibreYOLO
- MIT
- Poids
- MIT, republiés sur huggingface.co/LibreYOLO
- Interprétation
- The publisher declares MIT for the source and pretrained model.