Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,10 +32,10 @@ encodeListknown = [face_recognition.face_encodings(img)[0] for img in Images]
|
|
32 |
file_name = st.camera_input("Take a picture") #st.file_uploader("Upload image ")
|
33 |
|
34 |
# Function to update Aadhaar data
|
35 |
-
def update_data():
|
36 |
url = "https://attendanceviaface.000webhostapp.com"
|
37 |
url1 = "/update.php"
|
38 |
-
data = {'name':
|
39 |
response = requests.post(url + url1, data=data)
|
40 |
|
41 |
if response.status_code == 200:
|
@@ -80,7 +80,7 @@ if file_name is not None:
|
|
80 |
cv2.putText(image_copy, name, (x1 + 6, y2 - 6), cv2.FONT_HERSHEY_COMPLEX, 1, (255, 255, 255), 2)
|
81 |
|
82 |
# update the database
|
83 |
-
update_data()
|
84 |
|
85 |
st.image(image_copy, use_column_width=True, output_format="PNG")
|
86 |
else:
|
|
|
32 |
file_name = st.camera_input("Take a picture") #st.file_uploader("Upload image ")
|
33 |
|
34 |
# Function to update Aadhaar data
|
35 |
+
def update_data(name):
|
36 |
url = "https://attendanceviaface.000webhostapp.com"
|
37 |
url1 = "/update.php"
|
38 |
+
data = {'name': name, 'aadhaar': '998877'}
|
39 |
response = requests.post(url + url1, data=data)
|
40 |
|
41 |
if response.status_code == 200:
|
|
|
80 |
cv2.putText(image_copy, name, (x1 + 6, y2 - 6), cv2.FONT_HERSHEY_COMPLEX, 1, (255, 255, 255), 2)
|
81 |
|
82 |
# update the database
|
83 |
+
update_data(name)
|
84 |
|
85 |
st.image(image_copy, use_column_width=True, output_format="PNG")
|
86 |
else:
|