Views
No views yet
| Metric | Value |
|---|---|
| Overall Accuracy | 85.86% |
| Balanced Accuracy | 85.86% |
| Macro AUC | 0.9851 |
| CV Accuracy 5-fold | 87.64% ± 0.46% |
| Code | Full Name |
|---|---|
| akiec | Actinic Keratosis |
| bcc | Basal Cell Carcinoma |
| bkl | Benign Keratosis-like Lesion |
| df | Dermatofibroma |
| mel | Melanoma |
| nv | Melanocytic Nevi |
| vasc | Vascular Lesion |
1import requests, base64
2
3with open("skin.jpg", "rb") as f:
4 encoded = base64.b64encode(f.read()).decode("utf-8")
5
6response = requests.post(
7 "https://api-inference.huggingface.co/models/YOUR_USERNAME/skin-lesion-classifier",
8 headers={"Authorization": "Bearer hf_YOUR_TOKEN"},
9 json={"inputs": encoded}
10)
11print(response.json())Research only — not for clinical diagnosis.
---
### Step 4: Download `model.pth` from Google Drive
1. Open **Google Drive** in browser
2. Navigate to `Y2S2/HAM10000_balanced/model_outputs/`
3. Right-click `best_model_final.pth` → **Download**
4. Rename the downloaded file to `model.pth`
5. Move it into your `skin-lesion-hf` folder
Your folder should now look like this:
---
### Step 5: Upload Files to Hugging Face
1. Go to your repo page: `huggingface.co/YOUR_USERNAME/skin-lesion-classifier`
2. Click **"Files"** tab
3. Click **"Add file"** → **"Upload files"**
4. Drag and drop all 5 files at once
5. Scroll down → commit message: `Add model files`
6. Click **"Commit changes to main"**
> `model.pth` is large (~37MB) — wait for the upload bar to complete fully before committing.
---
### Step 6: Get Your API URL
Once uploaded your API URL is simply:
That's it. No extra setup needed.
---
### Step 7: Add to Your Render Backend
In Render dashboard → your backend service → **Environment** tab, add: