-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Moved pfm file reading into dataset utils #6270
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
Conversation
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.
Thanks @TeodorPoncu , LGTM. The only important comment I have is to keep it private as suggested below
torchvision/datasets/utils.py
Outdated
@@ -483,3 +484,39 @@ def verify_str_arg( | |||
raise ValueError(msg) | |||
|
|||
return value | |||
|
|||
|
|||
def read_pfm(file_name: str, slice_channels: int = 2) -> np.ndarray: |
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.
Let's keep it private, we don't really need to expose it to users
def read_pfm(file_name: str, slice_channels: int = 2) -> np.ndarray: | |
def _read_pfm(file_name: str, slice_channels: int = 2) -> np.ndarray: |
torchvision/datasets/utils.py
Outdated
|
||
|
||
def read_pfm(file_name: str, slice_channels: int = 2) -> np.ndarray: | ||
"""Read file in .pfm format. Might contain |
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.
Looks like this sentence is unfinished?
torchvision/datasets/utils.py
Outdated
Args: | ||
file_name (str): Path to the file. | ||
slice_channels (int): Number of channels to slice out of the file. | ||
Useful for reading different data formats stored in .pfm files: Optical Flows, Stereo Disparity Maps, etc. |
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.
Skipping a line in a parameter description requires to indent it to the right (otherwise sphinx doesn't render it properly):
Useful for reading different data formats stored in .pfm files: Optical Flows, Stereo Disparity Maps, etc. | |
Useful for reading different data formats stored in .pfm files: Optical Flows, Stereo Disparity Maps, etc. |
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.
Thanks @TeodorPoncu ! LGTM when CI is happy
Hey @TeodorPoncu! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Summary: * Moved pfm file reading into dataset utils * Made _read_pfm private. Fixed doc format issues. Reviewed By: jdsgomes Differential Revision: D37993417 fbshipit-source-id: 15d10ac7dc6a22397ba317b7d7728ba707e812a9
Addresses #6259 functionality redefinition both in _optical_flow.py and _stereo_matching.py datasets.