Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,11 +48,13 @@ model = SqueezeNet(out_channels=1)
|
|
48 |
model.load_state_dict(torch.load("squeezenet.pth", map_location=torch.device('cpu')))
|
49 |
model.eval()
|
50 |
|
51 |
-
transform = transforms.Compose([
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
56 |
|
57 |
def classify_brain_tumor(image):
|
58 |
image = transform(image).unsqueeze(0)
|
|
|
48 |
model.load_state_dict(torch.load("squeezenet.pth", map_location=torch.device('cpu')))
|
49 |
model.eval()
|
50 |
|
51 |
+
transform = transforms.Compose([transforms.Resize((224,224)),
|
52 |
+
transforms.RandomHorizontalFlip(0.2),
|
53 |
+
transforms.RandomVerticalFlip(0.1),
|
54 |
+
transforms.RandomAutocontrast(0.2),
|
55 |
+
transforms.RandomAdjustSharpness(0.3),
|
56 |
+
transforms.ToTensor()
|
57 |
+
])
|
58 |
|
59 |
def classify_brain_tumor(image):
|
60 |
image = transform(image).unsqueeze(0)
|