| from paddleocr import PaddleOCR | |
| import cv2 | |
| ocr_model = PaddleOCR(use_angle_cls=True, lang='en') | |
| def process_image(image_path): | |
| result = ocr_model.ocr(image_path, cls=True) | |
| extracted_data = [] | |
| for line in result[0]: | |
| text = line[1][0] | |
| # Simple parser, in real case you’ll parse with regex or templates | |
| extracted_data.append({ | |
| "Product Name": text, | |
| "Model": "", | |
| "HP": "", | |
| "Stage": "", | |
| "Price": "" | |
| }) | |
| return extracted_data | |