Fix: Update all old-style imports inside packages to new paths
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 1m7s
CI / test-go-edu-search (push) Successful in 46s
CI / test-python-klausur (push) Failing after 2m32s
CI / test-python-agent-core (push) Successful in 33s
CI / test-nodejs-website (push) Successful in 34s
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 1m7s
CI / test-go-edu-search (push) Successful in 46s
CI / test-python-klausur (push) Failing after 2m32s
CI / test-python-agent-core (push) Successful in 33s
CI / test-nodejs-website (push) Successful in 34s
65 files in klausur-service packages + 3 in backend-lehrer packages had stale imports referencing deleted shim modules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ from .reprocess import router as _reprocess_router
|
||||
from .auto_steps import router as _steps_router
|
||||
|
||||
# Combine both sub-routers into a single router for backwards compatibility.
|
||||
# The consumer imports `from ocr_pipeline_auto import router as _auto_router`.
|
||||
# The consumer imports `from ocr.pipeline.auto import router as _auto_router`.
|
||||
router = APIRouter(prefix="/api/v1/ocr-pipeline", tags=["ocr-pipeline"])
|
||||
router.include_router(_reprocess_router)
|
||||
router.include_router(_steps_router)
|
||||
|
||||
@@ -17,7 +17,7 @@ import numpy as np
|
||||
from fastapi import APIRouter, HTTPException, Request
|
||||
from fastapi.responses import StreamingResponse
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
OLLAMA_REVIEW_MODEL,
|
||||
PageRegion,
|
||||
RowGeometry,
|
||||
|
||||
@@ -14,7 +14,7 @@ from typing import Dict, List
|
||||
import cv2
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
_detect_header_footer_gaps,
|
||||
_detect_sub_columns,
|
||||
classify_column_types,
|
||||
|
||||
@@ -12,7 +12,7 @@ from datetime import datetime
|
||||
import cv2
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
create_ocr_image,
|
||||
deskew_image,
|
||||
deskew_image_by_word_alignment,
|
||||
|
||||
@@ -17,7 +17,7 @@ from typing import Any, Dict
|
||||
import cv2
|
||||
from fastapi import APIRouter, HTTPException, Query
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
_apply_shear,
|
||||
create_ocr_image,
|
||||
dewarp_image,
|
||||
|
||||
@@ -8,7 +8,7 @@ This module was split into:
|
||||
- ocr_pipeline_columns.py (Column detection + ground truth)
|
||||
|
||||
The `router` object is assembled here by including all sub-routers.
|
||||
Importers that did `from ocr_pipeline_geometry import router` continue to work.
|
||||
Importers that did `from ocr.pipeline.geometry import router` continue to work.
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
@@ -243,7 +243,7 @@ async def recognize_from_session(req: HTRSessionRequest):
|
||||
Set use_clean=true to prefer the clean image (after handwriting removal step).
|
||||
This is useful when you want to do HTR on isolated handwriting regions.
|
||||
"""
|
||||
from ocr_pipeline_session_store import get_session_db, get_session_image
|
||||
from ocr.pipeline.session_store import get_session_db, get_session_image
|
||||
|
||||
session = await get_session_db(req.session_id)
|
||||
if not session:
|
||||
|
||||
@@ -15,7 +15,7 @@ from typing import Dict, List
|
||||
from fastapi import APIRouter, HTTPException, Request
|
||||
from fastapi.responses import StreamingResponse
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
OLLAMA_REVIEW_MODEL,
|
||||
llm_review_entries,
|
||||
llm_review_entries_streaming,
|
||||
|
||||
@@ -15,7 +15,7 @@ import cv2
|
||||
import numpy as np
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from cv_words_first import build_grid_from_words
|
||||
from ocr.words_first import build_grid_from_words
|
||||
from .common import _cache, _append_pipeline_log
|
||||
from .session_store import get_session_image, update_session_db
|
||||
|
||||
@@ -136,7 +136,7 @@ async def paddle_kombi(session_id: str):
|
||||
img_png, img_bgr = await _load_session_image(session_id)
|
||||
img_h, img_w = img_bgr.shape[:2]
|
||||
|
||||
from cv_ocr_engines import ocr_region_paddle
|
||||
from ocr.engines.engines import ocr_region_paddle
|
||||
|
||||
t0 = time.time()
|
||||
|
||||
@@ -202,8 +202,8 @@ async def rapid_kombi(session_id: str):
|
||||
img_png, img_bgr = await _load_session_image(session_id)
|
||||
img_h, img_w = img_bgr.shape[:2]
|
||||
|
||||
from cv_ocr_engines import ocr_region_rapid
|
||||
from cv_vocab_types import PageRegion
|
||||
from ocr.engines.engines import ocr_region_rapid
|
||||
from ocr.types import PageRegion
|
||||
|
||||
t0 = time.time()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from typing import Any, Dict
|
||||
import cv2
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from cv_vocab_pipeline import detect_and_fix_orientation
|
||||
from ocr.cv_pipeline import detect_and_fix_orientation
|
||||
from .page_crop import detect_page_splits
|
||||
from .session_store import update_session_db
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ from fastapi.responses import Response
|
||||
|
||||
from .common import _get_base_image_png
|
||||
from .session_store import get_session_db
|
||||
from cv_color_detect import _COLOR_HEX, _COLOR_RANGES
|
||||
from cv_box_detect import detect_boxes, split_page_into_zones
|
||||
from ocr.detect.color_detect import _COLOR_HEX, _COLOR_RANGES
|
||||
from ocr.detect.box_detect import detect_boxes, split_page_into_zones
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from .reconstruction import router as _reconstruction_router
|
||||
from .validation import router as _validation_router
|
||||
|
||||
# Composite router — drop-in replacement for the old monolithic router.
|
||||
# ocr_pipeline_api.py imports ``from ocr_pipeline_postprocess import router``.
|
||||
# ocr_pipeline_api.py imports ``from ocr.pipeline.postprocess import router``.
|
||||
router = APIRouter()
|
||||
router.include_router(_llm_review_router)
|
||||
router.include_router(_reconstruction_router)
|
||||
|
||||
@@ -14,7 +14,7 @@ from typing import Any, Dict, Optional
|
||||
|
||||
from fastapi import APIRouter, HTTPException, Query
|
||||
|
||||
from grid_editor_api import _build_grid_core
|
||||
from grid.editor.api import _build_grid_core
|
||||
from .session_store import (
|
||||
get_session_db,
|
||||
list_ground_truth_sessions_db,
|
||||
|
||||
@@ -17,7 +17,7 @@ import cv2
|
||||
import numpy as np
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
create_ocr_image,
|
||||
detect_column_geometry,
|
||||
detect_row_geometry,
|
||||
@@ -120,7 +120,7 @@ async def detect_rows(session_id: str):
|
||||
# merges rows. Word-grouping directly clusters words by Y proximity,
|
||||
# which is more robust for these cases.
|
||||
if is_sub_session and word_dicts:
|
||||
from cv_layout import _build_rows_from_word_grouping
|
||||
from ocr.layout.layout import _build_rows_from_word_grouping
|
||||
rows = _build_rows_from_word_grouping(
|
||||
word_dicts, left_x, right_x, top_y, bottom_y,
|
||||
right_x - left_x, bottom_y - top_y,
|
||||
|
||||
@@ -15,7 +15,7 @@ import cv2
|
||||
import numpy as np
|
||||
from fastapi import APIRouter, File, Form, HTTPException, Query, UploadFile
|
||||
|
||||
from cv_vocab_pipeline import render_image_high_res, render_pdf_high_res
|
||||
from ocr.cv_pipeline import render_image_high_res, render_pdf_high_res
|
||||
from .common import (
|
||||
VALID_DOCUMENT_CATEGORIES,
|
||||
UpdateSessionRequest,
|
||||
|
||||
@@ -17,7 +17,7 @@ import numpy as np
|
||||
from fastapi import APIRouter, HTTPException, Query
|
||||
from fastapi.responses import Response
|
||||
|
||||
from cv_vocab_pipeline import create_ocr_image, detect_document_type
|
||||
from ocr.cv_pipeline import create_ocr_image, detect_document_type
|
||||
from .common import (
|
||||
VALID_DOCUMENT_CATEGORIES,
|
||||
_append_pipeline_log,
|
||||
|
||||
@@ -15,9 +15,9 @@ import numpy as np
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from pydantic import BaseModel
|
||||
|
||||
from cv_box_detect import detect_boxes
|
||||
from cv_color_detect import _COLOR_RANGES, _COLOR_HEX
|
||||
from cv_graphic_detect import detect_graphic_elements
|
||||
from ocr.detect.box_detect import detect_boxes
|
||||
from ocr.detect.color_detect import _COLOR_RANGES, _COLOR_HEX
|
||||
from ocr.detect.graphic_detect import detect_graphic_elements
|
||||
from .session_store import (
|
||||
get_session_db,
|
||||
update_session_db,
|
||||
@@ -100,7 +100,7 @@ async def detect_structure(session_id: str):
|
||||
)
|
||||
|
||||
# --- Zone splitting ---
|
||||
from cv_box_detect import split_page_into_zones as _split_zones
|
||||
from ocr.detect.box_detect import split_page_into_zones as _split_zones
|
||||
zones = _split_zones(content_x, content_y, content_w_px, content_h_px, boxes)
|
||||
|
||||
# --- Color region sampling ---
|
||||
@@ -123,7 +123,7 @@ async def detect_structure(session_id: str):
|
||||
med_s = float(np.median(roi_hsv[:, :, 1]))
|
||||
med_v = float(np.median(roi_hsv[:, :, 2]))
|
||||
if med_s > 15:
|
||||
from cv_color_detect import _hue_to_color_name
|
||||
from ocr.detect.color_detect import _hue_to_color_name
|
||||
bg_name = _hue_to_color_name(med_h)
|
||||
bg_hex = _COLOR_HEX.get(bg_name, "#6b7280")
|
||||
else:
|
||||
|
||||
@@ -23,7 +23,7 @@ import numpy as np
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from pydantic import BaseModel
|
||||
|
||||
from cv_words_first import build_grid_from_words
|
||||
from ocr.words_first import build_grid_from_words
|
||||
from .session_store import (
|
||||
get_session_db,
|
||||
get_session_image,
|
||||
@@ -72,7 +72,7 @@ async def paddle_direct(session_id: str):
|
||||
|
||||
img_h, img_w = img_bgr.shape[:2]
|
||||
|
||||
from cv_ocr_engines import ocr_region_paddle
|
||||
from ocr.engines.engines import ocr_region_paddle
|
||||
|
||||
t0 = time.time()
|
||||
word_dicts = await ocr_region_paddle(img_bgr, region=None)
|
||||
|
||||
@@ -17,7 +17,7 @@ import numpy as np
|
||||
from fastapi import APIRouter, HTTPException, Request
|
||||
from fastapi.responses import StreamingResponse
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
PageRegion,
|
||||
RowGeometry,
|
||||
_cells_to_vocab_entries,
|
||||
@@ -27,7 +27,7 @@ from cv_vocab_pipeline import (
|
||||
create_ocr_image,
|
||||
detect_column_geometry,
|
||||
)
|
||||
from cv_words_first import build_grid_from_words
|
||||
from ocr.words_first import build_grid_from_words
|
||||
from .session_store import (
|
||||
get_session_db,
|
||||
update_session_db,
|
||||
@@ -223,7 +223,7 @@ async def _words_first_path(
|
||||
img_h, img_w = dewarped_bgr.shape[:2]
|
||||
|
||||
if engine == "paddle":
|
||||
from cv_ocr_engines import ocr_region_paddle
|
||||
from ocr.engines.engines import ocr_region_paddle
|
||||
wf_word_dicts = await ocr_region_paddle(dewarped_bgr, region=None)
|
||||
cached["_paddle_word_dicts"] = wf_word_dicts
|
||||
else:
|
||||
|
||||
@@ -15,7 +15,7 @@ from typing import Any, Dict, List
|
||||
import numpy as np
|
||||
from fastapi import Request
|
||||
|
||||
from cv_vocab_pipeline import (
|
||||
from ocr.cv_pipeline import (
|
||||
PageRegion,
|
||||
RowGeometry,
|
||||
_cells_to_vocab_entries,
|
||||
|
||||
Reference in New Issue
Block a user