panditamey
commited on
Commit
•
452c489
1
Parent(s):
2bd045c
Update app.py
Browse files
app.py
CHANGED
@@ -28,13 +28,13 @@ def upload_image():
|
|
28 |
if request.files:
|
29 |
imag = request.files["image"]
|
30 |
try:
|
31 |
-
contents = imag.
|
32 |
with open(imag.filename, 'wb') as f:
|
33 |
f.write(contents)
|
34 |
except Exception:
|
35 |
return {"message": "There was an error uploading the file"}
|
36 |
finally:
|
37 |
-
imag.
|
38 |
print(imag)
|
39 |
classes = ['Lilly','Lotus','Orchid','Sunflower', 'Tulip']
|
40 |
img=image.load_img(str(imag.filename),target_size=(224,224))
|
|
|
28 |
if request.files:
|
29 |
imag = request.files["image"]
|
30 |
try:
|
31 |
+
contents = imag.read()
|
32 |
with open(imag.filename, 'wb') as f:
|
33 |
f.write(contents)
|
34 |
except Exception:
|
35 |
return {"message": "There was an error uploading the file"}
|
36 |
finally:
|
37 |
+
imag.close()
|
38 |
print(imag)
|
39 |
classes = ['Lilly','Lotus','Orchid','Sunflower', 'Tulip']
|
40 |
img=image.load_img(str(imag.filename),target_size=(224,224))
|