Selma commited on
Commit
2cc79c8
1 Parent(s): a50f3e4

Update app.py

Browse files

convert image to PIL format

Files changed (1) hide show
  1. app.py +5 -1
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(image):
 
 
 
 
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(),