smp-hub / dpt-large-ade20k

huggingface.co
Total runs: 445
24-hour runs: 0
7-day runs: -177
30-day runs: -29
Model's Last Updated: April 07 2025
image-segmentation

Introduction of dpt-large-ade20k

Model Details of dpt-large-ade20k

DPT 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/dpt-large-ade20k"
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 = torch.nn.functional.interpolate(
    output_mask, size=(image.height, image.width), mode="bilinear", align_corners=False
)
mask = mask.argmax(1).cpu().numpy()  # argmax over predicted classes (channels dim)
Model init parameters
model_init_params = {
    "encoder_name": "tu-vit_large_patch16_384",
    "encoder_depth": 4,
    "encoder_weights": None,
    "encoder_output_indices": None,
    "decoder_intermediate_channels": (256, 512, 1024, 1024),
    "decoder_fusion_channels": 256,
    "dynamic_img_size": True,
    "in_channels": 3,
    "classes": 150,
    "activation": None,
    "aux_params": None
}
Dataset

Dataset name: ADE20K

More Information

This model has been pushed to the Hub using the PytorchModelHubMixin

Runs of smp-hub dpt-large-ade20k on huggingface.co

445
Total runs
0
24-hour runs
-16
3-day runs
-177
7-day runs
-29
30-day runs

More Information About dpt-large-ade20k huggingface.co Model

More dpt-large-ade20k license Visit here:

https://choosealicense.com/licenses/mit

dpt-large-ade20k huggingface.co

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

dpt-large-ade20k huggingface.co Url

https://huggingface.co/smp-hub/dpt-large-ade20k

smp-hub dpt-large-ade20k online free

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

smp-hub dpt-large-ade20k online free url in huggingface.co:

https://huggingface.co/smp-hub/dpt-large-ade20k

dpt-large-ade20k install

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

dpt-large-ade20k install url in huggingface.co:

https://huggingface.co/smp-hub/dpt-large-ade20k

Url of dpt-large-ade20k

dpt-large-ade20k huggingface.co Url

Provider of dpt-large-ade20k 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