CoolFace
Apppublic

Nawinkumar15/Solar_Panel_Faults_Detection_

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
shadow_detection.py12 linesDownload Raw Back to services
1from PIL import Image2 3class ShadowDetection:4    def detect_shadow_dust(self, image, detection_service, confidence_threshold):5        """Detect dusty or shaded panels."""6        # For demo, assume DETR detects 'shadow' or 'dust' (requires fine-tuning)7        detections = detection_service.detect_objects(image, confidence_threshold)8        # Placeholder: Filter for shadow/dust-specific labels9        shadow_detections = [10            d for d in detections if d["label"] in ["shadow", "dust"]11        ]12        return shadow_detections