Skip to content

Commit

Permalink
fix OCR color extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
zyddnys committed Nov 12, 2023
1 parent 20d6a87 commit 88349e7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions manga_translator/ocr/model_32px.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ async def _infer(self, image: np.ndarray, textlines: List[Quadrilateral], args:
out_regions.append(cur_region)

if is_quadrilaterals:
for region in out_regions :
if isinstance(region, TextBlock):
region.fg_colors /= float(len(region.lines))
region.bg_colors /= float(len(region.lines))
return out_regions
return textlines

Expand Down
4 changes: 0 additions & 4 deletions manga_translator/ocr/model_48px.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ async def _infer(self, image: np.ndarray, textlines: List[Quadrilateral], verbos
out_regions.append(cur_region)

if is_quadrilaterals:
for region in out_regions :
if isinstance(region, TextBlock):
region.fg_colors /= float(len(region.lines))
region.bg_colors /= float(len(region.lines))
return out_regions
return textlines

Expand Down
4 changes: 0 additions & 4 deletions manga_translator/ocr/model_48px_ctc.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ async def _infer(self, image: np.ndarray, textlines: List[Quadrilateral], args:
out_regions.append(cur_region)

if is_quadrilaterals:
for region in out_regions :
if isinstance(region, TextBlock):
region.fg_colors /= float(len(region.lines))
region.bg_colors /= float(len(region.lines))
return out_regions
return textlines

Expand Down

0 comments on commit 88349e7

Please sign in to comment.