Spaces:
Sleeping
Sleeping
update app.py
Browse files
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 |
-
|
45 |
-
|
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 |
-
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
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"),
|