File size: 2,051 Bytes
4253742
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
license: apache-2.0
language:
- en
pipeline_tag: image-classification
---
# Skin Disease Classification Model

This repository hosts a machine learning model for **skin disease classification**, designed to predict skin conditions from input images. The model is trained on [dermnet] dataset and provides a simple yet effective way to classify skin diseases.

## Model Overview

- **Model Architecture**: [ResNet34]
- **Framework**: PyTorch
- **Input**: RGB image of size [224x224].
- **Output**: Predicted label for skin disease.
- **Training Dataset**: [Dermnet].

---

## Usage Instructions

### Loading the Model

You can load this model using the `torch` library in Python:

```python
import torch

# Load the model
model_path = "path/to/skin_model2.pth"
model = torch.load(model_path, map_location=torch.device('cpu'))
model.eval()

# Example usage
from PIL import Image
from torchvision import transforms

# Preprocess input image
transform = transforms.Compose([
    transforms.Resize((224, 224)),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])

image = Image.open("example_input.jpg")
input_tensor = transform(image).unsqueeze(0)

# Make a prediction
with torch.no_grad():
    prediction = model(input_tensor)
    predicted_class = prediction.argmax(dim=1).item()
    print(f"Predicted Class: {predicted_class}")
```

### Using directly from hugging face

pip install huggingface_hub
from huggingface_hub import hf_hub_download
import torch

# Download the model from Hugging Face Hub
model_path = hf_hub_download(repo_id="<abdlh>/<ResNet34_finetuned_for_skin_diseases_by-abdlh>", filename="skin_model2.pth")
model = torch.load(model_path, map_location=torch.device('cpu'))
model.eval()

# Citation
### If you use this model in your work, please cite it as follows:
@misc{abdlh2024skindisease,
  title={Skin Disease Classification Model},
  author={Muhammad Abdullah },
  year={2024},
  url={https://huggingface.co/<abdlh>/<ResNet34_finetuned_for_skin_diseases_by-abdlh>},
}