BEN2
BEN2 predicts a soft foreground alpha matte for background removal.
- Tác vụ
- background removal
- Kích thước
- b at 1024 px
- Cài đặt
pip install libreyolo- Bậc hỗ trợ
- Chỉ suy luận, từ v1.6.0. Chỉ dự đoán, kiểm định và xuất. Không áp dụng các tính năng huấn luyện.
- Giấy phép
- Mã nguồn MIT, trọng số MIT. Sử dụng thương mại
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ác vụ | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Background removal | Background removal to ONNX: được hỗ trợ | Background removal to TorchScript: được hỗ trợ | Background removal to ExecuTorch: được hỗ trợ | Background removal to TensorRT: được hỗ trợ | Background removal to OpenVINO: được hỗ trợ | Background removal to Paddle: không được hỗ trợ | Background removal to MNN: không được hỗ trợ | Background removal to RKNN: không được hỗ trợ | Background removal to ncnn: được hỗ trợ | Background removal to TFLite: không được hỗ trợ | Background removal to CoreML: không được hỗ trợ | Background removal to Core AI: không được hỗ trợ |
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
| Tệp | Giấy phép trọng số |
|---|---|
| Background removal | |
| LibreBEN2b-matte.pt | mit |
Mọi tệp ở trên hiện đều có trong tổ chức LibreYOLO và được tải xuống trong lần sử dụng đầu tiên.
Licensing
Hãy kiểm tra giấy phép trong repo Hugging Face của trọng số cụ thể mà bạn tải xuống. Mỗi checkpoint trong tổ chức LibreYOLO đều có giấy phép riêng và giấy phép có thể khác nhau trong cùng một họ. Repo đó là nguồn có thẩm quyền; phần tóm tắt dưới đây mô tả các điều khoản áp dụng khi trang này được kiểm chứng lần gần nhất.
Đây là phần mô tả các giấy phép liên quan, không phải tư vấn pháp lý. Nếu câu trả lời có ý nghĩa về mặt thương mại, hãy tự đọc các giấy phép và tham khảo cố vấn của riêng bạn.
- Công trình gốc
- BEN2, Prama LLC
- Giấy phép thượng nguồn
- MIT
- Nguồn thượng nguồn
- github.com/PramaLLC/BEN2
- Mã nguồn LibreYOLO
- MIT
- Trọng số
- MIT, được phát hành lại tại huggingface.co/LibreYOLO
- Diễn giải
- The publisher declares MIT for the source and pretrained model.