TrafficSignDetector / test_model.py
VietCat's picture
Lower confidence threshold to 0.25 and add debug logging for traffic sign detection
7963d0f
raw
history blame contribute delete
681 Bytes
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.")