mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-24 19:14:23 +00:00
formatting fixes
This commit is contained in:
parent
7ad02f234d
commit
963e343250
@ -3,7 +3,7 @@ import logging
|
|||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Optional, Type
|
from typing import TYPE_CHECKING, List, Optional, Type
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from docling_core.types.doc import BoundingBox, CoordOrigin
|
from docling_core.types.doc import BoundingBox, CoordOrigin
|
||||||
@ -20,6 +20,9 @@ from docling.models.base_model import BaseModelWithOptions, BasePageModel
|
|||||||
|
|
||||||
_log = logging.getLogger(__name__)
|
_log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from scipy.ndimage import binary_dilation, find_objects, label
|
||||||
|
|
||||||
|
|
||||||
class BaseOcrModel(BasePageModel, BaseModelWithOptions):
|
class BaseOcrModel(BasePageModel, BaseModelWithOptions):
|
||||||
def __init__(
|
def __init__(
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
def ocr_engines():
|
def ocr_engines():
|
||||||
from docling.models.easyocr_model import EasyOcrModel
|
from docling.models.easyocr_model import EasyOcrModel
|
||||||
from docling.models.ocr_mac_model import OcrMacModel
|
from docling.models.ocr_mac_model import OcrMacModel
|
||||||
|
@ -17,6 +17,7 @@ def decide_device(
|
|||||||
2. User-defined: Check if the device actually exists, otherwise fall-back to CPU
|
2. User-defined: Check if the device actually exists, otherwise fall-back to CPU
|
||||||
"""
|
"""
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
device = "cpu"
|
device = "cpu"
|
||||||
|
|
||||||
has_cuda = torch.backends.cuda.is_built() and torch.cuda.is_available()
|
has_cuda = torch.backends.cuda.is_built() and torch.cuda.is_available()
|
||||||
|
Loading…
Reference in New Issue
Block a user