Downloads · 30 days
17
23% of all-time downloads
zeromodels/beit-base-finetuned-ade-640-640
beit-base-finetuned-ade-640-640 is a image segmentation model from zeromodels. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for zeromodels. The card lists the license as apache-2.0.
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/beit/) [](https://huggingface.co/collections/zeromodels/beit-6a9352067192fd9fcfcfe6f1)
Downloads · 30 days
17
23% of all-time downloads
All-time downloads
74
Public
Repo size
590 MB
Likes
0
Public
Click a slice to open those files.
.h5590 MB · 100%
From the Hugging Face model README
Paper: BEiT: BERT Pre-Training of Image Transformers (arXiv:2106.08254) · HF Papers
BEiT is a ViT-family vision transformer with a per-layer relative position bias, a learnable layer scale on each residual branch, and mean pooling of the patch tokens. Base backbone with a UPerNet head fine-tuned on ADE20K (150 classes).
For more details on the model, please go to Microsoft's original model card.
Pure-Keras 3 conversion of microsoft/beit-base-finetuned-ade-640-640 for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is a semantic segmentation checkpoint (BeitSemanticSegment).
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.beit import BeitSemanticSegment, BeitImageProcessor
model = BeitSemanticSegment.from_weights("zeromodels/beit-base-finetuned-ade-640-640")
processor = BeitImageProcessor.from_weights("zeromodels/beit-base-finetuned-ade-640-640") # resize 640 + post-processing
image = Image.open("scene.jpg").convert("RGB")
pixels = processor(image) # (1, 640, 640, 3), raw [0, 255]; the model normalizes
logits = model(pixels, training=False) # (1, H/4, W/4, 150), channels_last
seg = processor.post_process_semantic_segmentation(
logits, target_sizes=[image.size[::-1]] # (height, width)
)[0] # per-pixel ADE20K label map at full resolution
Load the segmentation checkpoints the same way with from_weights("zeromodels/<variant>")
(the classification variants are in the collection):
| Variant | Hub | Task |
|---|---|---|
beit-base-finetuned-ade-640-640 | zeromodels/beit-base-finetuned-ade-640-640 | semantic segmentation |
beit-large-finetuned-ade-640-640 | zeromodels/beit-large-finetuned-ade-640-640 | semantic segmentation |
KERAS_BACKEND before importing Keras / zeromodels.[0, 255] pixels; BeitImageProcessor handles the resize and does not normalize.BeitSemanticSegment returns logits at a quarter of the input resolution. BeitImageProcessor.post_process_semantic_segmentation(logits, target_sizes=[(H, W)]) upsamples them to your image size (bilinear, then argmax) and returns a per-pixel label map.BeitModel.from_weights(..., as_backbone=True) returns the per-block token sequences for feature extraction.hf: prefix, e.g. BeitSemanticSegment.from_weights("hf:microsoft/beit-base-finetuned-ade-640-640").A huge thank you to the Microsoft Research BEiT authors for creating and releasing these models.
License: Apache 2.0.