99import numpy as np
1010import pandas as pd
1111from omegaconf import DictConfig , OmegaConf
12- from PySide2 import QtCore , QtGui , QtWidgets
13- from PySide2 .QtCore import Slot
14- from PySide2 .QtWidgets import QFileDialog , QInputDialog , QMainWindow
12+ from PySide6 import QtCore , QtGui , QtWidgets
13+ from PySide6 .QtCore import Slot
14+ from PySide6 .QtWidgets import QFileDialog , QInputDialog , QMainWindow
1515
1616from deepethogram import configuration , projects , utils
1717from deepethogram .file_io import VideoReader
@@ -63,37 +63,37 @@ def __init__(self, cfg: DictConfig):
6363
6464 # scroll down to Standard Shorcuts to find what the keys are called:
6565 # https://doc.qt.io/qt-5/qkeysequence.html
66- next_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Right" ), self )
66+ next_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Right" ), self )
6767 # partial functions create a new, separate function with certain default arguments
6868 next_shortcut .activated .connect (partial (self .move_n_frames , 1 ))
6969 next_shortcut .activated .connect (self .user_did_something )
7070
71- up_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Up" ), self )
71+ up_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Up" ), self )
7272 up_shortcut .activated .connect (partial (self .move_n_frames , - cfg .vertical_arrow_jump ))
7373 up_shortcut .activated .connect (self .user_did_something )
7474
75- down_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Down" ), self )
75+ down_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Down" ), self )
7676 down_shortcut .activated .connect (partial (self .move_n_frames , cfg .vertical_arrow_jump ))
7777 down_shortcut .activated .connect (self .user_did_something )
7878
79- back_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Left" ), self )
79+ back_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Left" ), self )
8080 back_shortcut .activated .connect (partial (self .move_n_frames , - 1 ))
8181 back_shortcut .activated .connect (self .user_did_something )
8282
83- jumpleft_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Ctrl+Left" ), self )
83+ jumpleft_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Ctrl+Left" ), self )
8484 jumpleft_shortcut .activated .connect (partial (self .move_n_frames , - cfg .control_arrow_jump ))
8585 jumpleft_shortcut .activated .connect (self .user_did_something )
8686
87- jumpright_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Ctrl+Right" ), self )
87+ jumpright_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Ctrl+Right" ), self )
8888 jumpright_shortcut .activated .connect (partial (self .move_n_frames , cfg .control_arrow_jump ))
8989 jumpright_shortcut .activated .connect (self .user_did_something )
9090
9191 self .ui .actionSave_Project .triggered .connect (self .save )
92- save_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Ctrl+S" ), self )
92+ save_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Ctrl+S" ), self )
9393 save_shortcut .activated .connect (self .save )
94- finalize_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Ctrl+F" ), self )
94+ finalize_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Ctrl+F" ), self )
9595 finalize_shortcut .activated .connect (self .finalize )
96- open_shortcut = QtWidgets .QShortcut (QtGui .QKeySequence ("Ctrl+O" ), self )
96+ open_shortcut = QtGui .QShortcut (QtGui .QKeySequence ("Ctrl+O" ), self )
9797 open_shortcut .activated .connect (self .load_project )
9898 self .ui .finalize_labels .clicked .connect (self .finalize )
9999 self .ui .exportPredictions .clicked .connect (self .export_predictions )
@@ -109,7 +109,7 @@ def __init__(self, cfg: DictConfig):
109109 self .latent_name = None
110110 self .thresholds = None
111111 for i in range (10 ):
112- self .toggle_shortcuts .append (QtWidgets .QShortcut (QtGui .QKeySequence (str (i )), self ))
112+ self .toggle_shortcuts .append (QtGui .QShortcut (QtGui .QKeySequence (str (i )), self ))
113113 tmp_func = partial (self .respond_to_keypress , i )
114114 self .toggle_shortcuts [i ].activated .connect (tmp_func )
115115 self .toggle_shortcuts [i ].activated .connect (self .user_did_something )
@@ -394,7 +394,7 @@ def generate_featureextractor_inference_args(self):
394394 keys .append (key )
395395 no_outputs .append (record ["output" ] is None )
396396 form = ShouldRunInference (keys , no_outputs )
397- ret = form .exec_ ()
397+ ret = form .exec ()
398398 if not ret :
399399 return
400400 should_infer = form .get_outputs ()
@@ -518,7 +518,7 @@ def generate_sequence_inference_args(self):
518518 if has_latents [i ]:
519519 keys_with_features .append (key )
520520 form = ShouldRunInference (keys_with_features , no_sequence_outputs )
521- ret = form .exec_ ()
521+ ret = form .exec ()
522522 if not ret :
523523 return
524524 should_infer = form .get_outputs ()
@@ -617,7 +617,7 @@ def run_overnight(self):
617617
618618 def _new_project (self ):
619619 form = CreateProject ()
620- ret = form .exec_ ()
620+ ret = form .exec ()
621621 if not ret :
622622 return
623623 project_name = form .project_box .text ()
@@ -1183,7 +1183,7 @@ def run() -> None:
11831183 window .resize (1024 , 768 )
11841184 window .show ()
11851185
1186- sys .exit (app .exec_ ())
1186+ sys .exit (app .exec ())
11871187
11881188
11891189def entry () -> None :
0 commit comments