Spaces:
Runtime error
Runtime error
hitchhiker3010
commited on
Commit
•
c598af7
1
Parent(s):
e0d9f6d
Update app.py
Browse filesTrying to fix RuntimeError: Could not infer dtype of PILImage
app.py
CHANGED
@@ -16,7 +16,8 @@ fastai.layers.LabelSmoothingCrossEntropyFlat = fastai.losses.LabelSmoothingCross
|
|
16 |
|
17 |
model = load_learner("model.pkl")
|
18 |
def predict(im):
|
19 |
-
image_file = PILImage(PILImage.create((255-im)))
|
|
|
20 |
pred,pred_idx,probs = model.predict(image_file)
|
21 |
vals, indx = torch.topk(probs,2)
|
22 |
|
|
|
16 |
|
17 |
model = load_learner("model.pkl")
|
18 |
def predict(im):
|
19 |
+
#image_file = PILImage(PILImage.create((255-im)))
|
20 |
+
image_file = PILImage.create((255-im))
|
21 |
pred,pred_idx,probs = model.predict(image_file)
|
22 |
vals, indx = torch.topk(probs,2)
|
23 |
|