[detectionpreview] nice and shiny
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import logging
|
||||
import pickle
|
||||
import pandas as pd
|
||||
from PySide6.QtWidgets import QDialog, QVBoxLayout, QHBoxLayout, QPushButton, QFileDialog, QProgressBar
|
||||
from PySide6.QtCore import QThreadPool
|
||||
from PySide6.QtGui import QImage
|
||||
|
||||
from fixtracks.widgets.mergepreview import MergePreview
|
||||
from fixtracks.utils.reader import PickleLoader
|
||||
@@ -24,16 +23,8 @@ class PreviewDialog(QDialog):
|
||||
self._opendataBtn = QPushButton("open data")
|
||||
self._opendataBtn.clicked.connect(self.on_openData)
|
||||
|
||||
self._openleftBtn = QPushButton("open left video")
|
||||
self._openleftBtn.clicked.connect(self.on_openleftVideo)
|
||||
|
||||
self._openrightBtn = QPushButton("open right video")
|
||||
self._openrightBtn.clicked.connect(self.on_openrightVideo)
|
||||
|
||||
btn_box = QHBoxLayout()
|
||||
btn_box.addWidget(self._opendataBtn)
|
||||
btn_box.addWidget(self._openleftBtn)
|
||||
btn_box.addWidget(self._openrightBtn)
|
||||
|
||||
layout = QVBoxLayout()
|
||||
layout.addLayout(btn_box)
|
||||
@@ -43,9 +34,22 @@ class PreviewDialog(QDialog):
|
||||
self.setLayout(layout)
|
||||
|
||||
def on_openData(self):
|
||||
file_dialog = QFileDialog(self, "Select pickled DataFrame", "", "Pandas DataFrame (*.pkl)")
|
||||
infile = None
|
||||
imgfile = None
|
||||
|
||||
file_dialog = QFileDialog(self, "Select merged image")
|
||||
file_dialog.setFileMode(QFileDialog.ExistingFile)
|
||||
file_dialog.setNameFilters([
|
||||
"Image Files (*.png *.jpg *.jpeg)",
|
||||
"All Files (*)"
|
||||
])
|
||||
if file_dialog.exec():
|
||||
imgfile = file_dialog.selectedFiles()[0]
|
||||
if imgfile is not None:
|
||||
img = QImage(imgfile)
|
||||
self.merge_preview.set_image(img)
|
||||
|
||||
file_dialog = QFileDialog(self, "Select pickled DataFrame", "", "Pandas DataFrame (*.pkl)")
|
||||
if file_dialog.exec():
|
||||
infile = file_dialog.selectedFiles()[0]
|
||||
if infile is not None:
|
||||
@@ -62,11 +66,6 @@ class PreviewDialog(QDialog):
|
||||
self.merge_preview.set_dataframe(self._df)
|
||||
self._reader = None
|
||||
|
||||
def on_openleftVideo(self):
|
||||
pass
|
||||
|
||||
def on_openrightVideo(self):
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user