Unverified Commit bbb3b404 authored by dmMaze's avatar dmMaze Committed by GitHub
Browse files

Merge pull request #92 from tak2hu/master

fix brushes for python3.10
parents c54767cc d185f036
Loading
Loading
Loading
Loading
+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())
+1 −0
Original line number Diff line number Diff line
@@ -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]

+2 −2
Original line number Diff line number Diff line
@@ -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):

+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

@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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()))
                )