mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 20:58:11 +00:00
fix: handle empty result from RapidOCR to avoid crash (#2264)
Signed-off-by: Junehyuk Park <yuie@evonit.net>
This commit is contained in:
@@ -120,6 +120,9 @@ class RapidOcrModel(BaseOcrModel):
|
|||||||
use_cls=self.options.use_cls,
|
use_cls=self.options.use_cls,
|
||||||
use_rec=self.options.use_rec,
|
use_rec=self.options.use_rec,
|
||||||
)
|
)
|
||||||
|
if result is None or result.boxes is None:
|
||||||
|
_log.warning("RapidOCR returned empty result!")
|
||||||
|
continue
|
||||||
result = list(
|
result = list(
|
||||||
zip(result.boxes.tolist(), result.txts, result.scores)
|
zip(result.boxes.tolist(), result.txts, result.scores)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user