Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -41,9 +41,9 @@ def predict(pilimg,Threshold):
|
|
41 |
|
42 |
image_np = pil_image_as_numpy_array(pilimg)
|
43 |
if type(Threshold) is None:
|
44 |
-
Threshold=threshold_d
|
45 |
|
46 |
-
return predict2(image_np,Threshold),predict3(image_np,Threshold),Threshold
|
47 |
|
48 |
def predict2(image_np,Threshold):
|
49 |
|
@@ -69,7 +69,7 @@ def predict2(image_np,Threshold):
|
|
69 |
|
70 |
result_pil_img2 = tf.keras.utils.array_to_img(image_np_with_detections[0])
|
71 |
|
72 |
-
return result_pil_img2
|
73 |
|
74 |
|
75 |
def predict3(image_np,Threshold):
|
@@ -96,7 +96,7 @@ def predict3(image_np,Threshold):
|
|
96 |
|
97 |
result_pil_img4 = tf.keras.utils.array_to_img(image_np_with_detections[0])
|
98 |
|
99 |
-
return result_pil_img4
|
100 |
|
101 |
# def detect_video(video):
|
102 |
# # Create a video capture object
|
|
|
41 |
|
42 |
image_np = pil_image_as_numpy_array(pilimg)
|
43 |
if type(Threshold) is None:
|
44 |
+
Threshold=threshold_d
|
45 |
|
46 |
+
return predict2(image_np,Threshold),predict3(image_np,Threshold),Threshold
|
47 |
|
48 |
def predict2(image_np,Threshold):
|
49 |
|
|
|
69 |
|
70 |
result_pil_img2 = tf.keras.utils.array_to_img(image_np_with_detections[0])
|
71 |
|
72 |
+
return result_pil_img2
|
73 |
|
74 |
|
75 |
def predict3(image_np,Threshold):
|
|
|
96 |
|
97 |
result_pil_img4 = tf.keras.utils.array_to_img(image_np_with_detections[0])
|
98 |
|
99 |
+
return result_pil_img4
|
100 |
|
101 |
# def detect_video(video):
|
102 |
# # Create a video capture object
|