Zum Inhalt springen
ModelAufgelistetExtern
Herunterladen

Mit B5 Cityscapes 1024

A Keras model implementing the MixTransformer architecture to be used as a backbone for the SegFormer architecture. This model is supported in both KerasCV and KerasHub. KerasCV will no longer be actively developed,...

ArtOtherVersionRevision c8cf432BBewertung

Modellquelle

Art
Other
Dateigröße
313 MB
Version
vRevision c8cf432
Aktualisiert
1. Nov. 2026
Downloads
15
Quelle
Hugging Face

Quellenbeschreibung

Model Overview

A Keras model implementing the MixTransformer architecture to be used as a backbone for the SegFormer architecture. This model is supported in both KerasCV and KerasHub. KerasCV will no longer be actively developed, so please try to use KerasHub.

References:

Links

Installation

Keras and KerasHub can be installed with:

pip install -U -q keras-Hub
pip install -U -q keras

Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the Keras Getting Started page.

Presets

The following model checkpoints are provided by the Keras team. Weights have been ported from https://dl.fbaipublicfiles.com/segment_anything/. Full code examples for each are available below. Here's the table formatted similarly to the given pattern:

Here's the updated table with the input resolutions included in the descriptions:

Preset nameParametersDescription
mit_b0_ade20k_5123.32MMiT (MixTransformer) model with 8 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels.
mit_b1_ade20k_51213.16MMiT (MixTransformer) model with 8 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels.
mit_b2_ade20k_51224.20MMiT (MixTransformer) model with 16 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels.
mit_b3_ade20k_51244.08MMiT (MixTransformer) model with 28 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels.
mit_b4_ade20k_51260.85MMiT (MixTransformer) model with 41 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels.
mit_b5_ade20k_64081.45MMiT (MixTransformer) model with 52 transformer blocks, trained on the ADE20K dataset with an input resolution of 640x640 pixels.
mit_b0_cityscapes_10243.32MMiT (MixTransformer) model with 8 transformer blocks, trained on the Cityscapes dataset with an input resolution of 1024x1024 pixels.
mit_b1_cityscapes_102413.16MMiT (MixTransformer) model with 8 transformer blocks, trained on the Cityscapes dataset with an input resolution of 1024x1024 pixels.
mit_b2_cityscapes_102424.20MMiT (MixTransformer) model with 16 transformer blocks, trained on the Cityscapes dataset with an input resolution of 1024x1024 pixels.
mit_b3_cityscapes_102444.08MMiT (MixTransformer) model with 28 transformer blocks, trained on the Cityscapes dataset with an input resolution of 1024x1024 pixels.
mit_b4_cityscapes_102460.85MMiT (MixTransformer) model with 41 transformer blocks, trained on the Cityscapes dataset with an input resolution of 1024x1024 pixels.
mit_b5_cityscapes_102481.45MMiT (MixTransformer) model with 52 transformer blocks, trained on the Cityscapes dataset with an input resolution of 1024x1024 pixels.

Example Usage

Using the class with a backbone:

import tensorflow as tf
import keras_cv
import numpy as np

images = np.ones(shape=(1, 96, 96, 3))
labels = np.zeros(shape=(1, 96, 96, 1))
backbone = keras_cv.models.MiTBackbone.from_preset("mit_b5_cityscapes_1024")

# Evaluate model
model(images)

# Train model
model.compile(
     optimizer="adam",
     loss=keras.losses.BinaryCrossentropy(from_logits=False),
     metrics=["accuracy"],
)
model.fit(images, labels, epochs=3)

Example Usage with Hugging Face URI

Using the class with a backbone:

import tensorflow as tf
import keras_cv
import numpy as np

images = np.ones(shape=(1, 96, 96, 3))
labels = np.zeros(shape=(1, 96, 96, 1))
backbone = keras_cv.models.MiTBackbone.from_preset("hf://keras/mit_b5_cityscapes_1024")

# Evaluate model
model(images)

# Train model
model.compile(
     optimizer="adam",
     loss=keras.losses.BinaryCrossentropy(from_logits=False),
     metrics=["accuracy"],
)
model.fit(images, labels, epochs=3)

Quellen

1 Quelle
Hugging FacePrimärVersion c8cf4327af2cb7282da5c43f604182d7a07a9316
huggingface.co/keras/mit_b5_cityscapes_1024/tree/c8cf4327af2cb7282da5c43f604182d7a07a9316

Verifiziert 1. Nov.

Download files

Repository files

File inventory only; completeness is unverified.

Modellartefakte

1 Artefakt

model.weights.h5

h5 · 313 MB · SHA-256 e29b664cf569…9ef6 · Hugging Face

Download file

Quellenauszüge

3 Auszüge

--- library_name: keras-hub tags: - image-segmentation - keras pipeline_tag: keypoint-detection --- ### Model Overview A Keras model implementing the MixTransformer architecture to be used as a backbone for the SegFormer architecture. This model is supported in both KerasCV and KerasHub. KerasCV will no longer be actively developed, so please try to use KerasHub. References: - [SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers](https://arxiv.org/abs/2105.15203) # noqa: E501 - [Based on the TensorFlow implementation from DeepVision](https://github.com/DavidLandup0/deepvision/tree/main/deepvision/models/classification/mix_transformer) # noqa: E501 ## Links * [MiT Quickstart Notebook](https://www.kaggle.com/code/laxmareddypatlolla/mit-quickstart-notebook) * [MiT API Documentation](https://keras.io/keras_hub/api/models/mit/) * [KerasHub Beginner Guide](https://keras.io/guides/keras_hub/getting_started/) * [KerasHub Model Publishing Guide](https://keras.io/guides/keras_hub/upload/) ## Installation Keras and KerasHub can be installed with: ``` pip install -U -q keras-Hub pip install -U -q keras ``` Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the [Keras Getting Started](https://keras.io/getting_started/) page. ## Presets The following model checkpoints are provided by the Keras team. Weights have been ported from https://dl.fbaipublicfiles.com/segment_anything/. Full code examples for each are available below. Here's the table formatted similarly to the given pattern: Here's the updated table with the input resolutions included in the descriptions: | Preset name | Parameters | Description | |--------------------------|------------|--------------------------------------------------------------------------------------------------| | mit_b0_ade20k_512 | 3.32M | MiT (MixTransformer) model with 8 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels. | | mit_b1_ade20k_512 | 13.16M | MiT (MixTransformer) model with 8 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels. | | mit_b2_ade20k_512 | 24.20M | MiT (MixTransformer) model with 16 transformer blocks, trained on the ADE20K dataset with an input resolution of 512x512 pixels. | | mit_b3_ade20k_512 | 44.08M | Mi...

Source context: 15 downloads · 0 likes · Pipeline keypoint-detection · Library keras-hub · Repo keras/mit_b5_cityscapes_1024

Source context: 9 downloads · 0 likes · Pipeline keypoint-detection · Library keras-hub · Repo keras/mit_b5_cityscapes_1024