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 조직에 있으며 처음 사용할 때 내려받습니다.
Licensing
내려받는 특정 가중치의 Hugging Face 저장소에서 라이선스를 확인하십시오. LibreYOLO 조직의 모든 체크포인트에는 라이선스가 있으며 한 계열 안에서도 항상 같지는 않습니다. 해당 저장소가 신뢰할 수 있는 기준입니다. 아래 요약은 이 페이지를 마지막으로 검증했을 때 적용된 내용을 설명합니다.
관련 라이선스에 관한 설명이며 법률 자문이 아닙니다. 상업적으로 중요한 사안이라면 라이선스를 직접 읽고 별도의 법률 자문을 받으십시오.
- 원작
- BEN2, Prama LLC
- 업스트림 라이선스
- MIT
- 업스트림 소스
- github.com/PramaLLC/BEN2
- LibreYOLO 코드
- MIT
- 가중치
- MIT, huggingface.co/LibreYOLO에 다시 게시됨
- 해석
- The publisher declares MIT for the source and pretrained model.