Spaces:
Sleeping
Sleeping
| import cv2 | |
| import numpy as np | |
| from model import TrafficSignDetector | |
| # Load detector | |
| detector = TrafficSignDetector('config.yaml') | |
| # Test with a sample image (you can replace with your image path) | |
| # For now, create a dummy image or load from file | |
| # Assuming you have an image file, e.g., 'sample.jpg' | |
| image_path = 'sample.jpg' # Replace with actual path | |
| image = cv2.imread(image_path) | |
| if image is None: | |
| print("Image not found. Creating a dummy image.") | |
| image = np.zeros((456, 427, 3), dtype=np.uint8) | |
| print(f"Test image shape: {image.shape}") | |
| # Perform detection | |
| result = detector.detect(image.copy()) # Copy to avoid modifying original | |
| print("Detection completed.") | |