{"action":"opened","issue":{"url":"https://api.github.com/repos/aleju/imgaug/issues/97","repository_url":"https://api.github.com/repos/aleju/imgaug","labels_url":"https://api.github.com/repos/aleju/imgaug/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/aleju/imgaug/issues/97/comments","events_url":"https://api.github.com/repos/aleju/imgaug/issues/97/events","html_url":"https://github.com/aleju/imgaug/issues/97","id":295736005,"number":97,"title":"Activator hook doesn't filter out \"Sometimes\"-type lambdas","user":{"login":"kevinmandich","id":8010735,"avatar_url":"https://avatars1.githubusercontent.com/u/8010735?v=4","gravatar_id":"","url":"https://api.github.com/users/kevinmandich","html_url":"https://github.com/kevinmandich","followers_url":"https://api.github.com/users/kevinmandich/followers","following_url":"https://api.github.com/users/kevinmandich/following{/other_user}","gists_url":"https://api.github.com/users/kevinmandich/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmandich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmandich/subscriptions","organizations_url":"https://api.github.com/users/kevinmandich/orgs","repos_url":"https://api.github.com/users/kevinmandich/repos","events_url":"https://api.github.com/users/kevinmandich/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmandich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-09T02:37:40Z","updated_at":"2018-02-09T02:37:40Z","closed_at":null,"author_association":"NONE","body":"I was toying around with the hooks example:\r\n\r\n```\r\nsometimes = lambda aug: iaa.Sometimes(0.5, aug)\r\n\r\nseq = iaa.Sequential(\r\n    [\r\n        iaa.Fliplr(0.5),\r\n        sometimes(iaa.GaussianBlur((0, 3.0))),\r\n        sometimes(iaa.AverageBlur(k=(2, 7))),\r\n        sometimes(iaa.MedianBlur(k=(3, 11))),\r\n        sometimes(iaa.Sharpen(alpha=(0, 1.0), lightness=(0.75, 1.5))),\r\n        sometimes(iaa.Emboss(alpha=(0, 1.0), strength=(0, 2.0))),\r\n        sometimes(iaa.EdgeDetect(alpha=(0, 0.7))),\r\n    ],\r\n    random_order=True\r\n)\r\n\r\ndef activator_annotations(images, augmenter, parents, default):\r\n    if augmenter.name in ['GaussianBlur', 'AverageBlur', 'MedianBlur', 'EdgeDetect']:\r\n        return False\r\n    else:\r\n        return default\r\n\r\nannotation_hook = ia.HooksImages(activator=activator_annotations)\r\nseq_det = seq.to_deterministic()\r\n\r\nraw_aug = seq_det.augment_images(raw_ex_img)\r\nanno_aug = seq_det.augment_image(anno_ex_img, hooks=annotation_hook)\r\n```\r\n\r\nI apply some augmentations to the raw image. I then want to apply the same augmentations, minus those specified in `activator_annotations`, to the annotation image. However, I think the `sometimes` lambda is preventing this. Is there a way around this?"}}
{"actor":{"display_login":"kevinmandich"}}