23b719w commited on
Commit
09859f4
1 Parent(s): 8fc31b5

update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -41,9 +41,9 @@ def load_model2():
41
  detection_model = tf.saved_model.load(str(model_dir))
42
  return detection_model
43
 
44
- # samples_folder = 'test_samples
45
- # image_path = 'test_samples/sample_balloon.jpeg
46
- #
47
 
48
  def predict(pilimg):
49
 
@@ -79,11 +79,11 @@ def predict2(image_np):
79
 
80
  REPO_ID = "23b719w/assignment2_tfodmodel"
81
  detection_model = load_model()
82
- # pil_image = Image.open(image_path)
83
- # image_arr = pil_image_as_numpy_array(pil_image)
84
 
85
- # predicted_img = predict(image_arr)
86
- # predicted_img.save('predicted.jpg')
87
 
88
  gr.Interface(fn=predict,
89
  inputs=gr.Image(type="pil"),
 
41
  detection_model = tf.saved_model.load(str(model_dir))
42
  return detection_model
43
 
44
+ samples_folder = 'test_samples'
45
+ image_path = 'test_samples/image489.png'
46
+
47
 
48
  def predict(pilimg):
49
 
 
79
 
80
  REPO_ID = "23b719w/assignment2_tfodmodel"
81
  detection_model = load_model()
82
+ pil_image = Image.open(image_path)
83
+ image_arr = pil_image_as_numpy_array(pil_image)
84
 
85
+ predicted_img = predict(image_arr)
86
+ predicted_img.save('predicted.jpg')
87
 
88
  gr.Interface(fn=predict,
89
  inputs=gr.Image(type="pil"),