Update generation
@@ -110,8 +110,8 @@ def parse_md_to_html_blocks(md_content):
|
||||
html_blocks.append(f'''<p class=MsoCaption style="text-align:center"><a name="{bookmark_id}"><b><span lang=ES style="font-size:12.0pt;line-height:150%">Figura </span></b></a><!--[if supportFields]><span style='mso-element:field-begin'></span> SEQ Figura \\* ARABIC <span style='mso-element:field-separator'></span><![endif]--><b><span lang=ES style="font-size:12.0pt;line-height:150%">{figure_counter}</span></b><!--[if supportFields]><span style='mso-element:field-end'></span><![endif]--><b><span lang=ES style="font-size:12.0pt;line-height:150%">.</span></b><span lang=ES style="font-size:12.0pt;line-height:150%"> </span><i><span lang=ES style="font-size:12.0pt;line-height:150%;font-weight:normal">{fig_title}</span></i></p>''')
|
||||
|
||||
if os.path.exists(fig_path):
|
||||
# Use actual image with proper Word-compatible format (max 400px width, 500px height to fit page)
|
||||
html_blocks.append(f'''<p class=MsoNormal style="text-align:center"><span lang=ES><img style="max-width:400px;max-height:500px;width:auto;height:auto" src="{fig_file}" alt="{fig_title}"/></span></p>''')
|
||||
# Use actual image with proper Word-compatible format (max 350px width, 400px height to fit page with caption)
|
||||
html_blocks.append(f'''<p class=MsoNormal style="text-align:center"><span lang=ES><img style="max-width:350px;max-height:400px;width:auto;height:auto" src="{fig_file}" alt="{fig_title}"/></span></p>''')
|
||||
else:
|
||||
# Fallback to placeholder
|
||||
html_blocks.append(f'''<p class=MsoNormal style="text-align:center;border:1px dashed #999;padding:20px;margin:10px 40px;background:#f9f9f9"><span lang=ES style="color:#666">[Insertar diagrama Mermaid aquí]</span></p>''')
|
||||
|
||||
@@ -18,6 +18,9 @@ El Reconocimiento Óptico de Caracteres (OCR) es el proceso de conversión de im
|
||||
Los sistemas OCR modernos siguen típicamente un pipeline de dos etapas:
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: "Pipeline de un sistema OCR moderno"
|
||||
---
|
||||
flowchart LR
|
||||
subgraph Input
|
||||
A["Imagen de<br/>documento"]
|
||||
@@ -43,8 +46,6 @@ flowchart LR
|
||||
style D fill:#c8e6c9
|
||||
```
|
||||
|
||||
*Figura 1. Pipeline típico de un sistema OCR moderno con etapas de detección y reconocimiento.*
|
||||
|
||||
1. **Detección de texto (Text Detection)**: Localización de regiones que contienen texto en la imagen. Las arquitecturas más utilizadas incluyen:
|
||||
- EAST (Efficient and Accurate Scene Text Detector)
|
||||
- CRAFT (Character Region Awareness for Text Detection)
|
||||
@@ -165,6 +166,9 @@ Los métodos de HPO incluyen:
|
||||
La combinación Ray Tune + Optuna permite búsquedas eficientes en espacios de alta dimensionalidad.
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: "Ciclo de optimización con Ray Tune y Optuna"
|
||||
---
|
||||
flowchart LR
|
||||
A["Espacio de<br/>búsqueda"] --> B["Ray Tune<br/>Scheduler"]
|
||||
B --> C["Trials<br/>paralelos"]
|
||||
@@ -174,8 +178,6 @@ flowchart LR
|
||||
F -->|"Nueva config"| B
|
||||
```
|
||||
|
||||
*Figura 2. Ciclo de optimización de hiperparámetros con Ray Tune y Optuna.*
|
||||
|
||||
#### HPO en Sistemas OCR
|
||||
|
||||
La aplicación de HPO a sistemas OCR ha sido explorada principalmente en el contexto de:
|
||||
|
||||
@@ -40,6 +40,9 @@ Este capítulo establece los objetivos del trabajo siguiendo la metodología SMA
|
||||
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: "Fases de la metodología experimental"
|
||||
---
|
||||
flowchart LR
|
||||
A["Fase 1<br/>Dataset"] --> B["Fase 2<br/>Benchmark"] --> C["Fase 3<br/>Espacio"] --> D["Fase 4<br/>Optimización"] --> E["Fase 5<br/>Validación"]
|
||||
```
|
||||
@@ -74,6 +77,9 @@ El script `prepare_dataset.ipynb` implementa:
|
||||
#### Estructura del Dataset
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: "Estructura del dataset de evaluación"
|
||||
---
|
||||
flowchart LR
|
||||
dataset["dataset/"] --> d0["0/"]
|
||||
|
||||
@@ -178,6 +184,9 @@ tuner = tune.Tuner(
|
||||
Debido a incompatibilidades entre Ray y PaddleOCR en el mismo proceso, se implementó una arquitectura basada en subprocesos:
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: "Arquitectura de ejecución con subprocesos"
|
||||
---
|
||||
flowchart LR
|
||||
A["Ray Tune (proceso principal)"]
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ El repositorio incluye:
|
||||
## A.2 Estructura del Repositorio
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: "Estructura del repositorio del proyecto"
|
||||
---
|
||||
flowchart LR
|
||||
root["MastersThesis/"] --> docs["docs/"]
|
||||
root --> src["src/"]
|
||||
@@ -30,8 +33,6 @@ flowchart LR
|
||||
src --> csv["raytune_results_*.csv"]
|
||||
```
|
||||
|
||||
*Figura 8. Estructura del repositorio del proyecto.*
|
||||
|
||||
**Descripción de componentes:**
|
||||
|
||||
- **docs/**: Capítulos de la tesis en Markdown
|
||||
|
||||
@@ -35,9 +35,11 @@ def extract_mermaid_diagrams():
|
||||
matches = re.findall(pattern, content, re.DOTALL)
|
||||
|
||||
for i, mermaid_code in enumerate(matches):
|
||||
# Try to extract title
|
||||
title_match = re.search(r'title\s+["\']?([^"\'"\n]+)["\']?', mermaid_code)
|
||||
title = title_match.group(1).strip() if title_match else f"Diagrama de {md_file}"
|
||||
# Try to extract title from YAML front matter or inline title
|
||||
title_match = re.search(r'title:\s*["\']([^"\']+)["\']', mermaid_code)
|
||||
if not title_match:
|
||||
title_match = re.search(r'title\s+["\']?([^"\'"\n]+)["\']?', mermaid_code)
|
||||
title = title_match.group(1).strip() if title_match else f"Diagrama {len(diagrams) + 1}"
|
||||
|
||||
diagrams.append({
|
||||
'source': md_file,
|
||||
|
||||
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 111 KiB |
@@ -1,27 +1,27 @@
|
||||
[
|
||||
{
|
||||
"file": "figura_1.png",
|
||||
"title": "Diagrama de 02_contexto_estado_arte.md",
|
||||
"title": "Pipeline de un sistema OCR moderno",
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"file": "figura_2.png",
|
||||
"title": "Diagrama de 02_contexto_estado_arte.md",
|
||||
"title": "Ciclo de optimización con Ray Tune y Optuna",
|
||||
"index": 2
|
||||
},
|
||||
{
|
||||
"file": "figura_3.png",
|
||||
"title": "Diagrama de 03_objetivos_metodologia.md",
|
||||
"title": "Fases de la metodología experimental",
|
||||
"index": 3
|
||||
},
|
||||
{
|
||||
"file": "figura_4.png",
|
||||
"title": "Diagrama de 03_objetivos_metodologia.md",
|
||||
"title": "Estructura del dataset de evaluación",
|
||||
"index": 4
|
||||
},
|
||||
{
|
||||
"file": "figura_5.png",
|
||||
"title": "Diagrama de 03_objetivos_metodologia.md",
|
||||
"title": "Arquitectura de ejecución con subprocesos",
|
||||
"index": 5
|
||||
},
|
||||
{
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
{
|
||||
"file": "figura_8.png",
|
||||
"title": "Diagrama de 07_anexo_a.md",
|
||||
"title": "Estructura del repositorio del proyecto",
|
||||
"index": 8
|
||||
}
|
||||
]
|
||||