ScreenMagnifier 1.11.0.post8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ScreenMagnifier might be problematic. Click here for more details.

Files changed (117) hide show
  1. ScreenMagnifier/__init__.py +68 -0
  2. ScreenMagnifier/__main__.py +17 -0
  3. ScreenMagnifier/advancedoverlay.py +593 -0
  4. ScreenMagnifier/advancedpanel.py +521 -0
  5. ScreenMagnifier/analysiscontroller.py +533 -0
  6. ScreenMagnifier/analysisserver.py +404 -0
  7. ScreenMagnifier/colordetector/__init__.py +28 -0
  8. ScreenMagnifier/colordetector/colordetector.py +570 -0
  9. ScreenMagnifier/colordetector/core.py +434 -0
  10. ScreenMagnifier/colordetector/main.py +23 -0
  11. ScreenMagnifier/colordetector/mainwindow.py +182 -0
  12. ScreenMagnifier/colorpanel.py +424 -0
  13. ScreenMagnifier/colorswatches/__init__.py +16 -0
  14. ScreenMagnifier/colorswatches/colorswatches.py +316 -0
  15. ScreenMagnifier/colorswatches/main.py +23 -0
  16. ScreenMagnifier/colorswatches/mainwindow.py +60 -0
  17. ScreenMagnifier/controlpanel.py +234 -0
  18. ScreenMagnifier/detectionpanel.py +790 -0
  19. ScreenMagnifier/facedetector/__init__.py +24 -0
  20. ScreenMagnifier/facedetector/core.py +314 -0
  21. ScreenMagnifier/facedetector/facedetector.py +288 -0
  22. ScreenMagnifier/facedetector/main.py +23 -0
  23. ScreenMagnifier/facedetector/mainwindow.py +122 -0
  24. ScreenMagnifier/facedetector/models/__init__.py +4 -0
  25. ScreenMagnifier/facepointer.py +1121 -0
  26. ScreenMagnifier/features.py +50 -0
  27. ScreenMagnifier/hotkeys/__init__.py +16 -0
  28. ScreenMagnifier/hotkeys/hotkeys.py +379 -0
  29. ScreenMagnifier/hotkeys/main.py +23 -0
  30. ScreenMagnifier/hotkeys/mainwindow.py +56 -0
  31. ScreenMagnifier/imagefilters/__init__.py +24 -0
  32. ScreenMagnifier/imagefilters/core.py +172 -0
  33. ScreenMagnifier/imagefilters/imagefilters.py +220 -0
  34. ScreenMagnifier/imagefilters/main.py +23 -0
  35. ScreenMagnifier/imagefilters/mainwindow.py +120 -0
  36. ScreenMagnifier/magnifierview/__init__.py +16 -0
  37. ScreenMagnifier/magnifierview/magnifierview.py +1249 -0
  38. ScreenMagnifier/magnifierview/main.py +23 -0
  39. ScreenMagnifier/magnifierview/mainwindow.py +91 -0
  40. ScreenMagnifier/main.py +157 -0
  41. ScreenMagnifier/mainwindow.py +1368 -0
  42. ScreenMagnifier/mousecatcher/__init__.py +16 -0
  43. ScreenMagnifier/mousecatcher/main.py +23 -0
  44. ScreenMagnifier/mousecatcher/mainwindow.py +78 -0
  45. ScreenMagnifier/mousecatcher/mousecatcher.py +251 -0
  46. ScreenMagnifier/mousemove.py +259 -0
  47. ScreenMagnifier/netprotocol/__init__.py +25 -0
  48. ScreenMagnifier/netprotocol/main.py +23 -0
  49. ScreenMagnifier/netprotocol/mainwindow.py +91 -0
  50. ScreenMagnifier/netprotocol/netprotocol.py +372 -0
  51. ScreenMagnifier/netprotocol/wire.py +189 -0
  52. ScreenMagnifier/regionselector/__init__.py +16 -0
  53. ScreenMagnifier/regionselector/main.py +23 -0
  54. ScreenMagnifier/regionselector/mainwindow.py +70 -0
  55. ScreenMagnifier/regionselector/regionselector.py +549 -0
  56. ScreenMagnifier/remoteclient.py +636 -0
  57. ScreenMagnifier/resources/icon-128.png +0 -0
  58. ScreenMagnifier/resources/icon-16.png +0 -0
  59. ScreenMagnifier/resources/icon-24.png +0 -0
  60. ScreenMagnifier/resources/icon-256.png +0 -0
  61. ScreenMagnifier/resources/icon-32.png +0 -0
  62. ScreenMagnifier/resources/icon-48.png +0 -0
  63. ScreenMagnifier/resources/icon-512.png +0 -0
  64. ScreenMagnifier/resources/icon-64.png +0 -0
  65. ScreenMagnifier/resources/icon.icns +0 -0
  66. ScreenMagnifier/resources/icon.ico +0 -0
  67. ScreenMagnifier/screengrabber/__init__.py +16 -0
  68. ScreenMagnifier/screengrabber/main.py +23 -0
  69. ScreenMagnifier/screengrabber/mainwindow.py +79 -0
  70. ScreenMagnifier/screengrabber/screengrabber.py +558 -0
  71. ScreenMagnifier/server.py +150 -0
  72. ScreenMagnifier/serverpanel.py +379 -0
  73. ScreenMagnifier/shortcuteditor/__init__.py +16 -0
  74. ScreenMagnifier/shortcuteditor/main.py +23 -0
  75. ScreenMagnifier/shortcuteditor/mainwindow.py +54 -0
  76. ScreenMagnifier/shortcuteditor/shortcuteditor.py +411 -0
  77. ScreenMagnifier/shortcuts.py +118 -0
  78. ScreenMagnifier/shortcutspanel.py +140 -0
  79. ScreenMagnifier/support.py +127 -0
  80. ScreenMagnifier/translations/ar.json +387 -0
  81. ScreenMagnifier/translations/de.json +387 -0
  82. ScreenMagnifier/translations/es.json +387 -0
  83. ScreenMagnifier/translations/fr.json +387 -0
  84. ScreenMagnifier/translations/it.json +387 -0
  85. ScreenMagnifier/translations/ja.json +387 -0
  86. ScreenMagnifier/translations/ko.json +387 -0
  87. ScreenMagnifier/translations/pt_BR.json +387 -0
  88. ScreenMagnifier/translations/ru.json +387 -0
  89. ScreenMagnifier/translations/tr.json +387 -0
  90. ScreenMagnifier/translations/zh_CN.json +387 -0
  91. ScreenMagnifier/translator/__init__.py +16 -0
  92. ScreenMagnifier/translator/main.py +23 -0
  93. ScreenMagnifier/translator/mainwindow.py +62 -0
  94. ScreenMagnifier/translator/translator.py +284 -0
  95. ScreenMagnifier/upscaler/__init__.py +24 -0
  96. ScreenMagnifier/upscaler/core.py +315 -0
  97. ScreenMagnifier/upscaler/main.py +23 -0
  98. ScreenMagnifier/upscaler/mainwindow.py +128 -0
  99. ScreenMagnifier/upscaler/models/FSRCNN-small_x2.pb +0 -0
  100. ScreenMagnifier/upscaler/models/FSRCNN-small_x3.pb +0 -0
  101. ScreenMagnifier/upscaler/models/FSRCNN-small_x4.pb +0 -0
  102. ScreenMagnifier/upscaler/models/FSRCNN_x2.pb +0 -0
  103. ScreenMagnifier/upscaler/models/FSRCNN_x3.pb +0 -0
  104. ScreenMagnifier/upscaler/models/FSRCNN_x4.pb +0 -0
  105. ScreenMagnifier/upscaler/models/LICENSE-FSRCNN +201 -0
  106. ScreenMagnifier/upscaler/models/__init__.py +4 -0
  107. ScreenMagnifier/upscaler/upscaler.py +285 -0
  108. ScreenMagnifier/wincheck.py +65 -0
  109. ScreenMagnifier/zoomoverlay/__init__.py +16 -0
  110. ScreenMagnifier/zoomoverlay/main.py +23 -0
  111. ScreenMagnifier/zoomoverlay/mainwindow.py +99 -0
  112. ScreenMagnifier/zoomoverlay/zoomoverlay.py +1779 -0
  113. screenmagnifier-1.11.0.post8.dist-info/METADATA +591 -0
  114. screenmagnifier-1.11.0.post8.dist-info/RECORD +117 -0
  115. screenmagnifier-1.11.0.post8.dist-info/WHEEL +5 -0
  116. screenmagnifier-1.11.0.post8.dist-info/entry_points.txt +5 -0
  117. screenmagnifier-1.11.0.post8.dist-info/top_level.txt +1 -0
