import paddleocr import cv2 import os def test_paddleocr(): print("Testing PaddleOCR installation...") try: # Initialize PaddleOCR ocr = paddleocr.PaddleOCR(use_angle_cls=True, lang='en') # Test with a simple image if available test_image = "test_ocr_image.png" if os.path.exists(test_image): result = ocr.ocr(test_image, cls=True) print(f"PaddleOCR test successful: {len(result)} results") else: print("PaddleOCR initialized successfully (no test image available)") except Exception as e: print(f"PaddleOCR test failed: {e}") if __name__ == "__main__": test_paddleocr()