{
  "id": 175661,
  "title": "Belated question on object detection",
  "url": "/competitions/global-wheat-detection/discussion/175661",
  "author_name": "",
  "post_date": "2020-08-19T00:28:52.108636800Z",
  "votes": 5,
  "comment_count": 1,
  "views": 0,
  "content": "<p>This is my first object detection project on Kaggle, I know it's belated, hopefully some kind souls can help me out here.</p>\n<p>In general, if we are using models like the RCNN family, or efficiendet, do we need to input the image size to be the same during the training pipeline. For example, every image in this comp is 1024x1024. Let's say there are a subset of images that are 1200x1000 instead, along with 1024x1024 images. Would the object detection models still work without problem since models like Faster RCNN do a resizing internally anyways - so the question is: must all my input images be of the same size when using object detection models? What is the best practice?</p>",
  "messages": [
    {
      "id": "976565",
      "postDate": "08/19/2020 00:28:52",
      "content": "<p>This is my first object detection project on Kaggle, I know it's belated, hopefully some kind souls can help me out here.</p>\n<p>In general, if we are using models like the RCNN family, or efficiendet, do we need to input the image size to be the same during the training pipeline. For example, every image in this comp is 1024x1024. Let's say there are a subset of images that are 1200x1000 instead, along with 1024x1024 images. Would the object detection models still work without problem since models like Faster RCNN do a resizing internally anyways - so the question is: must all my input images be of the same size when using object detection models? What is the best practice?</p>",
      "rawMarkdown": "This is my first object detection project on Kaggle, I know it's belated, hopefully some kind souls can help me out here.\n\nIn general, if we are using models like the RCNN family, or efficiendet, do we need to input the image size to be the same during the training pipeline. For example, every image in this comp is 1024x1024. Let's say there are a subset of images that are 1200x1000 instead, along with 1024x1024 images. Would the object detection models still work without problem since models like Faster RCNN do a resizing internally anyways - so the question is: must all my input images be of the same size when using object detection models? What is the best practice?",
      "votes": null
    },
    {
      "id": "976992",
      "postDate": "08/19/2020 08:07:40",
      "content": "<p>It's commonplace to have images of the same size in your pipeline from what I've seen. In any case, I can't comment over OD algorithms having internal resizing, but I believe that you could easily get over this problem by simply batch resizing multiple images. Here is a quick snipped which should do the trick,</p>\n<p>`import PIL<br>\nimport os<br>\nimport os.path<br>\nfrom PIL import Image</p>\n<p>f = r'c://Users/xx/Desktop/folder'<br>\nfor file in os.listdir(f):<br>\n    f_img = f+\"/\"+file<br>\n    img = Image.open(f_img)<br>\n    img = img.resize((2296,1724))<br>\n    img.save(f_img)`</p>",
      "rawMarkdown": "It's commonplace to have images of the same size in your pipeline from what I've seen. In any case, I can't comment over OD algorithms having internal resizing, but I believe that you could easily get over this problem by simply batch resizing multiple images. Here is a quick snipped which should do the trick,\n\n`import PIL\nimport os\nimport os.path\nfrom PIL import Image\n\nf = r'c://Users/xx/Desktop/folder'\nfor file in os.listdir(f):\n    f_img = f+\"/\"+file\n    img = Image.open(f_img)\n    img = img.resize((2296,1724))\n    img.save(f_img)`",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 976992,
      "author_name": "unkletam",
      "author_url": "",
      "post_date": "08/19/2020 08:07:40",
      "content": "<p>It's commonplace to have images of the same size in your pipeline from what I've seen. In any case, I can't comment over OD algorithms having internal resizing, but I believe that you could easily get over this problem by simply batch resizing multiple images. Here is a quick snipped which should do the trick,</p>\n<p>`import PIL<br>\nimport os<br>\nimport os.path<br>\nfrom PIL import Image</p>\n<p>f = r'c://Users/xx/Desktop/folder'<br>\nfor file in os.listdir(f):<br>\n    f_img = f+\"/\"+file<br>\n    img = Image.open(f_img)<br>\n    img = img.resize((2296,1724))<br>\n    img.save(f_img)`</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "976565": "This is my first object detection project on Kaggle, I know it's belated, hopefully some kind souls can help me out here.\n\nIn general, if we are using models like the RCNN family, or efficiendet, do we need to input the image size to be the same during the training pipeline. For example, every image in this comp is 1024x1024. Let's say there are a subset of images that are 1200x1000 instead, along with 1024x1024 images. Would the object detection models still work without problem since models like Faster RCNN do a resizing internally anyways - so the question is: must all my input images be of the same size when using object detection models? What is the best practice?",
    "976992": "It's commonplace to have images of the same size in your pipeline from what I've seen. In any case, I can't comment over OD algorithms having internal resizing, but I believe that you could easily get over this problem by simply batch resizing multiple images. Here is a quick snipped which should do the trick,\n\n`import PIL\nimport os\nimport os.path\nfrom PIL import Image\n\nf = r'c://Users/xx/Desktop/folder'\nfor file in os.listdir(f):\n    f_img = f+\"/\"+file\n    img = Image.open(f_img)\n    img = img.resize((2296,1724))\n    img.save(f_img)`"
  },
  "source": "meta"
}