panditamey commited on
Commit
452c489
1 Parent(s): 2bd045c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,13 +28,13 @@ def upload_image():
28
  if request.files:
29
  imag = request.files["image"]
30
  try:
31
- contents = imag.file.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.file.close()
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))