Update README.md
Browse files
README.md
CHANGED
@@ -57,21 +57,20 @@ The model addresses the issue of data scarcity in medical and anomaly detection
|
|
57 |
## π₯ Download and Installation
|
58 |
To use this model with **Diffusers**, follow these steps:
|
59 |
|
60 |
-
|
61 |
from diffusers import StableDiffusionPipeline
|
62 |
from peft import PeftModel
|
63 |
import torch
|
64 |
|
65 |
# Load the base model
|
66 |
-
base_model
|
67 |
|
68 |
# Load LoRA weights
|
69 |
-
lora_model
|
70 |
-

|
71 |
-
avit0/InfarctImage")
|
72 |
|
73 |
-
lora_model.to(torch.device(
|
74 |
-
|
|
|
75 |
|
76 |
## π Training Data
|
77 |
The model was trained on a dataset of 100 manually annotated images, including:
|
@@ -98,11 +97,11 @@ The dataset was processed and annotated using **BLIP (Bootstrapping Language-Ima
|
|
98 |
|
99 |
## π Usage Examples
|
100 |
You can generate images using prompts like:
|
101 |
-
|
102 |
-
prompt
|
103 |
-
image
|
104 |
image.show()
|
105 |
-
|
106 |
|
107 |
## π License
|
108 |
This model is distributed under the **MIT License**.
|
|
|
57 |
## π₯ Download and Installation
|
58 |
To use this model with **Diffusers**, follow these steps:
|
59 |
|
60 |
+
```python
|
61 |
from diffusers import StableDiffusionPipeline
|
62 |
from peft import PeftModel
|
63 |
import torch
|
64 |
|
65 |
# Load the base model
|
66 |
+
base_model = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1")
|
67 |
|
68 |
# Load LoRA weights
|
69 |
+
lora_model = PeftModel.from_pretrained(base_model, "Gavit0/InfarctImage")
|
|
|
|
|
70 |
|
71 |
+
lora_model.to(torch.device("cuda")) # Move to GPU if available
|
72 |
+
|
73 |
+
```
|
74 |
|
75 |
## π Training Data
|
76 |
The model was trained on a dataset of 100 manually annotated images, including:
|
|
|
97 |
|
98 |
## π Usage Examples
|
99 |
You can generate images using prompts like:
|
100 |
+
```python
|
101 |
+
prompt = "Person with expression of pain due to a heart attack, A middle-aged man clutching his chest in pain, showing signs of a heart attack."
|
102 |
+
image = lora_model(prompt=prompt).images[0]
|
103 |
image.show()
|
104 |
+
```
|
105 |
|
106 |
## π License
|
107 |
This model is distributed under the **MIT License**.
|