Update app.py
Browse filesconvert image to PIL format
app.py
CHANGED
@@ -24,7 +24,11 @@ with open('labels.txt', "r") as f:
|
|
24 |
labels = [line.strip() for line in f.readlines()]
|
25 |
|
26 |
|
27 |
-
def classify(
|
|
|
|
|
|
|
|
|
28 |
## preprocessing
|
29 |
# we need a transform step to normalise the pictures
|
30 |
transform = T.Compose([T.Resize(256), T.CenterCrop(224), T.ToTensor(),
|
|
|
24 |
labels = [line.strip() for line in f.readlines()]
|
25 |
|
26 |
|
27 |
+
def classify(image_raw):
|
28 |
+
|
29 |
+
## convert image to PIL format
|
30 |
+
image = Image.new(image_raw)
|
31 |
+
|
32 |
## preprocessing
|
33 |
# we need a transform step to normalise the pictures
|
34 |
transform = T.Compose([T.Resize(256), T.CenterCrop(224), T.ToTensor(),
|