Automated pipeline for reverse engineering chart images into TikZ code. The core logic of this system can be divided into the following four main stages: 1. Global Planning and Input Stage: - Input: Original chart images (e.g., line graphs, bar charts, etc.). - Global Processing: - Global Planner: Receives image input and extracts global metadata. - Output: Generates JSON format data containing the chart's global parameters (e.g., 'X-scale': 1.5, 'Y-scale': 0.5 scale information). - Output Example (JSON): ```json { 'x_scale': '1.3cm', 'y_scale': '0.5cm', 'y_min': 0, 'y_max': 10, 'x_min': 0, 'x_max': 6, 'colors': {'mplBlue': '31,119,180', 'gridGray': '220,220,220'}, 'chart_type': 'bar_chart' } ``` 2. Parallel Feature Extraction Stage: - The image and global metadata are simultaneously input into four parallel deep learning/recognition models, each responsible for extracting different chart component information and generating corresponding TikZ code snippets: 1. Chart Basic Configuration Recognition Model: Identifies the basic structure of the chart and generates TikZ code 1. 2. Coordinate Axis Parsing Model: Parses the scales, labels, etc., of the X/Y axes and generates TikZ code 2. 3. Data Visualization Recognition Model: Identifies specific data points, lines, or bars and generates TikZ code 3. 4. Legend Recognition Model: Identifies the content and style of the legend and generates TikZ code 4. 3. Code Synthesis Stage: - Fill-in: Integrates the data produced in the above two stages. - JSON data produced by the Global Planner. - TikZ code snippets (1-4) produced by the four models. - Template Application: This data is filled into a preset LaTeX template. - Output: Generates a complete TikZ code. 4. Compilation & Validation Loop: - This is a crucial closed-loop in the system to ensure code executability. - Latex
This image illustrates an automated pipeline for reverse eng...