Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,8 @@ optimizer = torch.optim.Adam(params = TinyCNN_model.parameters() ,lr=0.001)
|
|
25 |
|
26 |
transform = transforms.Compose([
|
27 |
transforms.Resize((128, 128)),
|
28 |
-
transforms.Grayscale(num_output_channels=3)
|
|
|
29 |
])
|
30 |
|
31 |
# Load saved weights
|
@@ -39,7 +40,7 @@ TinyCNN_model.load_state_dict(
|
|
39 |
### 3. Predict function ###
|
40 |
|
41 |
# Create predict function
|
42 |
-
def predict(img)
|
43 |
"""Transforms and performs a prediction on img and returns prediction and time taken.
|
44 |
"""
|
45 |
# Start the timer
|
|
|
25 |
|
26 |
transform = transforms.Compose([
|
27 |
transforms.Resize((128, 128)),
|
28 |
+
transforms.Grayscale(num_output_channels=3),
|
29 |
+
transforms.ToTensor()
|
30 |
])
|
31 |
|
32 |
# Load saved weights
|
|
|
40 |
### 3. Predict function ###
|
41 |
|
42 |
# Create predict function
|
43 |
+
def predict(img) :
|
44 |
"""Transforms and performs a prediction on img and returns prediction and time taken.
|
45 |
"""
|
46 |
# Start the timer
|