Hector Lopez commited on
Commit
d27c41a
1 Parent(s): 3bf6581

refactor: Fixed the prediction when uploading a custom image

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -55,11 +55,7 @@ if image_file is not None:
55
  det_model, classifier = get_models(DET_CKPT, CLASS_CKPT)
56
 
57
  print('Getting predictions')
58
- if isinstance(image_file, str):
59
- data = image_file
60
- else:
61
- data = image_file.read()
62
- pred_dict = predict(det_model, data, detection_threshold)
63
  print('Fixing the preds')
64
  boxes, image = prepare_prediction(pred_dict, nms_threshold)
65
 
 
55
  det_model, classifier = get_models(DET_CKPT, CLASS_CKPT)
56
 
57
  print('Getting predictions')
58
+ pred_dict = predict(det_model, image_file, detection_threshold)
 
 
 
 
59
  print('Fixing the preds')
60
  boxes, image = prepare_prediction(pred_dict, nms_threshold)
61