SLD / predict.py
Alcina's picture
Rename predict to predict.py
6b74f1c
raw
history blame contribute delete
440 Bytes
!pip install torch
!pip install transformers
import torch
from transformers import pipeline
model_name = skin_lesion_detection_model.h5 # Replace with the name or path of the pre-trained model
classifier = pipeline("text-classification", model=model_name)
image_path = "image.jpg" # Replace with the path to your image
image = Image.open(image_path)
print("Predicted Label:", predicted_label)
print("Confidence Score:", predicted_score)