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.
- ScreenMagnifier/__init__.py +68 -0
- ScreenMagnifier/__main__.py +17 -0
- ScreenMagnifier/advancedoverlay.py +593 -0
- ScreenMagnifier/advancedpanel.py +521 -0
- ScreenMagnifier/analysiscontroller.py +533 -0
- ScreenMagnifier/analysisserver.py +404 -0
- ScreenMagnifier/colordetector/__init__.py +28 -0
- ScreenMagnifier/colordetector/colordetector.py +570 -0
- ScreenMagnifier/colordetector/core.py +434 -0
- ScreenMagnifier/colordetector/main.py +23 -0
- ScreenMagnifier/colordetector/mainwindow.py +182 -0
- ScreenMagnifier/colorpanel.py +424 -0
- ScreenMagnifier/colorswatches/__init__.py +16 -0
- ScreenMagnifier/colorswatches/colorswatches.py +316 -0
- ScreenMagnifier/colorswatches/main.py +23 -0
- ScreenMagnifier/colorswatches/mainwindow.py +60 -0
- ScreenMagnifier/controlpanel.py +234 -0
- ScreenMagnifier/detectionpanel.py +790 -0
- ScreenMagnifier/facedetector/__init__.py +24 -0
- ScreenMagnifier/facedetector/core.py +314 -0
- ScreenMagnifier/facedetector/facedetector.py +288 -0
- ScreenMagnifier/facedetector/main.py +23 -0
- ScreenMagnifier/facedetector/mainwindow.py +122 -0
- ScreenMagnifier/facedetector/models/__init__.py +4 -0
- ScreenMagnifier/facepointer.py +1121 -0
- ScreenMagnifier/features.py +50 -0
- ScreenMagnifier/hotkeys/__init__.py +16 -0
- ScreenMagnifier/hotkeys/hotkeys.py +379 -0
- ScreenMagnifier/hotkeys/main.py +23 -0
- ScreenMagnifier/hotkeys/mainwindow.py +56 -0
- ScreenMagnifier/imagefilters/__init__.py +24 -0
- ScreenMagnifier/imagefilters/core.py +172 -0
- ScreenMagnifier/imagefilters/imagefilters.py +220 -0
- ScreenMagnifier/imagefilters/main.py +23 -0
- ScreenMagnifier/imagefilters/mainwindow.py +120 -0
- ScreenMagnifier/magnifierview/__init__.py +16 -0
- ScreenMagnifier/magnifierview/magnifierview.py +1249 -0
- ScreenMagnifier/magnifierview/main.py +23 -0
- ScreenMagnifier/magnifierview/mainwindow.py +91 -0
- ScreenMagnifier/main.py +157 -0
- ScreenMagnifier/mainwindow.py +1368 -0
- ScreenMagnifier/mousecatcher/__init__.py +16 -0
- ScreenMagnifier/mousecatcher/main.py +23 -0
- ScreenMagnifier/mousecatcher/mainwindow.py +78 -0
- ScreenMagnifier/mousecatcher/mousecatcher.py +251 -0
- ScreenMagnifier/mousemove.py +259 -0
- ScreenMagnifier/netprotocol/__init__.py +25 -0
- ScreenMagnifier/netprotocol/main.py +23 -0
- ScreenMagnifier/netprotocol/mainwindow.py +91 -0
- ScreenMagnifier/netprotocol/netprotocol.py +372 -0
- ScreenMagnifier/netprotocol/wire.py +189 -0
- ScreenMagnifier/regionselector/__init__.py +16 -0
- ScreenMagnifier/regionselector/main.py +23 -0
- ScreenMagnifier/regionselector/mainwindow.py +70 -0
- ScreenMagnifier/regionselector/regionselector.py +549 -0
- ScreenMagnifier/remoteclient.py +636 -0
- ScreenMagnifier/resources/icon-128.png +0 -0
- ScreenMagnifier/resources/icon-16.png +0 -0
- ScreenMagnifier/resources/icon-24.png +0 -0
- ScreenMagnifier/resources/icon-256.png +0 -0
- ScreenMagnifier/resources/icon-32.png +0 -0
- ScreenMagnifier/resources/icon-48.png +0 -0
- ScreenMagnifier/resources/icon-512.png +0 -0
- ScreenMagnifier/resources/icon-64.png +0 -0
- ScreenMagnifier/resources/icon.icns +0 -0
- ScreenMagnifier/resources/icon.ico +0 -0
- ScreenMagnifier/screengrabber/__init__.py +16 -0
- ScreenMagnifier/screengrabber/main.py +23 -0
- ScreenMagnifier/screengrabber/mainwindow.py +79 -0
- ScreenMagnifier/screengrabber/screengrabber.py +558 -0
- ScreenMagnifier/server.py +150 -0
- ScreenMagnifier/serverpanel.py +379 -0
- ScreenMagnifier/shortcuteditor/__init__.py +16 -0
- ScreenMagnifier/shortcuteditor/main.py +23 -0
- ScreenMagnifier/shortcuteditor/mainwindow.py +54 -0
- ScreenMagnifier/shortcuteditor/shortcuteditor.py +411 -0
- ScreenMagnifier/shortcuts.py +118 -0
- ScreenMagnifier/shortcutspanel.py +140 -0
- ScreenMagnifier/support.py +127 -0
- ScreenMagnifier/translations/ar.json +387 -0
- ScreenMagnifier/translations/de.json +387 -0
- ScreenMagnifier/translations/es.json +387 -0
- ScreenMagnifier/translations/fr.json +387 -0
- ScreenMagnifier/translations/it.json +387 -0
- ScreenMagnifier/translations/ja.json +387 -0
- ScreenMagnifier/translations/ko.json +387 -0
- ScreenMagnifier/translations/pt_BR.json +387 -0
- ScreenMagnifier/translations/ru.json +387 -0
- ScreenMagnifier/translations/tr.json +387 -0
- ScreenMagnifier/translations/zh_CN.json +387 -0
- ScreenMagnifier/translator/__init__.py +16 -0
- ScreenMagnifier/translator/main.py +23 -0
- ScreenMagnifier/translator/mainwindow.py +62 -0
- ScreenMagnifier/translator/translator.py +284 -0
- ScreenMagnifier/upscaler/__init__.py +24 -0
- ScreenMagnifier/upscaler/core.py +315 -0
- ScreenMagnifier/upscaler/main.py +23 -0
- ScreenMagnifier/upscaler/mainwindow.py +128 -0
- ScreenMagnifier/upscaler/models/FSRCNN-small_x2.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN-small_x3.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN-small_x4.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN_x2.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN_x3.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN_x4.pb +0 -0
- ScreenMagnifier/upscaler/models/LICENSE-FSRCNN +201 -0
- ScreenMagnifier/upscaler/models/__init__.py +4 -0
- ScreenMagnifier/upscaler/upscaler.py +285 -0
- ScreenMagnifier/wincheck.py +65 -0
- ScreenMagnifier/zoomoverlay/__init__.py +16 -0
- ScreenMagnifier/zoomoverlay/main.py +23 -0
- ScreenMagnifier/zoomoverlay/mainwindow.py +99 -0
- ScreenMagnifier/zoomoverlay/zoomoverlay.py +1779 -0
- screenmagnifier-1.11.0.post8.dist-info/METADATA +591 -0
- screenmagnifier-1.11.0.post8.dist-info/RECORD +117 -0
- screenmagnifier-1.11.0.post8.dist-info/WHEEL +5 -0
- screenmagnifier-1.11.0.post8.dist-info/entry_points.txt +5 -0
- 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()
|