Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to load Huggingface pretrained model for SMP training? #1252

Open
@james-imi

Description

currently, the guide is showing how to load it

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/segformer-b0-768x768-city-160k"
model = smp.from_pretrained(checkpoint).eval().to(device)
preprocessing = A.Compose.from_pretrained(checkpoint)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /