Spaces:
Runtime error
Runtime error
init
Browse files
app.py
CHANGED
@@ -9,12 +9,9 @@ lineType = 8
|
|
9 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
10 |
|
11 |
def inference(image):
|
12 |
-
img_out = np.zeros((500, 600, 3),dtype=np.uint8)
|
13 |
-
cv2.putText(img_out, "ease contact the server for trouble", (20, 20), font, 1, (0, 255, 0), 2)
|
14 |
-
return img_out
|
15 |
-
|
16 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
17 |
code,lst2d_res = get_app(image)
|
|
|
18 |
if code == 401:
|
19 |
msg = "Not RGB three channel picture"
|
20 |
elif code == 402:
|
@@ -24,17 +21,20 @@ def inference(image):
|
|
24 |
elif code == 404:
|
25 |
msg = "Files larger than 5MB"
|
26 |
elif code == 405:
|
27 |
-
msg = "System error, please contact the server for troubleshooting"
|
28 |
|
29 |
if code!=200:
|
30 |
-
img_out = np.zeros((500, 600,3))
|
31 |
cv2.putText(img_out, msg, (20, 20), font, 1, (0, 255, 0), 2)
|
32 |
return img_out
|
33 |
|
|
|
|
|
|
|
34 |
|
35 |
for face in lst2d_res:
|
36 |
-
img_out = np.zeros((500, 600, 3))
|
37 |
-
cv2.putText(img_out,
|
38 |
return img_out
|
39 |
bbox = [int(i) for i in face["bbox"]]
|
40 |
score = face['score']
|
|
|
9 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
10 |
|
11 |
def inference(image):
|
|
|
|
|
|
|
|
|
12 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
13 |
code,lst2d_res = get_app(image)
|
14 |
+
msg = "aaa"
|
15 |
if code == 401:
|
16 |
msg = "Not RGB three channel picture"
|
17 |
elif code == 402:
|
|
|
21 |
elif code == 404:
|
22 |
msg = "Files larger than 5MB"
|
23 |
elif code == 405:
|
24 |
+
msg = "System error, please contact\n the server for troubleshooting"
|
25 |
|
26 |
if code!=200:
|
27 |
+
img_out = np.zeros((500, 600,3),dtype=np.uint8)
|
28 |
cv2.putText(img_out, msg, (20, 20), font, 1, (0, 255, 0), 2)
|
29 |
return img_out
|
30 |
|
31 |
+
# img_out = np.zeros((500, 600, 3),dtype=np.uint8)
|
32 |
+
# cv2.putText(img_out, "ease contact the server for trouble", (20, 100), font, 0.8, (0, 255, 0), 2)
|
33 |
+
# return img_out
|
34 |
|
35 |
for face in lst2d_res:
|
36 |
+
img_out = np.zeros((500, 600, 3), dtype=np.uint8)
|
37 |
+
cv2.putText(img_out, msg, (20, 20), font, 1, (0, 255, 0), 2)
|
38 |
return img_out
|
39 |
bbox = [int(i) for i in face["bbox"]]
|
40 |
score = face['score']
|