Compare commits
No commits in common. "00b6b54db9075143be0a3837e088c6b8d798a723" and "6c54a86cde82bae86c82d169af773676d60865b1" have entirely different histories.
00b6b54db9
...
6c54a86cde
@ -23,7 +23,6 @@ class DetectionSceneSignals(QObject):
|
|||||||
class DetectionTimelineSignals(QObject):
|
class DetectionTimelineSignals(QObject):
|
||||||
windowMoved = Signal()
|
windowMoved = Signal()
|
||||||
manualMove = Signal()
|
manualMove = Signal()
|
||||||
moveRequest = Signal(float)
|
|
||||||
|
|
||||||
class DetectionSignals(QObject):
|
class DetectionSignals(QObject):
|
||||||
hover = Signal((int, QPointF))
|
hover = Signal((int, QPointF))
|
||||||
|
@ -65,7 +65,6 @@ class Window(QGraphicsRectItem):
|
|||||||
|
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
self.setCursor(Qt.ClosedHandCursor)
|
self.setCursor(Qt.ClosedHandCursor)
|
||||||
# print(event.pos())
|
|
||||||
super().mousePressEvent(event)
|
super().mousePressEvent(event)
|
||||||
|
|
||||||
def mouseReleaseEvent(self, event):
|
def mouseReleaseEvent(self, event):
|
||||||
@ -122,7 +121,6 @@ class DetectionTimeline(QWidget):
|
|||||||
self._scene = QGraphicsScene(QRectF(0, 0, self._total_width, 85.))
|
self._scene = QGraphicsScene(QRectF(0, 0, self._total_width, 85.))
|
||||||
self._scene.setBackgroundBrush(self._bg_brush)
|
self._scene.setBackgroundBrush(self._bg_brush)
|
||||||
self._scene.addItem(self._window)
|
self._scene.addItem(self._window)
|
||||||
self._scene.mousePressEvent = self.on_sceneMousePress
|
|
||||||
|
|
||||||
self._view = QGraphicsView()
|
self._view = QGraphicsView()
|
||||||
# self._view.setRenderHints(QPainter.RenderHint.Antialiasing | QPainter.RenderHint.SmoothPixmapTransform)
|
# self._view.setRenderHints(QPainter.RenderHint.Antialiasing | QPainter.RenderHint.SmoothPixmapTransform)
|
||||||
@ -161,14 +159,6 @@ class DetectionTimeline(QWidget):
|
|||||||
# self.setMaximumHeight(100)
|
# self.setMaximumHeight(100)
|
||||||
# self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
# self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||||
|
|
||||||
def on_sceneMousePress(self, event):
|
|
||||||
scene_pos = event.scenePos()
|
|
||||||
relpos = scene_pos.x() / self._total_width
|
|
||||||
relpos = 0 if relpos < 0.0 else relpos
|
|
||||||
relpos = 2000/self._total_width if scene_pos.x() > self._total_width else relpos
|
|
||||||
self.signals.moveRequest.emit(relpos)
|
|
||||||
logging.debug("Timeline: Scene clicked at position: %.2f, %.2f --> rel x-pos %.3f", scene_pos.x(), scene_pos.y(), relpos)
|
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
for i in self._scene.items():
|
for i in self._scene.items():
|
||||||
if isinstance(i, (QGraphicsLineItem, QGraphicsEllipseItem)):
|
if isinstance(i, (QGraphicsLineItem, QGraphicsEllipseItem)):
|
||||||
|
@ -142,10 +142,9 @@ class DetectionView(QWidget):
|
|||||||
scores = self._data.selectedData("confidence")
|
scores = self._data.selectedData("confidence")
|
||||||
|
|
||||||
image_rect = self._pixmapitem.boundingRect() if self._pixmapitem is not None else QRectF(0,0,0,0)
|
image_rect = self._pixmapitem.boundingRect() if self._pixmapitem is not None else QRectF(0,0,0,0)
|
||||||
num_detections = len(frames)
|
|
||||||
for i, (id, f, t, l, s) in enumerate(zip(ids, frames, tracks, userlabeled, scores)):
|
for i, (id, f, t, l, s) in enumerate(zip(ids, frames, tracks, userlabeled, scores)):
|
||||||
c = Tracks.fromValue(t).toColor()
|
c = Tracks.fromValue(t).toColor()
|
||||||
c.setAlpha(int(i * 255 / num_detections))
|
|
||||||
if keypoint >= 0:
|
if keypoint >= 0:
|
||||||
x = coordinates[i, keypoint, 0]
|
x = coordinates[i, keypoint, 0]
|
||||||
y = coordinates[i, keypoint, 1]
|
y = coordinates[i, keypoint, 1]
|
||||||
|
@ -45,7 +45,6 @@ class FixTracks(QWidget):
|
|||||||
|
|
||||||
self._timeline = DetectionTimeline()
|
self._timeline = DetectionTimeline()
|
||||||
self._timeline.signals.windowMoved.connect(self.on_windowChanged)
|
self._timeline.signals.windowMoved.connect(self.on_windowChanged)
|
||||||
self._timeline.signals.moveRequest.connect(self.on_moveRequest)
|
|
||||||
|
|
||||||
self._windowspinner = QSpinBox()
|
self._windowspinner = QSpinBox()
|
||||||
self._windowspinner.setRange(10, 10000)
|
self._windowspinner.setRange(10, 10000)
|
||||||
@ -344,11 +343,6 @@ class FixTracks(QWidget):
|
|||||||
self.update()
|
self.update()
|
||||||
self._manualmove = False
|
self._manualmove = False
|
||||||
|
|
||||||
def on_moveRequest(self, pos):
|
|
||||||
new_pos = int(np.round(pos * self._maxframes))
|
|
||||||
self._currentWindowPos = new_pos
|
|
||||||
self.update()
|
|
||||||
|
|
||||||
def on_windowSizeChanged(self, value):
|
def on_windowSizeChanged(self, value):
|
||||||
"""Reacts on the user window-width selection. Selection is done in the unit of frames.
|
"""Reacts on the user window-width selection. Selection is done in the unit of frames.
|
||||||
|
|
||||||
@ -359,12 +353,11 @@ class FixTracks(QWidget):
|
|||||||
"""
|
"""
|
||||||
self._currentWindowWidth = value
|
self._currentWindowWidth = value
|
||||||
logging.debug("Tracks:OnWindowSizeChanged %i franes", value)
|
logging.debug("Tracks:OnWindowSizeChanged %i franes", value)
|
||||||
# if self._maxframes == 0:
|
if self._maxframes == 0:
|
||||||
# self._timeline.setWindowWidth(self._currentWindowWidth / 2000)
|
self._timeline.setWindowWidth(self._currentWindowWidth / 2000)
|
||||||
# else:
|
else:
|
||||||
# self._timeline.setWindowWidth(self._currentWindowWidth / self._maxframes)
|
self._timeline.setWindowWidth(self._currentWindowWidth / self._maxframes)
|
||||||
# self._controls_widget.setSelectedTracks(None)
|
self._controls_widget.setSelectedTracks(None)
|
||||||
self.update()
|
|
||||||
|
|
||||||
def on_goto(self):
|
def on_goto(self):
|
||||||
target = self._goto_spinner.value()
|
target = self._goto_spinner.value()
|
||||||
|
Loading…
Reference in New Issue
Block a user