Skip to content

Commit

Permalink
add corruption category option to get_corruption_names
Browse files Browse the repository at this point in the history
  • Loading branch information
normster committed Nov 29, 2020
1 parent 4bd4cda commit 501c517
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 501c517

Please sign in to comment.