Hector Lopez commited on
Commit
4dee47a
·
1 Parent(s): ab5b42b
Files changed (2) hide show
  1. app.py +1 -1
  2. model.py +2 -1
app.py CHANGED
@@ -32,7 +32,7 @@ image_file = st.file_uploader("Upload Images", type=["png","jpg","jpeg"])
32
  if image_file is not None:
33
  print(image_file)
34
  print('Getting predictions')
35
- pred_dict = predict(model, image_file.name)
36
  print('Fixing the preds')
37
  boxes, image = prepare_prediction(pred_dict)
38
  print('Plotting')
 
32
  if image_file is not None:
33
  print(image_file)
34
  print('Getting predictions')
35
+ pred_dict = predict(model, image_file)
36
  print('Fixing the preds')
37
  boxes, image = prepare_prediction(pred_dict)
38
  print('Plotting')
model.py CHANGED
@@ -36,7 +36,8 @@ def get_checkpoint(checkpoint_path):
36
  return fixed_state_dict
37
 
38
  def predict(model, image):
39
- img = PIL.Image.open(image)
 
40
  print(img.shape)
41
  class_map = ClassMap(classes=['Waste'])
42
  transforms = tfms.A.Adapter([
 
36
  return fixed_state_dict
37
 
38
  def predict(model, image):
39
+ #img = PIL.Image.open(image)
40
+ img = PIL.Image(image.read())
41
  print(img.shape)
42
  class_map = ClassMap(classes=['Waste'])
43
  transforms = tfms.A.Adapter([