yougandar commited on
Commit
494f169
·
verified ·
1 Parent(s): fc33912

Update table_occupancy.py

Browse files
Files changed (1) hide show
  1. table_occupancy.py +6 -15
table_occupancy.py CHANGED
@@ -1,15 +1,6 @@
1
- import cv2
2
-
3
- def check_seating(image_path):
4
- # Simple heuristic: assume if any person is detected, at least one is seated
5
- img = cv2.imread(image_path)
6
- if img is None:
7
- return False
8
-
9
- height, _, _ = img.shape
10
- # naive: check if people detected in bottom half = seated
11
- bottom_half = img[height//2:, :]
12
- gray = cv2.cvtColor(bottom_half, cv2.COLOR_BGR2GRAY)
13
- faces = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
14
- detected = faces.detectMultiScale(gray, 1.1, 4)
15
- return len(detected) > 0
 
1
+ def estimate_table_occupancy(people_count: int) -> bool:
2
+ """
3
+ Minimal heuristic. Replace with your own table polygon checks if available.
4
+ Seated if there is at least 1 detected person.
5
+ """
6
+ return people_count > 0