{
  "id": 165386,
  "title": "Some questions about image preprocessing",
  "url": "/competitions/landmark-retrieval-2020/discussion/165386",
  "author_name": "",
  "post_date": "2020-07-09T13:33:12.036779800Z",
  "votes": 2,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hello Team:\nsupply to <a href=\"https://www.kaggle.com/c/landmark-retrieval-2020/discussion/163589,We\">https://www.kaggle.com/c/landmark-retrieval-2020/discussion/163589,We</a> still have some questions about test preprocessing;\n1.The SavedModel should take a [H,W,3] uint8 tensor as input， input image channel is RGB or BGR ?This is the key to aligning the model transfer from pytorch\n2.whether the hidden test/index set and the released set are the same distribution?</p>",
  "messages": [
    {
      "id": "921690",
      "postDate": "07/09/2020 13:33:12",
      "content": "<p>Hello Team:\nsupply to <a href=\"https://www.kaggle.com/c/landmark-retrieval-2020/discussion/163589,We\">https://www.kaggle.com/c/landmark-retrieval-2020/discussion/163589,We</a> still have some questions about test preprocessing;\n1.The SavedModel should take a [H,W,3] uint8 tensor as input， input image channel is RGB or BGR ?This is the key to aligning the model transfer from pytorch\n2.whether the hidden test/index set and the released set are the same distribution?</p>",
      "rawMarkdown": "Hello Team:\nsupply to https://www.kaggle.com/c/landmark-retrieval-2020/discussion/163589,We still have some questions about test preprocessing;\n1.The SavedModel should take a [H,W,3] uint8 tensor as input， input image channel is RGB or BGR ?This is the key to aligning the model transfer from pytorch\n2.whether the hidden test/index set and the released set are the same distribution?",
      "votes": null
    },
    {
      "id": "921977",
      "postDate": "07/09/2020 17:39:41",
      "content": "<p>1) RGB. See also the <a href=\"https://www.kaggle.com/c/landmark-retrieval-2020/discussion/165400\">scoring script</a>, which gives a concrete example:</p>\n\n<p><code>python\ndef get_embedding(image_path: Path) -&gt; np.ndarray:\n  image_data = np.array(Image.open(str(image_path)).convert('RGB'))\n  image_tensor = tf.convert_to_tensor(image_data)\n  return embedding_fn(image_tensor)[REQUIRED_OUTPUT].numpy()\n</code></p>\n\n<p>2) Yes, they have similar distribution as the GLDv2-test/index data.</p>",
      "rawMarkdown": "1) RGB. See also the [scoring script](https://www.kaggle.com/c/landmark-retrieval-2020/discussion/165400), which gives a concrete example:\n\n```python\ndef get_embedding(image_path: Path) -&gt; np.ndarray:\n  image_data = np.array(Image.open(str(image_path)).convert('RGB'))\n  image_tensor = tf.convert_to_tensor(image_data)\n  return embedding_fn(image_tensor)[REQUIRED_OUTPUT].numpy()\n```\n\n2) Yes, they have similar distribution as the GLDv2-test/index data.",
      "votes": null
    },
    {
      "id": "922307",
      "postDate": "07/10/2020 02:38:21",
      "content": "<p>thanks~</p>",
      "rawMarkdown": "thanks~",
      "votes": null
    },
    {
      "id": "936553",
      "postDate": "07/20/2020 10:09:48",
      "content": "<p><a href=\"/andrefaraujo\">@andrefaraujo</a> why does it convert to RGB if it is already in RGB?</p>",
      "rawMarkdown": "andrefaraujo why does it convert to RGB if it is already in RGB?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 921977,
      "author_name": "andrefaraujo",
      "author_url": "",
      "post_date": "07/09/2020 17:39:41",
      "content": "<p>1) RGB. See also the <a href=\"https://www.kaggle.com/c/landmark-retrieval-2020/discussion/165400\">scoring script</a>, which gives a concrete example:</p>\n\n<p><code>python\ndef get_embedding(image_path: Path) -&gt; np.ndarray:\n  image_data = np.array(Image.open(str(image_path)).convert('RGB'))\n  image_tensor = tf.convert_to_tensor(image_data)\n  return embedding_fn(image_tensor)[REQUIRED_OUTPUT].numpy()\n</code></p>\n\n<p>2) Yes, they have similar distribution as the GLDv2-test/index data.</p>",
      "votes": null,
      "replies": [
        {
          "id": 936553,
          "author_name": "aerdem4",
          "author_url": "",
          "post_date": "07/20/2020 10:09:48",
          "content": "<p><a href=\"/andrefaraujo\">@andrefaraujo</a> why does it convert to RGB if it is already in RGB?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 922307,
      "author_name": "renhui111111",
      "author_url": "",
      "post_date": "07/10/2020 02:38:21",
      "content": "<p>thanks~</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "921690": "Hello Team:\nsupply to https://www.kaggle.com/c/landmark-retrieval-2020/discussion/163589,We still have some questions about test preprocessing;\n1.The SavedModel should take a [H,W,3] uint8 tensor as input， input image channel is RGB or BGR ?This is the key to aligning the model transfer from pytorch\n2.whether the hidden test/index set and the released set are the same distribution?",
    "921977": "1) RGB. See also the [scoring script](https://www.kaggle.com/c/landmark-retrieval-2020/discussion/165400), which gives a concrete example:\n\n```python\ndef get_embedding(image_path: Path) -&gt; np.ndarray:\n  image_data = np.array(Image.open(str(image_path)).convert('RGB'))\n  image_tensor = tf.convert_to_tensor(image_data)\n  return embedding_fn(image_tensor)[REQUIRED_OUTPUT].numpy()\n```\n\n2) Yes, they have similar distribution as the GLDv2-test/index data.",
    "922307": "thanks~",
    "936553": "andrefaraujo why does it convert to RGB if it is already in RGB?"
  },
  "source": "meta"
}