Sanjayraju30 commited on
Commit
1953d7e
·
verified ·
1 Parent(s): b17dec2

Update services/shadow_detection.py

Browse files
Files changed (1) hide show
  1. services/shadow_detection.py +8 -3
services/shadow_detection.py CHANGED
@@ -1,3 +1,8 @@
1
- def detect_objects(image_path):
2
- # Simulate detection (always return fake person)
3
- return [{"label": "person", "score": 0.95}]
 
 
 
 
 
 
1
+ import cv2
2
+ import numpy as np
3
+
4
+ def detect_shadow_coverage(image_path):
5
+ img = cv2.imread(image_path)
6
+ gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
7
+ shadow_ratio = (gray < 50).sum() / gray.size
8
+ return shadow_ratio > 0.3