Update app.py
Browse files
app.py
CHANGED
@@ -29,6 +29,14 @@ css = """
|
|
29 |
}
|
30 |
"""
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
def predict(img_path):
|
33 |
"""Process single image and return prediction"""
|
34 |
if not img_path:
|
|
|
29 |
}
|
30 |
"""
|
31 |
|
32 |
+
# Preprocessing
|
33 |
+
preprocess = transforms.Compose([
|
34 |
+
transforms.Resize(256),
|
35 |
+
transforms.CenterCrop(224),
|
36 |
+
transforms.ToTensor(),
|
37 |
+
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
|
38 |
+
])
|
39 |
+
|
40 |
def predict(img_path):
|
41 |
"""Process single image and return prediction"""
|
42 |
if not img_path:
|