Restructure: Move ocr_pipeline + labeling + crop into ocr/ package
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 29s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m25s
CI / test-python-agent-core (push) Successful in 19s
CI / test-nodejs-website (push) Successful in 20s
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 29s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m25s
CI / test-python-agent-core (push) Successful in 19s
CI / test-nodejs-website (push) Successful in 20s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,81 +1,4 @@
|
||||
"""
|
||||
OCR Labeling API — Barrel Re-export
|
||||
|
||||
Split into:
|
||||
- ocr_labeling_models.py — Pydantic models and constants
|
||||
- ocr_labeling_helpers.py — OCR wrappers, image storage, hashing
|
||||
- ocr_labeling_routes.py — Session/queue/labeling route handlers
|
||||
- ocr_labeling_upload_routes.py — Upload, run-OCR, export route handlers
|
||||
|
||||
All public names are re-exported here for backward compatibility.
|
||||
"""
|
||||
|
||||
# Models
|
||||
from ocr_labeling_models import ( # noqa: F401
|
||||
LOCAL_STORAGE_PATH,
|
||||
SessionCreate,
|
||||
SessionResponse,
|
||||
ItemResponse,
|
||||
ConfirmRequest,
|
||||
CorrectRequest,
|
||||
SkipRequest,
|
||||
ExportRequest,
|
||||
StatsResponse,
|
||||
)
|
||||
|
||||
# Helpers
|
||||
from ocr_labeling_helpers import ( # noqa: F401
|
||||
VISION_OCR_AVAILABLE,
|
||||
PADDLEOCR_AVAILABLE,
|
||||
TROCR_AVAILABLE,
|
||||
DONUT_AVAILABLE,
|
||||
MINIO_AVAILABLE,
|
||||
TRAINING_EXPORT_AVAILABLE,
|
||||
compute_image_hash,
|
||||
run_ocr_on_image,
|
||||
run_vision_ocr_wrapper,
|
||||
run_paddleocr_wrapper,
|
||||
run_trocr_wrapper,
|
||||
run_donut_wrapper,
|
||||
save_image_locally,
|
||||
get_image_url,
|
||||
)
|
||||
|
||||
# Conditional re-exports from helpers' optional imports
|
||||
try:
|
||||
from minio_storage import upload_ocr_image, get_ocr_image, MINIO_BUCKET # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from training_export_service import ( # noqa: F401
|
||||
TrainingExportService,
|
||||
TrainingSample,
|
||||
get_training_export_service,
|
||||
)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from hybrid_vocab_extractor import run_paddle_ocr # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from services.trocr_service import run_trocr_ocr # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from services.donut_ocr_service import run_donut_ocr # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from vision_ocr_service import get_vision_ocr_service, VisionOCRService # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Routes (router is the main export for app.include_router)
|
||||
from ocr_labeling_routes import router # noqa: F401
|
||||
from ocr_labeling_upload_routes import router as upload_router # noqa: F401
|
||||
# Backward-compat shim -- module moved to ocr/labeling/api.py
|
||||
import importlib as _importlib
|
||||
import sys as _sys
|
||||
_sys.modules[__name__] = _importlib.import_module("ocr.labeling.api")
|
||||
|
||||
Reference in New Issue
Block a user