BEN2
BEN2 predicts a soft foreground alpha matte for background removal.
- タスク
- background removal
- サイズ
- b at 1024 px
- インストール
pip install libreyolo- サポートティア
- 推論のみ、v1.6.0以降。推論、検証、エクスポートのみです。学習機能は対象外です。
- ライセンス
- コード:MIT、重み:MIT。商用利用
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
| タスク | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Background removal | Background removal to ONNX:対応 | Background removal to TorchScript:対応 | Background removal to ExecuTorch:対応 | Background removal to TensorRT:対応 | Background removal to OpenVINO:対応 | Background removal to Paddle:非対応 | Background removal to MNN:非対応 | Background removal to RKNN:非対応 | Background removal to ncnn:対応 | Background removal to TFLite:非対応 | Background removal to CoreML:非対応 | Background removal to Core AI:非対応 |
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
| ファイル | 重みのライセンス |
|---|---|
| Background removal | |
| LibreBEN2b-matte.pt | mit |
上記のすべてのファイルは現在LibreYOLO orgにあり、初回使用時にダウンロードされます。
Licensing
ダウンロードする特定の重みについて、Hugging Faceリポジトリのライセンスを確認してください。LibreYOLO orgの各チェックポイントにはライセンスが付与されており、同じファミリー内でも常に同一とは限りません。そのリポジトリが正式な情報源です。以下の概要は、このページを最後に検証した時点で適用されていた内容を示します。
これは関連するライセンスの説明であり、法的助言ではありません。商用上重要な場合は、自分でライセンスを読み、専門家の助言を受けてください。
- 原著作物
- BEN2, Prama LLC
- アップストリームのライセンス
- MIT
- アップストリームのソース
- github.com/PramaLLC/BEN2
- LibreYOLOのコード
- MIT
- 重み
- MIT、huggingface.co/LibreYOLOで再公開
- 解釈
- The publisher declares MIT for the source and pretrained model.