Visitar URL original
merge `main` into `pytorch_dlc` by n-poulsen · Pull Request #2731 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed file dialog not showing uppercase file extension video files (#…
…2645)

* fixed file dialog not showing uppercase file extension video files

* bug fix: no shuffle_change slot in main window

* bug fix

---------

Co-authored-by: Niels Poulsen <niels.poulsen@epfl.ch>
Co-authored-by: Mackenzie Mathis <mathis@rowland.harvard.edu>
  • Loading branch information
3 people authored Jul 5, 2024
commit 9e9d677832a148f2dd19b313b9fd976413f4e271
16 changes: 12 additions & 4 deletions deeplabcut/gui/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os

from PySide6 import QtWidgets
from PySide6.QtCore import Qt
from PySide6.QtCore import Qt, Slot
from deeplabcut.gui.dlc_params import DLCParams
from deeplabcut.gui.widgets import ConfigEditor

Expand Down Expand Up @@ -54,7 +54,7 @@ def _create_grid_layout(
alignment=None,
spacing: int = 20,
margins: tuple = None,
) -> QtWidgets.QGridLayout():
) -> QtWidgets.QGridLayout:
layout = QtWidgets.QGridLayout()
layout.setAlignment(Qt.AlignLeft | Qt.AlignTop)
layout.setSpacing(spacing)
Expand Down Expand Up @@ -155,11 +155,19 @@ def _update_video_selection(self, videopaths):

def select_videos(self):
cwd = self.root.project_folder

# Create a filter string with both lowercase and uppercase extensions

video_types = [f"*.{ext.lower()}" for ext in DLCParams.VIDEOTYPES[1:]] + [
f"*.{ext.upper()}" for ext in DLCParams.VIDEOTYPES[1:]
]
video_files = f"Videos ({' '.join(video_types)})"

filenames = QtWidgets.QFileDialog.getOpenFileNames(
self,
"Select video(s) to analyze",
cwd,
f"Videos ({' *.'.join(DLCParams.VIDEOTYPES)[1:]})",
video_files,
)

if filenames[0]:
Expand Down Expand Up @@ -190,7 +198,7 @@ def __init__(self, root, parent):
self.root = root
self.parent = parent

self.setMaximum(100)
self.setMaximum(10_000)
self.setValue(self.root.shuffle_value)
self.valueChanged.connect(self.root.update_shuffle)

Expand Down