Skip to content

Conversation

vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented Feb 12, 2018

Addresses issue #414

Copy link
Member

@fmassa fmassa left a 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?


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.

@@ -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.

"""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.

@vfdev-5
Copy link
Collaborator Author

vfdev-5 commented Feb 12, 2018

@fmassa I fixed the documentation as you suggested.
What do you think, also about to factorize the code:

class RandomSomething(object):
    """
    Args:
        p (float): probability of the image being flipped. Default value is 0.5
    """
    def __init__(self, p=0.5):
        self.p = p

as it is present in RandomHorizontalFlip, RandomVerticalFlip and RandomGrayscale ?

@fmassa
Copy link
Member

fmassa commented Feb 12, 2018

@vfdev-5 we could have a common class to handle that, we would lose the docstrings in this case (which are all slightly different).
I think we can leave it like this for the moment.

@fmassa fmassa merged commit 5985869 into pytorch:master Feb 12, 2018
@vfdev-5 vfdev-5 deleted the feature_random_flip branch February 12, 2018 10:46
rajveerb pushed a commit to rajveerb/vision that referenced this pull request Nov 30, 2023
* [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants