smp-hub / upernet-swin-large

huggingface.co
Total runs: 221
24-hour runs: 0
7-day runs: 31
30-day runs: 208
Model's Last Updated: April 13 2025
image-segmentation

Introduction of upernet-swin-large

Model Details of upernet-swin-large

UPerNet Model Card

Table of Contents:

Load trained model

Open In Colab

  1. Install requirements.
pip install -U segmentation_models_pytorch albumentations
  1. Run inference.
import torch
import requests
import numpy as np
import albumentations as A
import segmentation_models_pytorch as smp

from PIL import Image

device = "cuda" if torch.cuda.is_available() else "cpu"

# Load pretrained model and preprocessing function
checkpoint = "smp-hub/upernet-swin-large"
model = smp.from_pretrained(checkpoint).eval().to(device)
preprocessing = A.Compose.from_pretrained(checkpoint)

# Load image
url = "https://huggingface.co/datasets/hf-internal-testing/fixtures_ade20k/resolve/main/ADE_val_00000001.jpg"
image = Image.open(requests.get(url, stream=True).raw)

# Preprocess image
np_image = np.array(image)
normalized_image = preprocessing(image=np_image)["image"]
input_tensor = torch.as_tensor(normalized_image)
input_tensor = input_tensor.permute(2, 0, 1).unsqueeze(0)  # HWC -> BCHW
input_tensor = input_tensor.to(device)

# Perform inference
with torch.no_grad():
    output_mask = model(input_tensor)

# Postprocess mask
mask = mask.argmax(1).cpu().numpy()  # argmax over predicted classes (channels dim)
Model init parameters
model_init_params = {
    "encoder_name": "tu-swin_large_patch4_window12_384",
    "encoder_depth": 5,
    "encoder_weights": None,
    "decoder_channels": 512,
    "decoder_use_norm": "batchnorm",
    "in_channels": 3,
    "classes": 150,
    "activation": None,
    "upsampling": 4,
    "aux_params": None,
    "img_size": 512
}
Dataset

Dataset name: ADE20K

More Information

This model has been pushed to the Hub using the PytorchModelHubMixin

Runs of smp-hub upernet-swin-large on huggingface.co

221
Total runs
0
24-hour runs
3
3-day runs
31
7-day runs
208
30-day runs

More Information About upernet-swin-large huggingface.co Model

More upernet-swin-large license Visit here:

https://choosealicense.com/licenses/mit

upernet-swin-large huggingface.co

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

upernet-swin-large huggingface.co Url

https://huggingface.co/smp-hub/upernet-swin-large

smp-hub upernet-swin-large online free

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

smp-hub upernet-swin-large online free url in huggingface.co:

https://huggingface.co/smp-hub/upernet-swin-large

upernet-swin-large install

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

upernet-swin-large install url in huggingface.co:

https://huggingface.co/smp-hub/upernet-swin-large

Url of upernet-swin-large

upernet-swin-large huggingface.co Url

Provider of upernet-swin-large huggingface.co

smp-hub
ORGANIZATIONS

Other API from smp-hub

huggingface.co

Total runs: 37
Run Growth: 24
Growth Rate: 61.54%
Updated:January 16 2025
huggingface.co

Total runs: 18
Run Growth: 3
Growth Rate: 16.67%
Updated:January 16 2025