Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,12 +173,12 @@ def check_liveness(frame):
|
|
| 173 |
return [liveness_result, {"status": "error", "result": f"{result.text}"}]
|
| 174 |
|
| 175 |
def idcard_recognition(frame1):
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
|
| 183 |
|
| 184 |
url = "https://api.cortex.cerebrium.ai/v4/p-4f1d877e/my-first-project/process-image/"
|
|
|
|
| 173 |
return [liveness_result, {"status": "error", "result": f"{result.text}"}]
|
| 174 |
|
| 175 |
def idcard_recognition(frame1):
|
| 176 |
+
ip_address = request.remote_addr
|
| 177 |
+
request_count = track_requests(ip_address)
|
| 178 |
+
print("you have exceeded the daily limit of 5 requests", request_count)
|
| 179 |
+
if request_count > 3:
|
| 180 |
+
print("you have exceeded the daily limit of 5 requests")
|
| 181 |
+
return "You have exceeded the daily limit of 5 requests."
|
| 182 |
|
| 183 |
|
| 184 |
url = "https://api.cortex.cerebrium.ai/v4/p-4f1d877e/my-first-project/process-image/"
|