Skip to content
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

Brightness, Sharpness, Constrast, Color at magnitude 0 should have v=1? #24

Open
A-Telfer opened this issue Feb 8, 2021 · 0 comments
Open

Comments

@A-Telfer
Copy link

A-Telfer commented Feb 8, 2021

It seems like some of the PIL functions are not centered? This would likely impact results by causing lower magnitudes to lead to higher distortions

ie. here's a function that appears centered

def Rotate(img, v):  # [-30, 30]  NOTE: should this be [0, 30]?
    assert -30 <= v <= 30 
    if random.random() > 0.5:
        v = -v 
    return img.rotate(v)

vs the color function that is not centered

def Color(img, v):  # [0.1,1.9]
    assert 0.1 <= v <= 1.9
    return PIL.ImageEnhance.Color(img).enhance(v)

instead, perhaps it should be this?

def Color(img, v):  # [0,0.9]
    assert 0 <= v <= 0.9
    if random.random() > 0.5:
        v = -v
    return PIL.ImageEnhance.Color(img).enhance(1+v)

Thanks for sharing this repo! It's very readable :)

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

No branches or pull requests

1 participant