BiliSakura / CRM-transformers

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: August 17 2026
image-segmentation

Introduction of CRM-transformers

Model Details of CRM-transformers

CRM Transformers Model

Self-contained Hugging Face checkpoint converted from the official Continuous Refinement Model (CRM) weights ( model_45705 ) in High Quality Segmentation for Ultra High-resolution Images .

The folder crm-resnet50/ ships remote code ( modeling_crm.py , image processor, pipeline) plus model.safetensors / config.json and loads with trust_remote_code=True .

Original paper: High Quality Segmentation for Ultra High-resolution Images
Original code: Entity / High-Quality-Segmention
Converted for Hugging Face by: BiliSakura
License (weights / original code): CC BY-NC 4.0

What CRM does

CRM is a mask refinement model, not a from-scratch segmenter. It takes:

  1. an RGB image
  2. a coarse binary mask (from PSPNet, DeepLab, SAM, etc.)

and continuously aligns encoder features with the refinement target via an implicit MLP (LIIF-style local ensemble). Inference can stay at native resolution; the paper's multi-scale schedule is 0.125 → 0.25 → 0.5 → 1.0 .

Checkpoint
Folder Backbone Stem Decoder Source
crm-resnet50 Dilated ResNet-50 + 3-level ASPP 4-channel (RGB + mask) MLP [32, 32, 32, 32] model_45705

Synchronized BatchNorm from the original training code is stored as ordinary nn.BatchNorm2d (equivalent at eval time). Layer-4 weights are kept for checkpoint compatibility but are unused by the ASPP decoder, matching the original forward.

Usage
from transformers import pipeline
from PIL import Image

MODEL = "/path/to/CRM-transformers/crm-resnet50"

pipe = pipeline(
    task="image-segmentation",
    model=MODEL,
    trust_remote_code=True,
)

image = Image.open("image.png").convert("RGB")
coarse_mask = Image.open("coarse_mask.png").convert("L")  # 0/255
segments = pipe(image, mask=coarse_mask)

# Native Hugging Face image-segmentation schema:
# [{"score": None, "label": "foreground", "mask": PIL.Image}, ...]
for item in segments:
    print(item["label"], item["mask"].size)

The task is also inferred if you omit it (this repo registers a single custom pipeline):

pipe = pipeline(model=MODEL, trust_remote_code=True)

Disable the paper's multi-scale schedule for a single full-resolution pass:

segments = pipe(image, mask=coarse_mask, do_multi_scale=False)

Load components directly:

from transformers import AutoImageProcessor, AutoModelForSemanticSegmentation

processor = AutoImageProcessor.from_pretrained(MODEL, trust_remote_code=True)
model = AutoModelForSemanticSegmentation.from_pretrained(MODEL, trust_remote_code=True)

inputs = processor(images=image, segmentation_maps=coarse_mask, return_tensors="pt")
outputs = model(
    pixel_values=inputs["pixel_values"],
    coarse_masks=inputs["coarse_masks"],
)
# logits: (1, 2, H', W')  — argmax is equivalent to sigmoid(raw) > 0.5
maps = processor.post_process_semantic_segmentation(
    outputs, target_sizes=inputs["original_sizes"]
)
Preprocessing

preprocessor_config.json matches the original evaluation loader:

Input Transform
RGB /255 , ImageNet mean/std [0.485, 0.456, 0.406] / [0.229, 0.224, 0.225]
Coarse mask /255 , mean/std 0.5 → [-1, 1]
Both reflect pad 32 px (cropped back in post-process)
Resize off by default ( do_resize: false ) so native (H, W) is preserved
Citation
@inproceedings{shen2022high,
  title={High Quality Segmentation for Ultra High-resolution Images},
  author={Shen, Tiancheng and Zhang, Yuechen and Qi, Lu and Kuen, Jason and Xie, Xingyu and Wu, Jianlong and Lin, Zhe and Jia, Jiaya},
  booktitle={CVPR},
  year={2022}
}

Runs of BiliSakura CRM-transformers on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About CRM-transformers huggingface.co Model

More CRM-transformers license Visit here:

https://choosealicense.com/licenses/cc-by-nc-4.0

CRM-transformers huggingface.co

CRM-transformers huggingface.co is an AI model on huggingface.co that provides CRM-transformers's model effect (), which can be used instantly with this BiliSakura CRM-transformers model. huggingface.co supports a free trial of the CRM-transformers model, and also provides paid use of the CRM-transformers. Support call CRM-transformers model through api, including Node.js, Python, http.

CRM-transformers huggingface.co Url

https://huggingface.co/BiliSakura/CRM-transformers

BiliSakura CRM-transformers online free

CRM-transformers huggingface.co is an online trial and call api platform, which integrates CRM-transformers's modeling effects, including api services, and provides a free online trial of CRM-transformers, you can try CRM-transformers online for free by clicking the link below.

BiliSakura CRM-transformers online free url in huggingface.co:

https://huggingface.co/BiliSakura/CRM-transformers

CRM-transformers install

CRM-transformers is an open source model from GitHub that offers a free installation service, and any user can find CRM-transformers on GitHub to install. At the same time, huggingface.co provides the effect of CRM-transformers install, users can directly use CRM-transformers installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

CRM-transformers install url in huggingface.co:

https://huggingface.co/BiliSakura/CRM-transformers

Url of CRM-transformers

CRM-transformers huggingface.co Url

Provider of CRM-transformers huggingface.co

BiliSakura
ORGANIZATIONS

Other API from BiliSakura

huggingface.co

Total runs: 132
Run Growth: 101
Growth Rate: 76.52%
Updated:February 16 2026
huggingface.co

Total runs: 22
Run Growth: -20
Growth Rate: -90.91%
Updated:February 16 2026
huggingface.co

Total runs: 18
Run Growth: 10
Growth Rate: 55.56%
Updated:March 09 2026
huggingface.co

Total runs: 7
Run Growth: -18
Growth Rate: -257.14%
Updated:March 09 2026
huggingface.co

Total runs: 3
Run Growth: -2
Growth Rate: -66.67%
Updated:March 09 2026
huggingface.co

Total runs: 2
Run Growth: -6
Growth Rate: -300.00%
Updated:March 09 2026