Spaces:
Sleeping
Sleeping
File size: 681 Bytes
7963d0f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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.")
|