git clone https://github.com/ethicalabs-ai/SkinCancerViT.git
cd SkinCancerViT
Then, install the package in editable mode using uv (or pip):
uv sync# Recommended if you use uv# Or, if using pip:# pip install -e .
Quick Start / Usage
This package allows you to load and use a pre-trained SkinCancerViT model for prediction.
import torch
from skincancer_vit.model import SkinCancerViTModel
from PIL import Image
from datasets import load_dataset # To get a random sample# Load the model from Hugging Face Hub
device = torch.device("cuda"if torch.cuda.is_available() else"cpu")
model = SkinCancerViTModel.from_pretrained("ethicalabs/SkinCancerViT")
model.to(device) # Move model to the desired device
model.eval() # Set model to evaluation mode# Example Prediction from a Specific Image File
image_file_path = "images/patient-001.jpg"# Specify your image file path here
specific_image = Image.open(image_file_path).convert("RGB")
# Example tabular data for this prediction
specific_age = 42
specific_localization = "face"# Ensure this matches one of your trained localization categories
predicted_dx, confidence = model.full_predict(
raw_image=specific_image,
raw_age=specific_age,
raw_localization=specific_localization,
device=device
)
print(f"Predicted Diagnosis: {predicted_dx}")
print(f"Confidence: {confidence:.4f}")
# Example Prediction from a Random Test Sample from the Dataset
dataset = load_dataset("marmal88/skin_cancer", split="test")
random_sample = dataset.shuffle(seed=42).select(range(1))[0] # Get the first shuffled sample
sample_image = random_sample["image"]
sample_age = random_sample["age"]
sample_localization = random_sample["localization"]
sample_true_dx = random_sample["dx"]
predicted_dx_sample, confidence_sample = model.full_predict(
raw_image=sample_image,
raw_age=sample_age,
raw_localization=sample_localization,
device=device
)
print(f"Predicted Diagnosis: {predicted_dx_sample}")
print(f"Confidence: {confidence_sample:.4f}")
print(f"Correct Prediction: {predicted_dx_sample == sample_true_dx}")
Runs of ethicalabs SkinCancerViT on huggingface.co
74
Total runs
1
24-hour runs
2
3-day runs
7
7-day runs
-46
30-day runs
More Information About SkinCancerViT huggingface.co Model
SkinCancerViT huggingface.co is an AI model on huggingface.co that provides SkinCancerViT's model effect (), which can be used instantly with this ethicalabs SkinCancerViT model. huggingface.co supports a free trial of the SkinCancerViT model, and also provides paid use of the SkinCancerViT. Support call SkinCancerViT model through api, including Node.js, Python, http.
SkinCancerViT huggingface.co is an online trial and call api platform, which integrates SkinCancerViT's modeling effects, including api services, and provides a free online trial of SkinCancerViT, you can try SkinCancerViT online for free by clicking the link below.
ethicalabs SkinCancerViT online free url in huggingface.co:
SkinCancerViT is an open source model from GitHub that offers a free installation service, and any user can find SkinCancerViT on GitHub to install. At the same time, huggingface.co provides the effect of SkinCancerViT install, users can directly use SkinCancerViT installed effect in huggingface.co for debugging and trial. It also supports api for free installation.