Skip to content

Commit

Permalink
Merge pull request #16 from normster/master
Browse files Browse the repository at this point in the history
add corruption category option to get_corruption_names
  • Loading branch information
Hvitgar authored Dec 3, 2020
2 parents 4bd4cda + 501c517 commit 89b6c41
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions imagecorruptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,13 @@ def get_corruption_names(subset='common'):
return [f.__name__ for f in corruption_tuple[15:]]
elif subset == 'all':
return [f.__name__ for f in corruption_tuple]
elif subset == 'noise':
return [f.__name__ for f in corruption_tuple[0:3]]
elif subset == 'blur':
return [f.__name__ for f in corruption_tuple[3:7]]
elif subset == 'weather':
return [f.__name__ for f in corruption_tuple[7:11]]
elif subset == 'digital':
return [f.__name__ for f in corruption_tuple[11:15]]
else:
raise ValueError("subset must be one of ['common', 'validation', 'all']")

0 comments on commit 89b6c41

Please sign in to comment.