Add support for multiple files

This commit is contained in:
Kristóf Tóth 2018-02-24 20:41:57 +01:00
parent 7769250b15
commit 6f0fb68e2b

View File

@ -48,4 +48,9 @@ if __name__ == '__main__':
ap.add_argument('images', type=str, nargs='+', help='')
args = ap.parse_args()
print(imgrate(args.images[0]).laplacian)
ratings = {image: imgrate(image).laplacian for image in args.images}
maximum = max(ratings, key=ratings.get)
for rating in ratings.keys():
maxmark = '*' if rating == maximum and len(ratings) > 1 else ' '
print('{}imgrate("{}") = {}'.format(maxmark, rating, ratings[rating]))