Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -10,7 +10,7 @@ from typing import Optional
|
|
| 10 |
from fastapi import FastAPI, File, Form, HTTPException, UploadFile
|
| 11 |
from PIL import Image
|
| 12 |
|
| 13 |
-
from
|
| 14 |
AnalysisResponse,
|
| 15 |
FontAlternative,
|
| 16 |
FontInfo,
|
|
@@ -19,15 +19,17 @@ from app.models import (
|
|
| 19 |
Reconstruction,
|
| 20 |
TextBlock,
|
| 21 |
)
|
| 22 |
-
|
| 23 |
-
from
|
| 24 |
-
from
|
|
|
|
| 25 |
estimate_font_metrics,
|
| 26 |
extract_characters,
|
| 27 |
extract_geometry,
|
| 28 |
extract_rendering,
|
| 29 |
)
|
| 30 |
|
|
|
|
| 31 |
logger = logging.getLogger(__name__)
|
| 32 |
|
| 33 |
ALLOWED_EXTENSIONS = {".png", ".jpg", ".jpeg", ".tiff", ".tif", ".bmp"}
|
|
|
|
| 10 |
from fastapi import FastAPI, File, Form, HTTPException, UploadFile
|
| 11 |
from PIL import Image
|
| 12 |
|
| 13 |
+
from models import (
|
| 14 |
AnalysisResponse,
|
| 15 |
FontAlternative,
|
| 16 |
FontInfo,
|
|
|
|
| 19 |
Reconstruction,
|
| 20 |
TextBlock,
|
| 21 |
)
|
| 22 |
+
|
| 23 |
+
from pipeline.font_id import identify_font
|
| 24 |
+
from pipeline.ocr import run_ocr
|
| 25 |
+
from pipeline.typography import (
|
| 26 |
estimate_font_metrics,
|
| 27 |
extract_characters,
|
| 28 |
extract_geometry,
|
| 29 |
extract_rendering,
|
| 30 |
)
|
| 31 |
|
| 32 |
+
|
| 33 |
logger = logging.getLogger(__name__)
|
| 34 |
|
| 35 |
ALLOWED_EXTENSIONS = {".png", ".jpg", ".jpeg", ".tiff", ".tif", ".bmp"}
|