{"action":"created","comment":{"url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/comments/138733272","pull_request_review_id":62569419,"id":138733272,"diff_hunk":"@@ -0,0 +1,109 @@\n+from __future__ import division\n+\n+import itertools\n+import numpy as np\n+\n+from iou import cc_iou as iou\n+\n+\n+def score_craters_on_patch(y_true, y_pred):\n+    \"\"\"\n+    Main score\n+\n+    Parameters\n+    ----------\n+    y_true : list of tuples (x, y, radius)\n+        List of coordinates and radius of actual craters in a patch\n+    y_pred : list of tuples (x, y, radius)\n+        List of coordinates and radius of craters predicted in the patch\n+\n+    Returns\n+    -------\n+    float : score for a given path, the higher the better\n+\n+    \"\"\"\n+    y_true = np.atleast_2d(y_true).T\n+    y_pred = np.atleast_2d(y_pred).T\n+\n+    ospa_score = ospa(y_true, y_pred)\n+\n+    score = 1 - ospa_score\n+\n+    return score\n+\n+\n+def score_iou(y_true, y_pred):\n+    pass\n+\n+\n+def score_completeness(y_true, y_pred):\n+    pass\n+\n+\n+def ospa(x_arr, y_arr, p_norm=1, cut_off=1):\n+    \"\"\"\n+    Optimal Subpattern Assignment (OSPA) metric for IoU score\n+\n+    This metric provides a coherent way to compute the miss-distance\n+    between the detection and alignment of objects.\n+\n+    The lower the value the smaller the distance.\n+\n+    Parameters\n+    ----------\n+    x_arr, y_arr : ndarray of shape (3, x)\n+        arrays to compare","path":"workflow/scores.py","position":55,"original_position":55,"commit_id":"72fbed694b87256fc863d2848710409cbb7a7be2","original_commit_id":"72fbed694b87256fc863d2848710409cbb7a7be2","user":{"login":"jorisvandenbossche","id":1020496,"avatar_url":"https://avatars2.githubusercontent.com/u/1020496?v=4","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"body":"arrays of x, y, radius","created_at":"2017-09-13T20:41:04Z","updated_at":"2017-09-13T21:01:15Z","html_url":"https://github.com/ramp-kits/mars_craters/pull/5#discussion_r138733272","pull_request_url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/comments/138733272"},"html":{"href":"https://github.com/ramp-kits/mars_craters/pull/5#discussion_r138733272"},"pull_request":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5","id":140870456,"html_url":"https://github.com/ramp-kits/mars_craters/pull/5","diff_url":"https://github.com/ramp-kits/mars_craters/pull/5.diff","patch_url":"https://github.com/ramp-kits/mars_craters/pull/5.patch","issue_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues/5","number":5,"state":"open","locked":false,"title":"[MRG] Add OSPA metric to score the crater detection","user":{"login":"aboucaud","id":3065310,"avatar_url":"https://avatars0.githubusercontent.com/u/3065310?v=4","gravatar_id":"","url":"https://api.github.com/users/aboucaud","html_url":"https://github.com/aboucaud","followers_url":"https://api.github.com/users/aboucaud/followers","following_url":"https://api.github.com/users/aboucaud/following{/other_user}","gists_url":"https://api.github.com/users/aboucaud/gists{/gist_id}","starred_url":"https://api.github.com/users/aboucaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboucaud/subscriptions","organizations_url":"https://api.github.com/users/aboucaud/orgs","repos_url":"https://api.github.com/users/aboucaud/repos","events_url":"https://api.github.com/users/aboucaud/events{/privacy}","received_events_url":"https://api.github.com/users/aboucaud/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-09-13T16:17:15Z","updated_at":"2017-09-13T21:01:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94a793b1bec52f3a173db5d8206e1c8bbd44ab1d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5/commits","review_comments_url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5/comments","review_comment_url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues/5/comments","statuses_url":"https://api.github.com/repos/ramp-kits/mars_craters/statuses/72fbed694b87256fc863d2848710409cbb7a7be2","head":{"label":"ramp-kits:ospa_score","ref":"ospa_score","sha":"72fbed694b87256fc863d2848710409cbb7a7be2","user":{"login":"ramp-kits","id":28395705,"avatar_url":"https://avatars0.githubusercontent.com/u/28395705?v=4","gravatar_id":"","url":"https://api.github.com/users/ramp-kits","html_url":"https://github.com/ramp-kits","followers_url":"https://api.github.com/users/ramp-kits/followers","following_url":"https://api.github.com/users/ramp-kits/following{/other_user}","gists_url":"https://api.github.com/users/ramp-kits/gists{/gist_id}","starred_url":"https://api.github.com/users/ramp-kits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramp-kits/subscriptions","organizations_url":"https://api.github.com/users/ramp-kits/orgs","repos_url":"https://api.github.com/users/ramp-kits/repos","events_url":"https://api.github.com/users/ramp-kits/events{/privacy}","received_events_url":"https://api.github.com/users/ramp-kits/received_events","type":"Organization","site_admin":false},"repo":{"id":99251278,"name":"mars_craters","full_name":"ramp-kits/mars_craters","owner":{"login":"ramp-kits","id":28395705,"avatar_url":"https://avatars0.githubusercontent.com/u/28395705?v=4","gravatar_id":"","url":"https://api.github.com/users/ramp-kits","html_url":"https://github.com/ramp-kits","followers_url":"https://api.github.com/users/ramp-kits/followers","following_url":"https://api.github.com/users/ramp-kits/following{/other_user}","gists_url":"https://api.github.com/users/ramp-kits/gists{/gist_id}","starred_url":"https://api.github.com/users/ramp-kits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramp-kits/subscriptions","organizations_url":"https://api.github.com/users/ramp-kits/orgs","repos_url":"https://api.github.com/users/ramp-kits/repos","events_url":"https://api.github.com/users/ramp-kits/events{/privacy}","received_events_url":"https://api.github.com/users/ramp-kits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ramp-kits/mars_craters","description":"Mars craters detection and classification RAMP starting kit","fork":false,"url":"https://api.github.com/repos/ramp-kits/mars_craters","forks_url":"https://api.github.com/repos/ramp-kits/mars_craters/forks","keys_url":"https://api.github.com/repos/ramp-kits/mars_craters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ramp-kits/mars_craters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ramp-kits/mars_craters/teams","hooks_url":"https://api.github.com/repos/ramp-kits/mars_craters/hooks","issue_events_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues/events{/number}","events_url":"https://api.github.com/repos/ramp-kits/mars_craters/events","assignees_url":"https://api.github.com/repos/ramp-kits/mars_craters/assignees{/user}","branches_url":"https://api.github.com/repos/ramp-kits/mars_craters/branches{/branch}","tags_url":"https://api.github.com/repos/ramp-kits/mars_craters/tags","blobs_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/refs{/sha}","trees_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ramp-kits/mars_craters/statuses/{sha}","languages_url":"https://api.github.com/repos/ramp-kits/mars_craters/languages","stargazers_url":"https://api.github.com/repos/ramp-kits/mars_craters/stargazers","contributors_url":"https://api.github.com/repos/ramp-kits/mars_craters/contributors","subscribers_url":"https://api.github.com/repos/ramp-kits/mars_craters/subscribers","subscription_url":"https://api.github.com/repos/ramp-kits/mars_craters/subscription","commits_url":"https://api.github.com/repos/ramp-kits/mars_craters/commits{/sha}","git_commits_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/commits{/sha}","comments_url":"https://api.github.com/repos/ramp-kits/mars_craters/comments{/number}","issue_comment_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues/comments{/number}","contents_url":"https://api.github.com/repos/ramp-kits/mars_craters/contents/{+path}","compare_url":"https://api.github.com/repos/ramp-kits/mars_craters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ramp-kits/mars_craters/merges","archive_url":"https://api.github.com/repos/ramp-kits/mars_craters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ramp-kits/mars_craters/downloads","issues_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues{/number}","pulls_url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls{/number}","milestones_url":"https://api.github.com/repos/ramp-kits/mars_craters/milestones{/number}","notifications_url":"https://api.github.com/repos/ramp-kits/mars_craters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ramp-kits/mars_craters/labels{/name}","releases_url":"https://api.github.com/repos/ramp-kits/mars_craters/releases{/id}","deployments_url":"https://api.github.com/repos/ramp-kits/mars_craters/deployments","created_at":"2017-08-03T16:05:45Z","updated_at":"2017-08-03T16:12:49Z","pushed_at":"2017-09-13T20:21:57Z","git_url":"git://github.com/ramp-kits/mars_craters.git","ssh_url":"git@github.com:ramp-kits/mars_craters.git","clone_url":"https://github.com/ramp-kits/mars_craters.git","svn_url":"https://github.com/ramp-kits/mars_craters","homepage":null,"size":51,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"ramp-kits:master","ref":"master","sha":"84e8e39d5a26debecbddbbd5cf3e69a977f9aff9","user":{"login":"ramp-kits","id":28395705,"avatar_url":"https://avatars0.githubusercontent.com/u/28395705?v=4","gravatar_id":"","url":"https://api.github.com/users/ramp-kits","html_url":"https://github.com/ramp-kits","followers_url":"https://api.github.com/users/ramp-kits/followers","following_url":"https://api.github.com/users/ramp-kits/following{/other_user}","gists_url":"https://api.github.com/users/ramp-kits/gists{/gist_id}","starred_url":"https://api.github.com/users/ramp-kits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramp-kits/subscriptions","organizations_url":"https://api.github.com/users/ramp-kits/orgs","repos_url":"https://api.github.com/users/ramp-kits/repos","events_url":"https://api.github.com/users/ramp-kits/events{/privacy}","received_events_url":"https://api.github.com/users/ramp-kits/received_events","type":"Organization","site_admin":false},"repo":{"id":99251278,"name":"mars_craters","full_name":"ramp-kits/mars_craters","owner":{"login":"ramp-kits","id":28395705,"avatar_url":"https://avatars0.githubusercontent.com/u/28395705?v=4","gravatar_id":"","url":"https://api.github.com/users/ramp-kits","html_url":"https://github.com/ramp-kits","followers_url":"https://api.github.com/users/ramp-kits/followers","following_url":"https://api.github.com/users/ramp-kits/following{/other_user}","gists_url":"https://api.github.com/users/ramp-kits/gists{/gist_id}","starred_url":"https://api.github.com/users/ramp-kits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramp-kits/subscriptions","organizations_url":"https://api.github.com/users/ramp-kits/orgs","repos_url":"https://api.github.com/users/ramp-kits/repos","events_url":"https://api.github.com/users/ramp-kits/events{/privacy}","received_events_url":"https://api.github.com/users/ramp-kits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ramp-kits/mars_craters","description":"Mars craters detection and classification RAMP starting kit","fork":false,"url":"https://api.github.com/repos/ramp-kits/mars_craters","forks_url":"https://api.github.com/repos/ramp-kits/mars_craters/forks","keys_url":"https://api.github.com/repos/ramp-kits/mars_craters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ramp-kits/mars_craters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ramp-kits/mars_craters/teams","hooks_url":"https://api.github.com/repos/ramp-kits/mars_craters/hooks","issue_events_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues/events{/number}","events_url":"https://api.github.com/repos/ramp-kits/mars_craters/events","assignees_url":"https://api.github.com/repos/ramp-kits/mars_craters/assignees{/user}","branches_url":"https://api.github.com/repos/ramp-kits/mars_craters/branches{/branch}","tags_url":"https://api.github.com/repos/ramp-kits/mars_craters/tags","blobs_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/refs{/sha}","trees_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ramp-kits/mars_craters/statuses/{sha}","languages_url":"https://api.github.com/repos/ramp-kits/mars_craters/languages","stargazers_url":"https://api.github.com/repos/ramp-kits/mars_craters/stargazers","contributors_url":"https://api.github.com/repos/ramp-kits/mars_craters/contributors","subscribers_url":"https://api.github.com/repos/ramp-kits/mars_craters/subscribers","subscription_url":"https://api.github.com/repos/ramp-kits/mars_craters/subscription","commits_url":"https://api.github.com/repos/ramp-kits/mars_craters/commits{/sha}","git_commits_url":"https://api.github.com/repos/ramp-kits/mars_craters/git/commits{/sha}","comments_url":"https://api.github.com/repos/ramp-kits/mars_craters/comments{/number}","issue_comment_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues/comments{/number}","contents_url":"https://api.github.com/repos/ramp-kits/mars_craters/contents/{+path}","compare_url":"https://api.github.com/repos/ramp-kits/mars_craters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ramp-kits/mars_craters/merges","archive_url":"https://api.github.com/repos/ramp-kits/mars_craters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ramp-kits/mars_craters/downloads","issues_url":"https://api.github.com/repos/ramp-kits/mars_craters/issues{/number}","pulls_url":"https://api.github.com/repos/ramp-kits/mars_craters/pulls{/number}","milestones_url":"https://api.github.com/repos/ramp-kits/mars_craters/milestones{/number}","notifications_url":"https://api.github.com/repos/ramp-kits/mars_craters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ramp-kits/mars_craters/labels{/name}","releases_url":"https://api.github.com/repos/ramp-kits/mars_craters/releases{/id}","deployments_url":"https://api.github.com/repos/ramp-kits/mars_craters/deployments","created_at":"2017-08-03T16:05:45Z","updated_at":"2017-08-03T16:12:49Z","pushed_at":"2017-09-13T20:21:57Z","git_url":"git://github.com/ramp-kits/mars_craters.git","ssh_url":"git@github.com:ramp-kits/mars_craters.git","clone_url":"https://github.com/ramp-kits/mars_craters.git","svn_url":"https://github.com/ramp-kits/mars_craters","homepage":null,"size":51,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5"},"html":{"href":"https://github.com/ramp-kits/mars_craters/pull/5"},"issue":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/issues/5"},"comments":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/ramp-kits/mars_craters/statuses/72fbed694b87256fc863d2848710409cbb7a7be2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jorisvandenbossche"}}