BiRefNet HR-matting for Core ML
BiRefNet_HR-matting by Zheng Peng et al., converted to a Core ML ML Program (fp16) for macOS and iOS.
BiRefNetHRMatting-1.aar: an Apple Archive ofBiRefNetHRMatting.mlpackage. Extract withaa extract -i BiRefNetHRMatting-1.aar -d ..- Input
image: RGB, 2048 ร 2048. ImageNet normalisation is inside the model. - Output
alpha:[1, 1, 2048, 2048]soft matte, 0 to 1. - Run on
.cpuAndGPU. The Neural Engine can't compile it. - Deformable convolution is reimplemented with
grid_sample, matching torchvision to about 1e-5. Mean matte difference from PyTorch is about 0.0003.
MIT licensed, like the original. Please cite the BiRefNet paper: Zheng et al., "Bilateral Reference for High-Resolution Dichotomous Image Segmentation", CAAI AIR 2024.
Model tree for ajx91/BiRefNet_HR-matting-CoreML
Base model
ZhengPeng7/BiRefNet_HR-matting