MCPcopy
hub / github.com/sml2h3/ddddocr / detection

Method detection

ddddocr/compat/v1.py:129–148  ·  view source on GitHub ↗

目标检测方法 Args: img: 图片数据 Returns: 检测到的边界框列表 Raises: DDDDOCRError: 当功能未启用或检测失败时

(self, img: Union[bytes, str, pathlib.PurePath, Image.Image])

Source from the content-addressed store, hash-verified

127 )
128
129 def detection(self, img: Union[bytes, str, pathlib.PurePath, Image.Image]) -> List[List[int]]:
130 """
131 目标检测方法
132
133 Args:
134 img: 图片数据
135
136 Returns:
137 检测到的边界框列表
138
139 Raises:
140 DDDDOCRError: 当功能未启用或检测失败时
141 """
142 if not self.det:
143 raise DDDDOCRError("当前识别类型为OCR")
144
145 if not self.detection_engine:
146 raise DDDDOCRError("目标检测功能未初始化")
147
148 return self.detection_engine.predict(img)
149
150 def slide_match(self, target_img: Union[bytes, str, pathlib.PurePath, Image.Image],
151 background_img: Union[bytes, str, pathlib.PurePath, Image.Image],

Callers 6

mainFunction · 0.95
call_toolMethod · 0.80
object_detectionFunction · 0.80
object_detectionFunction · 0.80
object_detection_fileFunction · 0.80
ocr.pyFile · 0.80

Calls 2

DDDDOCRErrorClass · 0.85
predictMethod · 0.45

Tested by

no test coverage detected