-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate the video name and its filepath columns in VideoTablesModel
#2052
Changes from 2 commits
ac6da50
788e8bc
a92fc2d
2ea89bb
e03be7e
8cac64c
1fa5f02
8e6b947
22dd69e
8db81a9
7529acc
9d747cb
d38c0c4
946082d
7044c21
d158633
69b6273
5b1b7e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -465,6 +465,11 @@ def dtype(self): | |
"""See :class:`Video`.""" | ||
return self.test_frame.dtype | ||
|
||
@property | ||
def name(self): | ||
"""Return the name of the video.""" | ||
return os.path.basename(self.filename) | ||
|
||
def reset(self, filename: str = None, grayscale: bool = None, bgr: bool = None): | ||
"""Reloads the video.""" | ||
if filename is not None: | ||
|
@@ -944,6 +949,11 @@ def dtype(self): | |
"""See :class:`Video`.""" | ||
return self.cache_.dtype | ||
|
||
@property | ||
def name(self): | ||
"""Name of the video.""" | ||
return os.path.basename(self.filename) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure In Consider modifying the def reset(
self,
filename: str = None,
filenames: List[str] = None,
height_: int = None,
width_: int = None,
channels_: int = None,
grayscale: bool = None,
):
"""Reloads the video."""
if filename and filenames:
raise ValueError(
f"Cannot specify both filename and filenames for SingleImageVideo."
)
elif filename or filenames:
self.cache_ = dict()
self.test_frame_ = None
self.height_ = height_
self.width_ = width_
self.channels_ = channels_
if not filename and filenames:
self.filenames = filenames
self.filename = filenames[0]
elif filename and not filenames:
self.filename = filename
self.filenames = [filename]
+ else:
+ raise ValueError("Either filename or filenames must be specified.")
|
||
def reset( | ||
self, | ||
filename: str = None, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use setter method to update model properties
Directly assigning
model.show_video_name = self.show_video_name
does not update the model's properties or refresh the layout. Instead, you should use theset_show_video_name
method to ensure the model updates correctly.Apply this diff to fix the issue:
📝 Committable suggestion