-
Notifications
You must be signed in to change notification settings - Fork 11
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
Grayscale property passthrough #99
Changes from 1 commit
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 | ||||
---|---|---|---|---|---|---|
|
@@ -122,3 +122,12 @@ def test_video_replace_filename( | |||||
video.replace_filename(centered_pair_frame_paths) | ||||||
assert type(video.backend) == ImageVideo | ||||||
assert video.exists(check_all=True) is True | ||||||
|
||||||
|
||||||
def test_grayscale(centered_pair_low_quality_path): | ||||||
video = Video.from_filename(centered_pair_low_quality_path) | ||||||
assert video.grayscale == True | ||||||
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. Optimize boolean check. Avoid direct equality comparisons to - assert video.grayscale == True
+ assert video.grayscale Committable suggestion
Suggested change
ToolsRuff
|
||||||
assert video.shape[-1] == 1 | ||||||
|
||||||
video.grayscale = False | ||||||
assert video.shape[-1] == 3 | ||||||
Comment on lines
+127
to
+133
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 proper boolean checks and optimize the test function. The test for the - assert video.grayscale == True
+ assert video.grayscale Additionally, consider adding assertions to ensure that the
ToolsRuff
|
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.
Refine the implementation of
img_shape
property.The method to determine the
img_shape
based on thegrayscale
property is overly complex and can be simplified. Additionally, this method should not directly read a frame to determine the shape; it should utilize cached values to improve efficiency.Tools
Ruff