{
  "id": 214530,
  "title": "Potentially useful Github links",
  "url": "/competitions/hpa-single-cell-image-classification/discussion/214530",
  "author_name": "Casper Winsnes",
  "post_date": "2021-01-27T02:28:03.256000",
  "votes": 30,
  "comment_count": 9,
  "views": 0,
  "content": "<p>On the official Cellprofiling Github we have some pieces of code that could, potentially, be useful for this competition.</p>\n<ol>\n<li><p><a href=\"https://github.com/CellProfiling/HPA-competition-solutions\" target=\"_blank\">The code for the solutions from the previous challenge</a> that was later published in <a href=\"https://www.nature.com/articles/s41592-019-0658-6\" target=\"_blank\">Nature Methods</a>. You will also be able to get the trained weights from the Bestfitting's winning solution there.</p></li>\n<li><p><a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation\" target=\"_blank\">Code for segmenting individual cells and nuclei in the HPA images</a>.</p></li>\n</ol>\n<p>Here are a couple that are not from our lab, but could still be useful.</p>\n<ol>\n<li><p><a href=\"https://github.com/MouseLand/cellpose\" target=\"_blank\">Cellpose: A more general approach to cell segmentation</a></p></li>\n<li><p><a href=\"https://github.com/imagej/imagej\" target=\"_blank\">ImageJ: A great tool to explore microscopy images with</a>. ImageJ is also available as <a href=\"https://github.com/fiji/fiji\" target=\"_blank\">FIJI</a> and as a <a href=\"https://ij.imjoy.io/\" target=\"_blank\">web app on Imjoy</a>.</p></li>\n</ol>",
  "messages": [
    {
      "id": 1171645,
      "postDate": "2021-01-27T02:28:03.257Z",
      "content": "<p>On the official Cellprofiling Github we have some pieces of code that could, potentially, be useful for this competition.</p>\n<ol>\n<li><p><a href=\"https://github.com/CellProfiling/HPA-competition-solutions\" target=\"_blank\">The code for the solutions from the previous challenge</a> that was later published in <a href=\"https://www.nature.com/articles/s41592-019-0658-6\" target=\"_blank\">Nature Methods</a>. You will also be able to get the trained weights from the Bestfitting's winning solution there.</p></li>\n<li><p><a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation\" target=\"_blank\">Code for segmenting individual cells and nuclei in the HPA images</a>.</p></li>\n</ol>\n<p>Here are a couple that are not from our lab, but could still be useful.</p>\n<ol>\n<li><p><a href=\"https://github.com/MouseLand/cellpose\" target=\"_blank\">Cellpose: A more general approach to cell segmentation</a></p></li>\n<li><p><a href=\"https://github.com/imagej/imagej\" target=\"_blank\">ImageJ: A great tool to explore microscopy images with</a>. ImageJ is also available as <a href=\"https://github.com/fiji/fiji\" target=\"_blank\">FIJI</a> and as a <a href=\"https://ij.imjoy.io/\" target=\"_blank\">web app on Imjoy</a>.</p></li>\n</ol>",
      "rawMarkdown": "On the official Cellprofiling Github we have some pieces of code that could, potentially, be useful for this competition.\n\n1. [The code for the solutions from the previous challenge](https://github.com/CellProfiling/HPA-competition-solutions) that was later published in [Nature Methods](https://www.nature.com/articles/s41592-019-0658-6). You will also be able to get the trained weights from the Bestfitting's winning solution there.\n\n2. [Code for segmenting individual cells and nuclei in the HPA images](https://github.com/CellProfiling/HPA-Cell-Segmentation).\n\nHere are a couple that are not from our lab, but could still be useful.\n1. [Cellpose: A more general approach to cell segmentation](https://github.com/MouseLand/cellpose)\n\n3. [ImageJ: A great tool to explore microscopy images with](https://github.com/imagej/imagej). ImageJ is also available as [FIJI](https://github.com/fiji/fiji) and as a [web app on Imjoy](https://ij.imjoy.io/).",
      "votes": 30
    },
    {
      "id": 1173113,
      "postDate": "2021-01-27T17:22:39.910Z",
      "content": "<p>Just tried the code for segmenting individual cells. Got the following error:</p>\n<pre><code>ImportError: cannot import name 'isStringType' from 'PIL._util' (/opt/conda/lib/python3.7/site-packages/PIL/_util.py)\n</code></pre>\n<p>More on that in <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/issues/15\" target=\"_blank\">this github issue</a> where I also shared the call stack.</p>",
      "rawMarkdown": "Just tried the code for segmenting individual cells. Got the following error:\n```\nImportError: cannot import name 'isStringType' from 'PIL._util' (/opt/conda/lib/python3.7/site-packages/PIL/_util.py)\n```\nMore on that in [this github issue](https://github.com/CellProfiling/HPA-Cell-Segmentation/issues/15) where I also shared the call stack.",
      "replies": [
        {
          "id": 1173144,
          "postDate": "2021-01-27T17:34:45.203Z",
          "content": "<p>Hi! Have you try looking at this example?  <a href=\"https://www.kaggle.com/lnhtrang/hpa-public-data-download-and-hpacellseg\" target=\"_blank\">https://www.kaggle.com/lnhtrang/hpa-public-data-download-and-hpacellseg</a><br>\nI tried it last week with <br>\n!pip install <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip\" target=\"_blank\">https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip</a></p>",
          "rawMarkdown": "Hi! Have you try looking at this example?  https://www.kaggle.com/lnhtrang/hpa-public-data-download-and-hpacellseg\nI tried it last week with \n!pip install https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip",
          "votes": 2
        },
        {
          "id": 1173177,
          "postDate": "2021-01-27T17:58:45.613Z",
          "content": "<p>Thanks for the quick reply, that worked. The trick was to install the HPA Cell Segmentation package with</p>\n<pre><code>!pip install https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip\n</code></pre>\n<p>Instead of what I had locally, which is</p>\n<pre><code>!git clone https://github.com/CellProfiling/HPA-Cell-Segmentation\n!cd HPA-Cell-Segmentation; sh install.sh\n</code></pre>",
          "rawMarkdown": "Thanks for the quick reply, that worked. The trick was to install the HPA Cell Segmentation package with\n```\n!pip install https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip\n```\nInstead of what I had locally, which is\n```\n!git clone https://github.com/CellProfiling/HPA-Cell-Segmentation\n!cd HPA-Cell-Segmentation; sh install.sh\n```"
        },
        {
          "id": 1173399,
          "postDate": "2021-01-27T21:07:41.163Z",
          "content": "<p>That is odd. I have tested the <code>sh install.sh</code> before and had it work fine. I will look into it tomorrow. Thank you for letting us know.</p>",
          "rawMarkdown": "That is odd. I have tested the `sh install.sh` before and had it work fine. I will look into it tomorrow. Thank you for letting us know.",
          "votes": 1
        },
        {
          "id": 1173426,
          "postDate": "2021-01-27T21:38:33.417Z",
          "content": "<p>I have a question that I might have missed somewhere but I just tried out the cell segmenting on some of the test images and I ran into issues with shapes other than (2048, 2048, 3) so I am thinking images outside that size need to be resized before we can create segmentations?</p>",
          "rawMarkdown": "I have a question that I might have missed somewhere but I just tried out the cell segmenting on some of the test images and I ran into issues with shapes other than (2048, 2048, 3) so I am thinking images outside that size need to be resized before we can create segmentations?"
        },
        {
          "id": 1173441,
          "postDate": "2021-01-27T22:05:28.423Z",
          "content": "<p>It should work for different sizes, however it will only work if all the images in the stack are the same size.</p>",
          "rawMarkdown": "It should work for different sizes, however it will only work if all the images in the stack are the same size.",
          "votes": 2
        },
        {
          "id": 1177049,
          "postDate": "2021-01-30T02:25:20.010Z",
          "content": "<p>Hey <a href=\"https://www.kaggle.com/cwinsnes\" target=\"_blank\">@cwinsnes</a> maybe I am missing something here but when I use a single image that does not have width and height of 2048 then I get this error:</p>\n<pre><code>/opt/conda/lib/python3.7/site-packages/pytorch_zoo/abstract_model.py in forward(self, dec, enc)\n    109 \n    110     def forward(self, dec, enc):\n--&gt; 111         x = torch.cat([dec, enc], dim=1)\n    112         return self.seq(x)\n    113 \n\nRuntimeError: Sizes of tensors must match except in dimension 1. Got 28 and 27 in dimension 2 (The offending index is 1)\n</code></pre>\n<p>It looks like the decoder and encoder have different values in dimension 2 when I look through the debugger.</p>\n<p>This is the input</p>\n<pre><code>[['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_red.png'],\n ['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_yellow.png'],\n ['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_blue.png']]\n</code></pre>",
          "rawMarkdown": "Hey @cwinsnes maybe I am missing something here but when I use a single image that does not have width and height of 2048 then I get this error:\n\n```\n/opt/conda/lib/python3.7/site-packages/pytorch_zoo/abstract_model.py in forward(self, dec, enc)\n    109 \n    110     def forward(self, dec, enc):\n--> 111         x = torch.cat([dec, enc], dim=1)\n    112         return self.seq(x)\n    113 \n\nRuntimeError: Sizes of tensors must match except in dimension 1. Got 28 and 27 in dimension 2 (The offending index is 1)\n```\n\nIt looks like the decoder and encoder have different values in dimension 2 when I look through the debugger.\n\nThis is the input\n\n```\n[['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_red.png'],\n ['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_yellow.png'],\n ['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_blue.png']]\n```"
        },
        {
          "id": 1177054,
          "postDate": "2021-01-30T02:39:36.707Z",
          "content": "<p><a href=\"https://www.kaggle.com/rdizzl3\" target=\"_blank\">@rdizzl3</a> try to set padding=True in the arguments to cell segmentator model, it has worked for me. </p>",
          "rawMarkdown": "@rdizzl3 try to set padding=True in the arguments to cell segmentator model, it has worked for me. ",
          "votes": 7
        },
        {
          "id": 1177056,
          "postDate": "2021-01-30T02:45:02.377Z",
          "content": "<p><a href=\"https://www.kaggle.com/thedrcat\" target=\"_blank\">@thedrcat</a> I wish could give you at least 10 upvotes for this. That is what I was missing. Btw what I am working on you just published :)</p>",
          "rawMarkdown": "@thedrcat I wish could give you at least 10 upvotes for this. That is what I was missing. Btw what I am working on you just published :)"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1173113,
      "author_name": "Chan Kha Vu",
      "author_url": "",
      "post_date": "2021-01-27T17:22:39.910000",
      "content": "<p>Just tried the code for segmenting individual cells. Got the following error:</p>\n<pre><code>ImportError: cannot import name 'isStringType' from 'PIL._util' (/opt/conda/lib/python3.7/site-packages/PIL/_util.py)\n</code></pre>\n<p>More on that in <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/issues/15\" target=\"_blank\">this github issue</a> where I also shared the call stack.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1173144,
          "author_name": "Trang Le",
          "author_url": "",
          "post_date": "2021-01-27T17:34:45.203000",
          "content": "<p>Hi! Have you try looking at this example?  <a href=\"https://www.kaggle.com/lnhtrang/hpa-public-data-download-and-hpacellseg\" target=\"_blank\">https://www.kaggle.com/lnhtrang/hpa-public-data-download-and-hpacellseg</a><br>\nI tried it last week with <br>\n!pip install <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip\" target=\"_blank\">https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip</a></p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1173177,
          "author_name": "Chan Kha Vu",
          "author_url": "",
          "post_date": "2021-01-27T17:58:45.613000",
          "content": "<p>Thanks for the quick reply, that worked. The trick was to install the HPA Cell Segmentation package with</p>\n<pre><code>!pip install https://github.com/CellProfiling/HPA-Cell-Segmentation/archive/master.zip\n</code></pre>\n<p>Instead of what I had locally, which is</p>\n<pre><code>!git clone https://github.com/CellProfiling/HPA-Cell-Segmentation\n!cd HPA-Cell-Segmentation; sh install.sh\n</code></pre>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1173399,
          "author_name": "Casper Winsnes",
          "author_url": "",
          "post_date": "2021-01-27T21:07:41.163000",
          "content": "<p>That is odd. I have tested the <code>sh install.sh</code> before and had it work fine. I will look into it tomorrow. Thank you for letting us know.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1173426,
          "author_name": "RDizzl3",
          "author_url": "",
          "post_date": "2021-01-27T21:38:33.417000",
          "content": "<p>I have a question that I might have missed somewhere but I just tried out the cell segmenting on some of the test images and I ran into issues with shapes other than (2048, 2048, 3) so I am thinking images outside that size need to be resized before we can create segmentations?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1173441,
          "author_name": "Casper Winsnes",
          "author_url": "",
          "post_date": "2021-01-27T22:05:28.423000",
          "content": "<p>It should work for different sizes, however it will only work if all the images in the stack are the same size.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1177049,
          "author_name": "RDizzl3",
          "author_url": "",
          "post_date": "2021-01-30T02:25:20.010000",
          "content": "<p>Hey <a href=\"https://www.kaggle.com/cwinsnes\" target=\"_blank\">@cwinsnes</a> maybe I am missing something here but when I use a single image that does not have width and height of 2048 then I get this error:</p>\n<pre><code>/opt/conda/lib/python3.7/site-packages/pytorch_zoo/abstract_model.py in forward(self, dec, enc)\n    109 \n    110     def forward(self, dec, enc):\n--&gt; 111         x = torch.cat([dec, enc], dim=1)\n    112         return self.seq(x)\n    113 \n\nRuntimeError: Sizes of tensors must match except in dimension 1. Got 28 and 27 in dimension 2 (The offending index is 1)\n</code></pre>\n<p>It looks like the decoder and encoder have different values in dimension 2 when I look through the debugger.</p>\n<p>This is the input</p>\n<pre><code>[['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_red.png'],\n ['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_yellow.png'],\n ['/kaggle/input/hpa-single-cell-image-classification/test/020a29cf-2c24-478b-8603-c22a90dc3e31_blue.png']]\n</code></pre>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1177054,
          "author_name": "Darek Kłeczek",
          "author_url": "",
          "post_date": "2021-01-30T02:39:36.707000",
          "content": "<p><a href=\"https://www.kaggle.com/rdizzl3\" target=\"_blank\">@rdizzl3</a> try to set padding=True in the arguments to cell segmentator model, it has worked for me. </p>",
          "votes": 7,
          "replies": []
        },
        {
          "id": 1177056,
          "author_name": "RDizzl3",
          "author_url": "",
          "post_date": "2021-01-30T02:45:02.377000",
          "content": "<p><a href=\"https://www.kaggle.com/thedrcat\" target=\"_blank\">@thedrcat</a> I wish could give you at least 10 upvotes for this. That is what I was missing. Btw what I am working on you just published :)</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1171645": "On the official Cellprofiling Github we have some pieces of code that could, potentially, be useful for this competition.\n\n1. [The code for the solutions from the previous challenge](https://github.com/CellProfiling/HPA-competition-solutions) that was later published in [Nature Methods](https://www.nature.com/articles/s41592-019-0658-6). You will also be able to get the trained weights from the Bestfitting's winning solution there.\n\n2. [Code for segmenting individual cells and nuclei in the HPA images](https://github.com/CellProfiling/HPA-Cell-Segmentation).\n\nHere are a couple that are not from our lab, but could still be useful.\n1. [Cellpose: A more general approach to cell segmentation](https://github.com/MouseLand/cellpose)\n\n3. [ImageJ: A great tool to explore microscopy images with](https://github.com/imagej/imagej). ImageJ is also available as [FIJI](https://github.com/fiji/fiji) and as a [web app on Imjoy](https://ij.imjoy.io/).",
    "1173113": "Just tried the code for segmenting individual cells. Got the following error:\n```\nImportError: cannot import name 'isStringType' from 'PIL._util' (/opt/conda/lib/python3.7/site-packages/PIL/_util.py)\n```\nMore on that in [this github issue](https://github.com/CellProfiling/HPA-Cell-Segmentation/issues/15) where I also shared the call stack."
  }
}