{
  "id": 158380,
  "title": "Data pre-processing for Melanoma Classification",
  "url": "/competitions/siim-isic-melanoma-classification/discussion/158380",
  "author_name": "",
  "post_date": "2020-06-14T06:07:12.816922200Z",
  "votes": 7,
  "comment_count": 4,
  "views": 0,
  "content": "<p>How can I pre-process the data and create two sub-folders with the name 'benign' and 'malignant' within the test and train folder to use the ImageDataGenerator from tensorflow.keras.preprocessing.image?</p>",
  "messages": [
    {
      "id": "885359",
      "postDate": "06/14/2020 06:07:12",
      "content": "<p>How can I pre-process the data and create two sub-folders with the name 'benign' and 'malignant' within the test and train folder to use the ImageDataGenerator from tensorflow.keras.preprocessing.image?</p>",
      "rawMarkdown": "How can I pre-process the data and create two sub-folders with the name 'benign' and 'malignant' within the test and train folder to use the ImageDataGenerator from tensorflow.keras.preprocessing.image?",
      "votes": null
    },
    {
      "id": "885847",
      "postDate": "06/14/2020 14:14:50",
      "content": "<p>Essentially, the first thing you want to do is to read the images using an imaging library such as PIL or CV. \nNext, once you have read the image, you want to capture the file_name and do a lookup on the train.csv dataframe to lookup it's label. Once you have done that, you can save the image to the directory f<code>./data/{label}/{file_name}.jpg</code>. </p>\n\n<p>Would you need sample code for this too? </p>",
      "rawMarkdown": "Essentially, the first thing you want to do is to read the images using an imaging library such as PIL or CV. \nNext, once you have read the image, you want to capture the file_name and do a lookup on the train.csv dataframe to lookup it's label. Once you have done that, you can save the image to the directory f`./data/{label}/{file_name}.jpg`. \n\nWould you need sample code for this too?",
      "votes": null
    },
    {
      "id": "885924",
      "postDate": "06/14/2020 15:10:23",
      "content": "<p>Thank you so much, sir. It would be really helpful for me if you provide me a sample too. Please, consider this a request.</p>",
      "rawMarkdown": "Thank you so much, sir. It would be really helpful for me if you provide me a sample too. Please, consider this a request.",
      "votes": null
    },
    {
      "id": "900251",
      "postDate": "06/24/2020 17:49:59",
      "content": "<p>Hi Akshat,</p>\n\n<p>I posted a gist with a python code which splits the training images into separate folders depending on diagnosis.</p>\n\n<p><a href=\"https://gist.github.com/tampapath/9589d4dc63a8b4c69387416c30071ffb\">https://gist.github.com/tampapath/9589d4dc63a8b4c69387416c30071ffb</a></p>\n\n<p>If you run it you will end up with separate folders containing:</p>\n\n<p>Unknown: 27124 cases\nNevus: 5193 cases\nMelanoma: 584 cases\nseborrheic Keratosis: 135 cases\nLentigo NOS: 44 cases\nlichenoid Keratosis: 37 cases\nSolar Lentigo: 7 cases\nAtypical Melanocytic Proliferation: 1 cases\nCafe-au-lait macule: 1 cases</p>\n\n<p>Good luck with this competition,</p>\n\n<p>Andrew\n@tampapath</p>",
      "rawMarkdown": "Hi Akshat,\n\nI posted a gist with a python code which splits the training images into separate folders depending on diagnosis.\n\nhttps://gist.github.com/tampapath/9589d4dc63a8b4c69387416c30071ffb\n\nIf you run it you will end up with separate folders containing:\n\nUnknown: 27124 cases\nNevus: 5193 cases\nMelanoma: 584 cases\nseborrheic Keratosis: 135 cases\nLentigo NOS: 44 cases\nlichenoid Keratosis: 37 cases\nSolar Lentigo: 7 cases\nAtypical Melanocytic Proliferation: 1 cases\nCafe-au-lait macule: 1 cases\n\nGood luck with this competition,\n\nAndrew\n@tampapath",
      "votes": null
    },
    {
      "id": "902366",
      "postDate": "06/26/2020 05:24:46",
      "content": "<p>Thank you so much this will help me a lot.</p>",
      "rawMarkdown": "Thank you so much this will help me a lot.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 885847,
      "author_name": "aroraaman",
      "author_url": "",
      "post_date": "06/14/2020 14:14:50",
      "content": "<p>Essentially, the first thing you want to do is to read the images using an imaging library such as PIL or CV. \nNext, once you have read the image, you want to capture the file_name and do a lookup on the train.csv dataframe to lookup it's label. Once you have done that, you can save the image to the directory f<code>./data/{label}/{file_name}.jpg</code>. </p>\n\n<p>Would you need sample code for this too? </p>",
      "votes": null,
      "replies": [
        {
          "id": 885924,
          "author_name": "akshat0007",
          "author_url": "",
          "post_date": "06/14/2020 15:10:23",
          "content": "<p>Thank you so much, sir. It would be really helpful for me if you provide me a sample too. Please, consider this a request.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 900251,
      "author_name": "andrew5000",
      "author_url": "",
      "post_date": "06/24/2020 17:49:59",
      "content": "<p>Hi Akshat,</p>\n\n<p>I posted a gist with a python code which splits the training images into separate folders depending on diagnosis.</p>\n\n<p><a href=\"https://gist.github.com/tampapath/9589d4dc63a8b4c69387416c30071ffb\">https://gist.github.com/tampapath/9589d4dc63a8b4c69387416c30071ffb</a></p>\n\n<p>If you run it you will end up with separate folders containing:</p>\n\n<p>Unknown: 27124 cases\nNevus: 5193 cases\nMelanoma: 584 cases\nseborrheic Keratosis: 135 cases\nLentigo NOS: 44 cases\nlichenoid Keratosis: 37 cases\nSolar Lentigo: 7 cases\nAtypical Melanocytic Proliferation: 1 cases\nCafe-au-lait macule: 1 cases</p>\n\n<p>Good luck with this competition,</p>\n\n<p>Andrew\n@tampapath</p>",
      "votes": null,
      "replies": [
        {
          "id": 902366,
          "author_name": "akshat0007",
          "author_url": "",
          "post_date": "06/26/2020 05:24:46",
          "content": "<p>Thank you so much this will help me a lot.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "885359": "How can I pre-process the data and create two sub-folders with the name 'benign' and 'malignant' within the test and train folder to use the ImageDataGenerator from tensorflow.keras.preprocessing.image?",
    "885847": "Essentially, the first thing you want to do is to read the images using an imaging library such as PIL or CV. \nNext, once you have read the image, you want to capture the file_name and do a lookup on the train.csv dataframe to lookup it's label. Once you have done that, you can save the image to the directory f`./data/{label}/{file_name}.jpg`. \n\nWould you need sample code for this too?",
    "885924": "Thank you so much, sir. It would be really helpful for me if you provide me a sample too. Please, consider this a request.",
    "900251": "Hi Akshat,\n\nI posted a gist with a python code which splits the training images into separate folders depending on diagnosis.\n\nhttps://gist.github.com/tampapath/9589d4dc63a8b4c69387416c30071ffb\n\nIf you run it you will end up with separate folders containing:\n\nUnknown: 27124 cases\nNevus: 5193 cases\nMelanoma: 584 cases\nseborrheic Keratosis: 135 cases\nLentigo NOS: 44 cases\nlichenoid Keratosis: 37 cases\nSolar Lentigo: 7 cases\nAtypical Melanocytic Proliferation: 1 cases\nCafe-au-lait macule: 1 cases\n\nGood luck with this competition,\n\nAndrew\n@tampapath",
    "902366": "Thank you so much this will help me a lot."
  },
  "source": "meta"
}