Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,20 @@ import torch.nn as nn
|
|
15 |
import torch.nn.functional as F
|
16 |
from torchvision import transforms
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Model paths for all disease types
|
19 |
model_path_skin_disease = 'multi_weight.pth' # Skin Disease Model
|
20 |
model_path_brain_tumor = 'brain_tumor_model.pkl'
|
@@ -126,3 +140,4 @@ def main():
|
|
126 |
# Run the Gradio app
|
127 |
if __name__ == "__main__":
|
128 |
main()
|
|
|
|
15 |
import torch.nn.functional as F
|
16 |
from torchvision import transforms
|
17 |
|
18 |
+
# Define the custom model class (MelanomaModel in this case)
|
19 |
+
class MelanomaModel(nn.Module):
|
20 |
+
def __init__(self):
|
21 |
+
super(MelanomaModel, self).__init__()
|
22 |
+
# Define your model layers here (example)
|
23 |
+
self.conv1 = nn.Conv2d(3, 64, kernel_size=3)
|
24 |
+
self.fc1 = nn.Linear(64*224*224, 10)
|
25 |
+
|
26 |
+
def forward(self, x):
|
27 |
+
x = self.conv1(x)
|
28 |
+
x = x.view(x.size(0), -1)
|
29 |
+
x = self.fc1(x)
|
30 |
+
return x
|
31 |
+
|
32 |
# Model paths for all disease types
|
33 |
model_path_skin_disease = 'multi_weight.pth' # Skin Disease Model
|
34 |
model_path_brain_tumor = 'brain_tumor_model.pkl'
|
|
|
140 |
# Run the Gradio app
|
141 |
if __name__ == "__main__":
|
142 |
main()
|
143 |
+
|