SkinLesionDetector-Transformer
Este es un modelo de clasificación de lesiones en la piel basado en el modelo ViT de Google. Está diseñado para detectar y clasificar lesiones en imágenes de la piel.
Uso
from transformers import AutoImageProcessor, ViTForImageClassification
import torch
from PIL import Image
import requests
# Cargar el modelo y el procesador
model = ViTForImageClassification.from_pretrained("usuario/SkinLesionDetector-Transformer")
processor = AutoImageProcessor.from_pretrained("usuario/SkinLesionDetector-Transformer")
# Cargar una imagen de prueba
image_url = "URL_DE_LA_IMAGEN"
image = Image.open(requests.get(image_url, stream=True).raw)
# Preprocesar la imagen
inputs = processor(images=image, return_tensors="pt")
# Hacer la predicción
outputs = model(**inputs)
# Obtener la clase predicha
predicted_class = outputs.logits.argmax(-1).item()
print(f"La clase predicha es: {predicted_class}")
- Downloads last month
- 3
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
HF Inference API was unable to determine this model's library.