Loading ballontranslator/dl/__init__.py +3 −3 Original line number Diff line number Diff line from .ocr import OCR, OCRBase, OCRMIT32px, OCRMIT48pxCTC from .ocr import OCR, OCRBase, OCRMIT32px, OCRMIT48pxCTC, MangaOCR from .textdetector import TEXTDETECTORS, TextDetectorBase, ComicTextDetector from .translators import TRANSLATORS, TranslatorBase from .inpaint import INPAINTERS, InpainterBase, PatchmatchInpainter, AOTInpainter from .translators import TRANSLATORS, TranslatorBase, SugoiTranslator from .inpaint import INPAINTERS, InpainterBase, PatchmatchInpainter, AOTInpainter, LamaInpainterMPE from .moduleparamparser import DEFAULT_DEVICE VALID_TEXTDETECTORS = list(TEXTDETECTORS.module_dict.keys()) Loading ballontranslator/dl/ocr/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class OCRBase(ModuleParamParser): text = self.ocr_img(img) for callback in self.postprocess_hooks: text = callback(text) return text elif isinstance(blk_list, TextBlock): blk_list = [blk_list] Loading ballontranslator/dl/translators/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -371,8 +371,8 @@ class DeeplTranslator(TranslatorBase): SUGOIMODEL_TRANSLATOR_DIRPATH = 'data/models/sugoi_translator' SUGOIMODEL_TOKENIZATOR_PATH = SUGOIMODEL_TRANSLATOR_DIRPATH + "\\spm.ja.nopretok.model" SUGOIMODEL_TRANSLATOR_DIRPATH = 'data/models/sugoi_translator/' SUGOIMODEL_TOKENIZATOR_PATH = SUGOIMODEL_TRANSLATOR_DIRPATH + "spm.ja.nopretok.model" @register_translator('Sugoi') class SugoiTranslator(TranslatorBase): Loading ballontranslator/ui/drawingpanel.py +2 −2 Original line number Diff line number Diff line from qtpy.QtCore import Signal, Qt, QPointF, QSize, QLineF, QRectF from qtpy.QtCore import Signal, Qt, QPointF, QSize, QSizeF, QLineF, QRectF from qtpy.QtWidgets import QGridLayout, QPushButton, QComboBox, QSizePolicy, QBoxLayout, QCheckBox, QHBoxLayout, QGraphicsView, QStackedWidget, QVBoxLayout, QLabel, QGraphicsPixmapItem, QGraphicsEllipseItem from qtpy.QtGui import QPen, QColor, QCursor, QPainter, QPixmap, QBrush, QFontMetrics Loading Loading @@ -489,7 +489,7 @@ class DrawingPanel(Widget): if pen_size < 20: pen.setStyle(Qt.PenStyle.SolidLine) cur_pixmap = QPixmap(QSize(map_size, map_size)) cur_pixmap = QPixmap(QSizeF(map_size, map_size).toSize()) cur_pixmap.fill(Qt.GlobalColor.transparent) painter = QPainter(cur_pixmap) painter.setPen(pen) Loading ballontranslator/ui/stylewidgets.py +1 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,7 @@ class PaintQSlider(QSlider): else: # 在左侧绘制文字 x, y = rect.x() - rect.width(), rect.y() painter.drawText( x, y-10, textw, rect.height()+20, int(x), int(y)-10, textw, rect.height()+20, Qt.AlignmentFlag.AlignCenter, self.draw_content.replace("value", str(self.value())) ) Loading Loading
ballontranslator/dl/__init__.py +3 −3 Original line number Diff line number Diff line from .ocr import OCR, OCRBase, OCRMIT32px, OCRMIT48pxCTC from .ocr import OCR, OCRBase, OCRMIT32px, OCRMIT48pxCTC, MangaOCR from .textdetector import TEXTDETECTORS, TextDetectorBase, ComicTextDetector from .translators import TRANSLATORS, TranslatorBase from .inpaint import INPAINTERS, InpainterBase, PatchmatchInpainter, AOTInpainter from .translators import TRANSLATORS, TranslatorBase, SugoiTranslator from .inpaint import INPAINTERS, InpainterBase, PatchmatchInpainter, AOTInpainter, LamaInpainterMPE from .moduleparamparser import DEFAULT_DEVICE VALID_TEXTDETECTORS = list(TEXTDETECTORS.module_dict.keys()) Loading
ballontranslator/dl/ocr/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class OCRBase(ModuleParamParser): text = self.ocr_img(img) for callback in self.postprocess_hooks: text = callback(text) return text elif isinstance(blk_list, TextBlock): blk_list = [blk_list] Loading
ballontranslator/dl/translators/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -371,8 +371,8 @@ class DeeplTranslator(TranslatorBase): SUGOIMODEL_TRANSLATOR_DIRPATH = 'data/models/sugoi_translator' SUGOIMODEL_TOKENIZATOR_PATH = SUGOIMODEL_TRANSLATOR_DIRPATH + "\\spm.ja.nopretok.model" SUGOIMODEL_TRANSLATOR_DIRPATH = 'data/models/sugoi_translator/' SUGOIMODEL_TOKENIZATOR_PATH = SUGOIMODEL_TRANSLATOR_DIRPATH + "spm.ja.nopretok.model" @register_translator('Sugoi') class SugoiTranslator(TranslatorBase): Loading
ballontranslator/ui/drawingpanel.py +2 −2 Original line number Diff line number Diff line from qtpy.QtCore import Signal, Qt, QPointF, QSize, QLineF, QRectF from qtpy.QtCore import Signal, Qt, QPointF, QSize, QSizeF, QLineF, QRectF from qtpy.QtWidgets import QGridLayout, QPushButton, QComboBox, QSizePolicy, QBoxLayout, QCheckBox, QHBoxLayout, QGraphicsView, QStackedWidget, QVBoxLayout, QLabel, QGraphicsPixmapItem, QGraphicsEllipseItem from qtpy.QtGui import QPen, QColor, QCursor, QPainter, QPixmap, QBrush, QFontMetrics Loading Loading @@ -489,7 +489,7 @@ class DrawingPanel(Widget): if pen_size < 20: pen.setStyle(Qt.PenStyle.SolidLine) cur_pixmap = QPixmap(QSize(map_size, map_size)) cur_pixmap = QPixmap(QSizeF(map_size, map_size).toSize()) cur_pixmap.fill(Qt.GlobalColor.transparent) painter = QPainter(cur_pixmap) painter.setPen(pen) Loading
ballontranslator/ui/stylewidgets.py +1 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,7 @@ class PaintQSlider(QSlider): else: # 在左侧绘制文字 x, y = rect.x() - rect.width(), rect.y() painter.drawText( x, y-10, textw, rect.height()+20, int(x), int(y)-10, textw, rect.height()+20, Qt.AlignmentFlag.AlignCenter, self.draw_content.replace("value", str(self.value())) ) Loading