-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Probability parameter in RandomHorizontalFlip, RandomHorizontalFlip #417
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
…d RandomHorizontalFlip (pytorch#414)
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.
This looks generally good, thanks for the quick PR!
I have a few minor comments, could you please look into addressing those?
torchvision/transforms/transforms.py
Outdated
|
||
def __call__(self, img): | ||
""" | ||
Args: | ||
img (PIL Image): Image to be flipped. | ||
proba (float): probability of image is flipped. Default value is 0.5 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torchvision/transforms/transforms.py
Outdated
@@ -321,7 +321,14 @@ def __repr__(self): | |||
|
|||
|
|||
class RandomHorizontalFlip(object): | |||
"""Horizontally flip the given PIL Image randomly with a probability of 0.5.""" | |||
"""Horizontally flip the given PIL Image randomly with a probability. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torchvision/transforms/transforms.py
Outdated
"""Horizontally flip the given PIL Image randomly with a probability. | ||
|
||
Args: | ||
p (float): probability of image is flipped. Default value is 0.5 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@fmassa I fixed the documentation as you suggested.
as it is present in RandomHorizontalFlip, RandomVerticalFlip and RandomGrayscale ? |
@vfdev-5 we could have a common class to handle that, we would lose the docstrings in this case (which are all slightly different). |
* [SSD] get default local rank from env variable Setting default --local-rank to os.getenv('LOCAL_RANK', 0) makes launching multi-gpu/multi-node jobs easier * [SSD] Option to load pretrained weights from file Add the option to load pretrained weights from a local file with `--pretrained-backbone <PATH>`. Updated README with pretrained weights information and download scripts
Addresses issue #414