@@ -0,0 +1,122 @@
1
+ # coding=utf-8
2
+ """
3
+ Demo window for FaceDetector: open a photo or follow the screen around the mouse, with boxes and landmarks.
4
+ """
5
+ from ManyQt.QtWidgets import QMainWindow, QVBoxLayout, QHBoxLayout, QWidget, QLabel, QPushButton, QComboBox, \
6
+ QCheckBox, QFileDialog
7
+ from ManyQt.QtGui import QImage, QPainter, QColor, QPen, QPixmap, QCursor, QGuiApplication
8
+ from ManyQt.QtCore import Qt, QRect, QRectF, QPointF, QTimer, pyqtSlot
9
+ from os.path import dirname
10
+ from sys import path
11
+
12
+ if not __package__ and dirname(__file__) not in path:
13
+ path.append(dirname(__file__))
14
+
15
+ try:
16
+ from .facedetector import FaceDetector
17
+ except:
18
+ from facedetector import FaceDetector
19
+
20
+
21
+ class MainWindow(QMainWindow):
22
+ """
23
+ MainWindow class.
24
+ """
25
+
26
+ def __init__(self, *args, **kwargs):
27
+ """
28
+ :param args: any
29
+ :param kwargs: any
30
+ """
31
+ super(MainWindow, self).__init__(*args, **kwargs)
32
+ self.setWindowTitle(self.tr(u'FaceDetector demo'))
33
+ self.resize(900, 640)
34
+ self.__m_detector = FaceDetector(downloadFinished=self.onDownloaded,
35
+ downloadProgress=lambda v: self.statusBar().showMessage(
36
+ self.tr(u'Downloading model {} %').format(v))) # type: FaceDetector
37
+ self.__m_image = QImage() # type: QImage
38
+ self.__m_picture = QLabel(self.tr(u'Open a photo, or tick "Follow the mouse" and hover a face on screen.'))
39
+ self.__m_picture.setAlignment(Qt.AlignCenter)
40
+ self.__m_picture.setMinimumSize(320, 240)
41
+ backend = QComboBox() # type: QComboBox
42
+ for data in ('auto', 'yunet', 'haar'):
43
+ backend.addItem(data, data)
44
+ backend.currentIndexChanged.connect(
45
+ lambda i: (self.__m_detector.setBackend(backend.itemData(i)), self.detect()))
46
+ openBtn = QPushButton(self.tr(u'Open photo...')) # type: QPushButton
47
+ openBtn.clicked.connect(self.openPhoto)
48
+ self.__m_download = QPushButton(self.tr(u'Download YuNet model')) # type: QPushButton
49
+ self.__m_download.clicked.connect(self.__m_detector.downloadModel)
50
+ self.__m_download.setVisible(FaceDetector.hasYuNetSupport() and not self.__m_detector.isModelReady())
51
+ follow = QCheckBox(self.tr(u'Follow the mouse')) # type: QCheckBox
52
+ self.__m_timer = QTimer(self) # type: QTimer
53
+ self.__m_timer.timeout.connect(self.grabAroundCursor)
54
+ follow.toggled.connect(lambda on: self.__m_timer.start(200) if on else self.__m_timer.stop())
55
+ bar = QHBoxLayout() # type: QHBoxLayout
56
+ for w in (openBtn, follow, QLabel(self.tr(u'Backend')), backend, self.__m_download):
57
+ bar.addWidget(w)
58
+ bar.addStretch(1)
59
+ wdg = QWidget() # type: QWidget
60
+ layout = QVBoxLayout(wdg) # type: QVBoxLayout
61
+ layout.addLayout(bar)
62
+ layout.addWidget(self.__m_picture, 1)
63
+ self.setCentralWidget(wdg)
64
+ if not FaceDetector.isAvailable():
65
+ self.statusBar().showMessage(self.tr(u'Install opencv-python and numpy to use the face detector.'))
66
+
67
+ @pyqtSlot()
68
+ def openPhoto(self):
69
+ """
70
+ :return:
71
+ """
72
+ res = QFileDialog.getOpenFileName(self, self.tr(u'Photo'), '', self.tr(u'Images (*.png *.jpg *.jpeg *.bmp)'))
73
+ fileName = res[0] if isinstance(res, tuple) else res # type: str
74
+ if fileName:
75
+ self.__m_image = QImage(fileName) # type: QImage
76
+ self.detect()
77
+
78
+ @pyqtSlot()
79
+ def grabAroundCursor(self):
80
+ """
81
+ :return:
82
+ """
83
+ pos = QCursor.pos()
84
+ screen = QGuiApplication.screenAt(pos) or QGuiApplication.primaryScreen()
85
+ g = screen.geometry() # type: QRect
86
+ self.__m_image = screen.grabWindow(0, pos.x() - g.x() - 240, pos.y() - g.y() - 180, 480, 360).toImage()
87
+ self.detect()
88
+
89
+ @pyqtSlot()
90
+ def detect(self):
91
+ """
92
+ :return: None
93
+ """
94
+ if self.__m_image.isNull():
95
+ return
96
+ r = self.__m_detector.detect(self.__m_image) # type: dict
97
+ pm = QPixmap.fromImage(self.__m_image) # type: QPixmap
98
+ p = QPainter(pm) # type: QPainter
99
+ p.setRenderHint(QPainter.Antialiasing, True)
100
+ for f in r['faces']:
101
+ p.setPen(QPen(QColor('#00E5FF'), 3))
102
+ p.drawRect(QRectF(*f['rect']))
103
+ p.drawText(QPointF(f['rect'][0], f['rect'][1] - 6), '{:.0f} %'.format(100 * f['score']))
104
+ p.setBrush(QColor('#FF3B6B'))
105
+ for x, y in f['landmarks']:
106
+ p.drawEllipse(QPointF(x, y), 3, 3)
107
+ p.setBrush(Qt.NoBrush)
108
+ p.end()
109
+ self.__m_picture.setPixmap(pm.scaled(self.__m_picture.size(), Qt.KeepAspectRatio, Qt.SmoothTransformation))
110
+ self.statusBar().showMessage(self.tr(u'{} face(s) - backend {} - {:.1f} ms').format(
111
+ len(r['faces']), r['backend'] or '-', r['timeMs']))
112
+
113
+ @pyqtSlot(bool, 'QString')
114
+ def onDownloaded(self, ok, message):
115
+ """
116
+ :param ok: bool
117
+ :param message: str | unicode | QString
118
+ :return:
119
+ """
120
+ self.__m_download.setVisible(not ok)
121
+ self.statusBar().showMessage(self.tr(u'Model installed') if ok else u'{}'.format(message))
122
+ self.detect()
@@ -0,0 +1,4 @@
1
+ # coding=utf-8
2
+ """
3
+ YuNet face detection model folder (downloaded on demand, MIT license: https://github.com/opencv/opencv_zoo).
4
+ """