itmorn commited on
Commit
221809b
1 Parent(s): 232939c
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -44,6 +44,11 @@ def inference(image):
44
  cv2.putText(img_out, msg, (20, 200), font, 1, (0, 255, 0), 2)
45
  return img_out
46
 
 
 
 
 
 
47
  # img_out = np.zeros((500, 600, 3),dtype=np.uint8)
48
  # cv2.putText(img_out, "ease contact the server for trouble", (20, 100), font, 0.8, (0, 255, 0), 2)
49
  # return img_out
@@ -69,7 +74,7 @@ def inference(image):
69
  # ax.set_zlabel('Z') # 设置z坐标轴
70
  ax.view_init(-90, -90)
71
  im_plot = plot3(fig)
72
- del fig
73
  h, w, _ = im_plot.shape
74
  # image[:h, :w] = im_plot
75
  return im_plot
 
44
  cv2.putText(img_out, msg, (20, 200), font, 1, (0, 255, 0), 2)
45
  return img_out
46
 
47
+ if code==200 and not lst2d_res:
48
+ img_out = np.zeros((500, 600,3),dtype=np.uint8)
49
+ cv2.putText(img_out, "no face detected", (20, 200), font, 1, (0, 255, 0), 2)
50
+ return img_out
51
+
52
  # img_out = np.zeros((500, 600, 3),dtype=np.uint8)
53
  # cv2.putText(img_out, "ease contact the server for trouble", (20, 100), font, 0.8, (0, 255, 0), 2)
54
  # return img_out
 
74
  # ax.set_zlabel('Z') # 设置z坐标轴
75
  ax.view_init(-90, -90)
76
  im_plot = plot3(fig)
77
+ plt.close()
78
  h, w, _ = im_plot.shape
79
  # image[:h, :w] = im_plot
80
  return im_plot