Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -130,6 +130,21 @@ async def camera_picture_api(
|
|
130 |
"status": "New people",
|
131 |
"image": image_bot_path
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
else:
|
134 |
if return_voice:
|
135 |
print("Total time", time.time() - total_time)
|
|
|
130 |
"status": "New people",
|
131 |
"image": image_bot_path
|
132 |
}
|
133 |
+
elif most_close < area_threshold:
|
134 |
+
if return_voice:
|
135 |
+
print("Total time", time.time() - total_time)
|
136 |
+
return {
|
137 |
+
"status": "People far from camera",
|
138 |
+
"text": None,
|
139 |
+
"voice": None,
|
140 |
+
"image": image_bot_path,
|
141 |
+
}
|
142 |
+
else:
|
143 |
+
print("Total time", time.time() - total_time)
|
144 |
+
return {
|
145 |
+
"status": "People far from camera",
|
146 |
+
"image": image_bot_path,
|
147 |
+
}
|
148 |
else:
|
149 |
if return_voice:
|
150 |
print("Total time", time.time() - total_time)
|