gurwindersingh commited on
Commit
883c91d
·
1 Parent(s): f9a309c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -3,7 +3,7 @@ from PIL import Image
3
  import numpy as np
4
  import cv2
5
  import requests
6
- from gradio_client import Client
7
  import face_recognition
8
  import os
9
  from datetime import datetime
@@ -69,17 +69,12 @@ if img_file_buffer is not None:
69
  cv2.rectangle(image,(x1,y1),(x2,y2),(0,255,0),2)
70
  cv2.rectangle(image,(x1,y2-35),(x2,y2),(0,255,0),cv2.FILLED)
71
  cv2.putText(image,name,(x1+6,y2-6),cv2.FONT_HERSHEY_COMPLEX,1,(255, 255, 255),2)
72
- client = Client("https://rahulsinghpundir-facial-expression.hf.space/")
73
- result = client.predict(
74
- "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/image", # str (filepath or URL to image) in 'img' Image component
75
- api_name="/predict"
76
- )
77
- if result == "happy":
78
- ##############
79
- url = "https://kiwi-whispering-plier.glitch.me/update"
80
-
81
- data = {
82
- 'name': name,
83
- }
84
  else:
85
  st.write("Please smile")
 
3
  import numpy as np
4
  import cv2
5
  import requests
6
+
7
  import face_recognition
8
  import os
9
  from datetime import datetime
 
69
  cv2.rectangle(image,(x1,y1),(x2,y2),(0,255,0),2)
70
  cv2.rectangle(image,(x1,y2-35),(x2,y2),(0,255,0),cv2.FILLED)
71
  cv2.putText(image,name,(x1+6,y2-6),cv2.FONT_HERSHEY_COMPLEX,1,(255, 255, 255),2)
72
+
73
+ ##############
74
+ url = "https://kiwi-whispering-plier.glitch.me/update"
75
+
76
+ data = {
77
+ 'name': name,
78
+ }
 
 
 
 
 
79
  else:
80
  st.write("Please smile")