{"action":"created","comment":{"url":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/comments/79944522","id":79944522,"diff_hunk":"@@ -33,3 +35,17 @@ def _augment(self, img, noise):\n         if self.clip:\n             ret = np.clip(ret, 0, 255)\n         return ret\n+\n+class SaltPepperNoise(ImageAugmentor):\n+    def __init__(self, amount=0.05, s_vs_p=0.5):\n+        super(SaltPepperNoise, self).__init__()\n+        self._init(locals())\n+\n+    def _get_augment_params(self, img):\n+        return self.rng.uniform(low=0, high=1, size=img.shape)\n+\n+    def _augment(self, img, param):\n+        ret = img.copy()","path":"tensorpack/dataflow/imgaug/noise.py","position":30,"original_position":30,"commit_id":"5dc8b65cbbaa3bd89eaebe3d2909c494e8c7ec59","original_commit_id":"5dc8b65cbbaa3bd89eaebe3d2909c494e8c7ec59","user":{"login":"ppwwyyxx","id":1381301,"avatar_url":"https://avatars.githubusercontent.com/u/1381301?v=3","gravatar_id":"","url":"https://api.github.com/users/ppwwyyxx","html_url":"https://github.com/ppwwyyxx","followers_url":"https://api.github.com/users/ppwwyyxx/followers","following_url":"https://api.github.com/users/ppwwyyxx/following{/other_user}","gists_url":"https://api.github.com/users/ppwwyyxx/gists{/gist_id}","starred_url":"https://api.github.com/users/ppwwyyxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppwwyyxx/subscriptions","organizations_url":"https://api.github.com/users/ppwwyyxx/orgs","repos_url":"https://api.github.com/users/ppwwyyxx/repos","events_url":"https://api.github.com/users/ppwwyyxx/events{/privacy}","received_events_url":"https://api.github.com/users/ppwwyyxx/received_events","type":"User","site_admin":false},"body":"The current contract is that augmentors are allowed to modify the image in-place to be efficient. In that case the lowest-level dataflow should avoid its data being damaged by augmentors (by yielding a copy, see `dataset/cifar.py`).","created_at":"2016-09-21T22:12:09Z","updated_at":"2016-09-21T22:12:09Z","html_url":"https://github.com/ppwwyyxx/tensorpack/pull/24#discussion_r79944522","pull_request_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/comments/79944522"},"html":{"href":"https://github.com/ppwwyyxx/tensorpack/pull/24#discussion_r79944522"},"pull_request":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24","id":86249452,"html_url":"https://github.com/ppwwyyxx/tensorpack/pull/24","diff_url":"https://github.com/ppwwyyxx/tensorpack/pull/24.diff","patch_url":"https://github.com/ppwwyyxx/tensorpack/pull/24.patch","issue_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/24","number":24,"state":"open","locked":false,"title":"Minor bugfix imgaug","user":{"login":"sujaynarumanchi","id":8192279,"avatar_url":"https://avatars.githubusercontent.com/u/8192279?v=3","gravatar_id":"","url":"https://api.github.com/users/sujaynarumanchi","html_url":"https://github.com/sujaynarumanchi","followers_url":"https://api.github.com/users/sujaynarumanchi/followers","following_url":"https://api.github.com/users/sujaynarumanchi/following{/other_user}","gists_url":"https://api.github.com/users/sujaynarumanchi/gists{/gist_id}","starred_url":"https://api.github.com/users/sujaynarumanchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujaynarumanchi/subscriptions","organizations_url":"https://api.github.com/users/sujaynarumanchi/orgs","repos_url":"https://api.github.com/users/sujaynarumanchi/repos","events_url":"https://api.github.com/users/sujaynarumanchi/events{/privacy}","received_events_url":"https://api.github.com/users/sujaynarumanchi/received_events","type":"User","site_admin":false},"body":"Fix #23 \r\n\r\n- [x] Add salt and pepper noise","created_at":"2016-09-21T22:01:21Z","updated_at":"2016-09-21T22:12:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"816121215a87bddccc4960bae2baa3779a4819d8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24/commits","review_comments_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24/comments","review_comment_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/24/comments","statuses_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/statuses/5dc8b65cbbaa3bd89eaebe3d2909c494e8c7ec59","head":{"label":"sujaynarumanchi:minor-bugfix-imgaug","ref":"minor-bugfix-imgaug","sha":"5dc8b65cbbaa3bd89eaebe3d2909c494e8c7ec59","user":{"login":"sujaynarumanchi","id":8192279,"avatar_url":"https://avatars.githubusercontent.com/u/8192279?v=3","gravatar_id":"","url":"https://api.github.com/users/sujaynarumanchi","html_url":"https://github.com/sujaynarumanchi","followers_url":"https://api.github.com/users/sujaynarumanchi/followers","following_url":"https://api.github.com/users/sujaynarumanchi/following{/other_user}","gists_url":"https://api.github.com/users/sujaynarumanchi/gists{/gist_id}","starred_url":"https://api.github.com/users/sujaynarumanchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujaynarumanchi/subscriptions","organizations_url":"https://api.github.com/users/sujaynarumanchi/orgs","repos_url":"https://api.github.com/users/sujaynarumanchi/repos","events_url":"https://api.github.com/users/sujaynarumanchi/events{/privacy}","received_events_url":"https://api.github.com/users/sujaynarumanchi/received_events","type":"User","site_admin":false},"repo":{"id":68637301,"name":"tensorpack","full_name":"sujaynarumanchi/tensorpack","owner":{"login":"sujaynarumanchi","id":8192279,"avatar_url":"https://avatars.githubusercontent.com/u/8192279?v=3","gravatar_id":"","url":"https://api.github.com/users/sujaynarumanchi","html_url":"https://github.com/sujaynarumanchi","followers_url":"https://api.github.com/users/sujaynarumanchi/followers","following_url":"https://api.github.com/users/sujaynarumanchi/following{/other_user}","gists_url":"https://api.github.com/users/sujaynarumanchi/gists{/gist_id}","starred_url":"https://api.github.com/users/sujaynarumanchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujaynarumanchi/subscriptions","organizations_url":"https://api.github.com/users/sujaynarumanchi/orgs","repos_url":"https://api.github.com/users/sujaynarumanchi/repos","events_url":"https://api.github.com/users/sujaynarumanchi/events{/privacy}","received_events_url":"https://api.github.com/users/sujaynarumanchi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sujaynarumanchi/tensorpack","description":"Neural Network Toolbox on TensorFlow","fork":true,"url":"https://api.github.com/repos/sujaynarumanchi/tensorpack","forks_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/forks","keys_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/teams","hooks_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/hooks","issue_events_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/issues/events{/number}","events_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/events","assignees_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/assignees{/user}","branches_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/branches{/branch}","tags_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/tags","blobs_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/statuses/{sha}","languages_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/languages","stargazers_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/stargazers","contributors_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/contributors","subscribers_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/subscribers","subscription_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/subscription","commits_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/contents/{+path}","compare_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/merges","archive_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/downloads","issues_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/issues{/number}","pulls_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/pulls{/number}","milestones_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/milestones{/number}","notifications_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/labels{/name}","releases_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/releases{/id}","deployments_url":"https://api.github.com/repos/sujaynarumanchi/tensorpack/deployments","created_at":"2016-09-19T19:09:32Z","updated_at":"2016-09-19T19:09:33Z","pushed_at":"2016-09-21T21:46:43Z","git_url":"git://github.com/sujaynarumanchi/tensorpack.git","ssh_url":"git@github.com:sujaynarumanchi/tensorpack.git","clone_url":"https://github.com/sujaynarumanchi/tensorpack.git","svn_url":"https://github.com/sujaynarumanchi/tensorpack","homepage":"","size":1290,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ppwwyyxx:master","ref":"master","sha":"de1a5acd6d3a93497370b87acc0cb9a2bfdb9633","user":{"login":"ppwwyyxx","id":1381301,"avatar_url":"https://avatars.githubusercontent.com/u/1381301?v=3","gravatar_id":"","url":"https://api.github.com/users/ppwwyyxx","html_url":"https://github.com/ppwwyyxx","followers_url":"https://api.github.com/users/ppwwyyxx/followers","following_url":"https://api.github.com/users/ppwwyyxx/following{/other_user}","gists_url":"https://api.github.com/users/ppwwyyxx/gists{/gist_id}","starred_url":"https://api.github.com/users/ppwwyyxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppwwyyxx/subscriptions","organizations_url":"https://api.github.com/users/ppwwyyxx/orgs","repos_url":"https://api.github.com/users/ppwwyyxx/repos","events_url":"https://api.github.com/users/ppwwyyxx/events{/privacy}","received_events_url":"https://api.github.com/users/ppwwyyxx/received_events","type":"User","site_admin":false},"repo":{"id":48593532,"name":"tensorpack","full_name":"ppwwyyxx/tensorpack","owner":{"login":"ppwwyyxx","id":1381301,"avatar_url":"https://avatars.githubusercontent.com/u/1381301?v=3","gravatar_id":"","url":"https://api.github.com/users/ppwwyyxx","html_url":"https://github.com/ppwwyyxx","followers_url":"https://api.github.com/users/ppwwyyxx/followers","following_url":"https://api.github.com/users/ppwwyyxx/following{/other_user}","gists_url":"https://api.github.com/users/ppwwyyxx/gists{/gist_id}","starred_url":"https://api.github.com/users/ppwwyyxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppwwyyxx/subscriptions","organizations_url":"https://api.github.com/users/ppwwyyxx/orgs","repos_url":"https://api.github.com/users/ppwwyyxx/repos","events_url":"https://api.github.com/users/ppwwyyxx/events{/privacy}","received_events_url":"https://api.github.com/users/ppwwyyxx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ppwwyyxx/tensorpack","description":"Neural Network Toolbox on TensorFlow","fork":false,"url":"https://api.github.com/repos/ppwwyyxx/tensorpack","forks_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/forks","keys_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/teams","hooks_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/hooks","issue_events_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/events{/number}","events_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/events","assignees_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/assignees{/user}","branches_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/branches{/branch}","tags_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/tags","blobs_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/statuses/{sha}","languages_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/languages","stargazers_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/stargazers","contributors_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/contributors","subscribers_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/subscribers","subscription_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/subscription","commits_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/contents/{+path}","compare_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/merges","archive_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/downloads","issues_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues{/number}","pulls_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls{/number}","milestones_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/milestones{/number}","notifications_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/labels{/name}","releases_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/releases{/id}","deployments_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/deployments","created_at":"2015-12-25T23:08:44Z","updated_at":"2016-09-21T14:33:27Z","pushed_at":"2016-09-21T22:01:21Z","git_url":"git://github.com/ppwwyyxx/tensorpack.git","ssh_url":"git@github.com:ppwwyyxx/tensorpack.git","clone_url":"https://github.com/ppwwyyxx/tensorpack.git","svn_url":"https://github.com/ppwwyyxx/tensorpack","homepage":"","size":1293,"stargazers_count":214,"watchers_count":214,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":11,"forks":46,"open_issues":11,"watchers":214,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24"},"html":{"href":"https://github.com/ppwwyyxx/tensorpack/pull/24"},"issue":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/24"},"comments":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/ppwwyyxx/tensorpack/statuses/5dc8b65cbbaa3bd89eaebe3d2909c494e8c7ec59"}}}}
{"actor":{"display_login":"ppwwyyxx"}}