{
  "id": 116992,
  "title": "RotationDistance metric implement compatible with official",
  "url": "/competitions/pku-autonomous-driving/discussion/116992",
  "author_name": "shiba",
  "post_date": "2019-11-12T17:24:35.290000",
  "votes": 5,
  "comment_count": 6,
  "views": 0,
  "content": "<p><a href=\"https://www.kaggle.com/greatgamedota/cv-util-functions\">https://www.kaggle.com/greatgamedota/cv-util-functions</a>,  this kernel has do lots of work for metric implement.So from official source code, i use C# code to test my python code.(If I'm wrong, please point out😃 )</p>\n\n<p>python code:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1dfd0b0bd897403e1549664bc10f5737%2F7UG5D4XF4RXDPV_NXBOT.png?generation=1573579143860822&amp;alt=media\" alt=\"\">\npython result:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2Fa207b0d68ede5a830b3369a926ab16d0%2F2SVOYVR4726ZPLZXRXI.png?generation=1573579177336071&amp;alt=media\" alt=\"\"></p>\n\n<p>C# code:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F30c2e3285c326355331de8b3d684efc2%2F1.png?generation=1573579765127561&amp;alt=media\" alt=\"\"></p>\n\n<p>C# result:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1194ee5509fb1867f0c195e227dacd81%2F2.png?generation=1573579778891173&amp;alt=media\" alt=\"\"></p>\n\n<p>Problem here: I don't know why there's a minus sign diff between C# q2inv &amp; python q2inv</p>",
  "messages": [
    {
      "id": 671429,
      "postDate": "2019-11-12T17:24:35.290Z",
      "content": "<p><a href=\"https://www.kaggle.com/greatgamedota/cv-util-functions\">https://www.kaggle.com/greatgamedota/cv-util-functions</a>,  this kernel has do lots of work for metric implement.So from official source code, i use C# code to test my python code.(If I'm wrong, please point out😃 )</p>\n\n<p>python code:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1dfd0b0bd897403e1549664bc10f5737%2F7UG5D4XF4RXDPV_NXBOT.png?generation=1573579143860822&amp;alt=media\" alt=\"\">\npython result:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2Fa207b0d68ede5a830b3369a926ab16d0%2F2SVOYVR4726ZPLZXRXI.png?generation=1573579177336071&amp;alt=media\" alt=\"\"></p>\n\n<p>C# code:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F30c2e3285c326355331de8b3d684efc2%2F1.png?generation=1573579765127561&amp;alt=media\" alt=\"\"></p>\n\n<p>C# result:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1194ee5509fb1867f0c195e227dacd81%2F2.png?generation=1573579778891173&amp;alt=media\" alt=\"\"></p>\n\n<p>Problem here: I don't know why there's a minus sign diff between C# q2inv &amp; python q2inv</p>",
      "rawMarkdown": "https://www.kaggle.com/greatgamedota/cv-util-functions,  this kernel has do lots of work for metric implement.So from official source code, i use C# code to test my python code.(If I'm wrong, please point out😃 )\n\npython code:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1dfd0b0bd897403e1549664bc10f5737%2F7UG5D4XF4RXDPV_NXBOT.png?generation=1573579143860822&amp;alt=media)\npython result:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2Fa207b0d68ede5a830b3369a926ab16d0%2F2SVOYVR4726ZPLZXRXI.png?generation=1573579177336071&amp;alt=media)\n\nC# code:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F30c2e3285c326355331de8b3d684efc2%2F1.png?generation=1573579765127561&amp;alt=media)\n\nC# result:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1194ee5509fb1867f0c195e227dacd81%2F2.png?generation=1573579778891173&amp;alt=media)\n\n\nProblem here: I don't know why there's a minus sign diff between C# q2inv &amp; python q2inv\n",
      "votes": 5
    },
    {
      "id": 671436,
      "postDate": "2019-11-12T17:42:02.457Z",
      "content": "<p>If you could, can you implement the official rotation metric (<a href=\"https://www.kaggle.com/c/pku-autonomous-driving/overview/evaluation\">https://www.kaggle.com/c/pku-autonomous-driving/overview/evaluation</a>) in C# and see how it compares with the python implementation? Thanks!</p>",
      "rawMarkdown": "If you could, can you implement the official rotation metric (https://www.kaggle.com/c/pku-autonomous-driving/overview/evaluation) in C# and see how it compares with the python implementation? Thanks!",
      "votes": 1,
      "replies": [
        {
          "id": 671437,
          "postDate": "2019-11-12T17:46:35.643Z",
          "content": "<p>This is my first time to code C#😂 , and i cant find Object3D class, i think its a custom class.\nI try C# code using your kernel's example</p>",
          "rawMarkdown": "This is my first time to code C#😂 , and i cant find Object3D class, i think its a custom class.\nI try C# code using your kernel's example"
        }
      ]
    },
    {
      "id": 671440,
      "postDate": "2019-11-12T17:49:47.947Z",
      "content": "<p>Hi,</p>\n\n<p>I think, this line</p>\n\n<p><code>W = (acos(W) * 180) / pi</code></p>\n\n<p>should be,</p>\n\n<p><code>W = (acos(W) * 360) / pi</code></p>\n\n<p>Since 4th element of Quaternion is<code>cos(θ/2)</code> in general.</p>\n\n<p>This bug is from official code.</p>\n\n<p>Edit:\nAnd I expect same final result, if the bug was fixed.</p>\n\n<p>In terms of difference of q2inv, since both the rotation axis and the rotation angle of Quaternion has minus sign, this difference should be OK.</p>",
      "rawMarkdown": "Hi,\n\nI think, this line\n\n`W = (acos(W) * 180) / pi`\n\nshould be,\n\n`W = (acos(W) * 360) / pi`\n\nSince 4th element of Quaternion is`cos(θ/2)` in general.\n\nThis bug is from official code.\n\nEdit:\nAnd I expect same final result, if the bug was fixed.\n\nIn terms of difference of q2inv, since both the rotation axis and the rotation angle of Quaternion has minus sign, this difference should be OK.",
      "votes": 2,
      "replies": [
        {
          "id": 671453,
          "postDate": "2019-11-12T18:09:48.373Z",
          "content": "<p>Oh..i think you are right!</p>",
          "rawMarkdown": "Oh..i think you are right!",
          "votes": 1
        },
        {
          "id": 671455,
          "postDate": "2019-11-12T18:14:01.437Z",
          "content": "<p>Fixed, thanks for the info!</p>",
          "rawMarkdown": "Fixed, thanks for the info!",
          "votes": 1
        }
      ]
    },
    {
      "id": 679515,
      "postDate": "2019-11-22T22:20:05.773Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 671436,
      "author_name": "GreatGameDota",
      "author_url": "",
      "post_date": "2019-11-12T17:42:02.457000",
      "content": "<p>If you could, can you implement the official rotation metric (<a href=\"https://www.kaggle.com/c/pku-autonomous-driving/overview/evaluation\">https://www.kaggle.com/c/pku-autonomous-driving/overview/evaluation</a>) in C# and see how it compares with the python implementation? Thanks!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 671437,
          "author_name": "shiba",
          "author_url": "",
          "post_date": "2019-11-12T17:46:35.643000",
          "content": "<p>This is my first time to code C#😂 , and i cant find Object3D class, i think its a custom class.\nI try C# code using your kernel's example</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 671440,
      "author_name": "tito",
      "author_url": "",
      "post_date": "2019-11-12T17:49:47.947000",
      "content": "<p>Hi,</p>\n\n<p>I think, this line</p>\n\n<p><code>W = (acos(W) * 180) / pi</code></p>\n\n<p>should be,</p>\n\n<p><code>W = (acos(W) * 360) / pi</code></p>\n\n<p>Since 4th element of Quaternion is<code>cos(θ/2)</code> in general.</p>\n\n<p>This bug is from official code.</p>\n\n<p>Edit:\nAnd I expect same final result, if the bug was fixed.</p>\n\n<p>In terms of difference of q2inv, since both the rotation axis and the rotation angle of Quaternion has minus sign, this difference should be OK.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 671453,
          "author_name": "shiba",
          "author_url": "",
          "post_date": "2019-11-12T18:09:48.373000",
          "content": "<p>Oh..i think you are right!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 671455,
          "author_name": "GreatGameDota",
          "author_url": "",
          "post_date": "2019-11-12T18:14:01.437000",
          "content": "<p>Fixed, thanks for the info!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 679515,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-11-22T22:20:05.773000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "671429": "https://www.kaggle.com/greatgamedota/cv-util-functions,  this kernel has do lots of work for metric implement.So from official source code, i use C# code to test my python code.(If I'm wrong, please point out😃 )\n\npython code:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1dfd0b0bd897403e1549664bc10f5737%2F7UG5D4XF4RXDPV_NXBOT.png?generation=1573579143860822&amp;alt=media)\npython result:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2Fa207b0d68ede5a830b3369a926ab16d0%2F2SVOYVR4726ZPLZXRXI.png?generation=1573579177336071&amp;alt=media)\n\nC# code:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F30c2e3285c326355331de8b3d684efc2%2F1.png?generation=1573579765127561&amp;alt=media)\n\nC# result:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2164736%2F1194ee5509fb1867f0c195e227dacd81%2F2.png?generation=1573579778891173&amp;alt=media)\n\n\nProblem here: I don't know why there's a minus sign diff between C# q2inv &amp; python q2inv\n",
    "671436": "If you could, can you implement the official rotation metric (https://www.kaggle.com/c/pku-autonomous-driving/overview/evaluation) in C# and see how it compares with the python implementation? Thanks!",
    "671440": "Hi,\n\nI think, this line\n\n`W = (acos(W) * 180) / pi`\n\nshould be,\n\n`W = (acos(W) * 360) / pi`\n\nSince 4th element of Quaternion is`cos(θ/2)` in general.\n\nThis bug is from official code.\n\nEdit:\nAnd I expect same final result, if the bug was fixed.\n\nIn terms of difference of q2inv, since both the rotation axis and the rotation angle of Quaternion has minus sign, this difference should be OK.",
    "679515": ""
  }
}