{
  "id": 509899,
  "title": "Chamfer distance computation issue ",
  "url": "/competitions/cvpr-metafood-3d-food-reconstruction-challenge/discussion/509899",
  "author_name": "",
  "post_date": "2024-06-04T10:58:48.960253800Z",
  "votes": -1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Hello,</p>\n<p>While checking out the Chamfer evaluation code, I noticed that the distance is computed between the sets of vertices of the two meshes. However, the correct way of computing Chamfer between meshes is by sampling a fixed large number of points from the surface of each mesh (eg. 500k). This way, it accounts in a fair manner for different mesh resolutions and topologies.  <br>\nI suggest the loading function in the evaluation script to be modified as follows:</p>\n<pre><code>def load_obj_as_pointcloud(file_path):\n     = trimesh.(file_path)\n     .(.sample())\n</code></pre>\n<p>Thank you!</p>",
  "messages": [
    {
      "id": "2854543",
      "postDate": "06/04/2024 10:58:48",
      "content": "<p>Hello,</p>\n<p>While checking out the Chamfer evaluation code, I noticed that the distance is computed between the sets of vertices of the two meshes. However, the correct way of computing Chamfer between meshes is by sampling a fixed large number of points from the surface of each mesh (eg. 500k). This way, it accounts in a fair manner for different mesh resolutions and topologies.  <br>\nI suggest the loading function in the evaluation script to be modified as follows:</p>\n<pre><code>def load_obj_as_pointcloud(file_path):\n     = trimesh.(file_path)\n     .(.sample())\n</code></pre>\n<p>Thank you!</p>",
      "rawMarkdown": "Hello,\n\nWhile checking out the Chamfer evaluation code, I noticed that the distance is computed between the sets of vertices of the two meshes. However, the correct way of computing Chamfer between meshes is by sampling a fixed large number of points from the surface of each mesh (eg. 500k). This way, it accounts in a fair manner for different mesh resolutions and topologies.  \nI suggest the loading function in the evaluation script to be modified as follows:\n```\ndef load_obj_as_pointcloud(file_path):\n    mesh = trimesh.load(file_path)\n    return np.array(mesh.sample(500000))\n```\nThank you!",
      "votes": null
    },
    {
      "id": "2861099",
      "postDate": "06/08/2024 03:11:04",
      "content": "<p>Sampling adds randomness. That is the reason we don't resample.</p>",
      "rawMarkdown": "Sampling adds randomness. That is the reason we don't resample.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2861099,
      "author_name": "metafoodcvpr",
      "author_url": "",
      "post_date": "06/08/2024 03:11:04",
      "content": "<p>Sampling adds randomness. That is the reason we don't resample.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2854543": "Hello,\n\nWhile checking out the Chamfer evaluation code, I noticed that the distance is computed between the sets of vertices of the two meshes. However, the correct way of computing Chamfer between meshes is by sampling a fixed large number of points from the surface of each mesh (eg. 500k). This way, it accounts in a fair manner for different mesh resolutions and topologies.  \nI suggest the loading function in the evaluation script to be modified as follows:\n```\ndef load_obj_as_pointcloud(file_path):\n    mesh = trimesh.load(file_path)\n    return np.array(mesh.sample(500000))\n```\nThank you!",
    "2861099": "Sampling adds randomness. That is the reason we don't resample."
  },
  "source": "meta"
}