{
  "id": 473698,
  "title": "[HELP] SOME QUESTIONS ABOUT PRIVATE DATA",
  "url": "/competitions/blood-vessel-segmentation/discussion/473698",
  "author_name": "",
  "post_date": "2024-02-05T19:37:59.058411800Z",
  "votes": 2,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hello, Every computer vision engineer, I am really new here. This is my first competition.<br>\nSo I have some questions when the dataset change to the private.</p>\n<p>First of all , how to upload img ??🤣🤣🤣 I am sorrrrrrrrrrry…..</p>\n<p><strong>1 , About the path</strong></p>\n<p>All my work base on helpful open source solutions of 0.859&amp;0.860 LB. ( learn a lot ,Thanks !!!!!</p>\n<p><a href=\"https://www.kaggle.com/code/bhavyadhingra00020/clean-code-weighted-ensemble-inference\" target=\"_blank\">Clean Code 📚| Weighted Ensemble [Inference]</a></p>\n<p>In this solution, dalao use absolute path to determine the submission state and the original size of image. What will happen when dataset change to private???</p>\n<pre><code>\nis_submit = (glob()) != \n\n\noutput, ids = get_output( is_submit)\n\n\nTH = [x.flatten().numpy()  x  output]\nTH = np.concatenate(TH)\nindex = -((TH) * CFG.th_percentile)\nTH:  = np.partition(TH, index)[index]\n(TH)\n\n\nimg = cv2.imread(, cv2.IMREAD_GRAYSCALE)\n</code></pre>\n<p>inference from the runtime (tqdm time in log) , I guess we just inference kidney_5? where is kidney_6?  Is it the private one ?  We may have bug when the tif size different in kidney_6 and kidney_5.</p>\n<p>Should I change to : ？？？？？？</p>\n<pre><code>img=[]\n is_submit:\n    paths = glob()\n     path  paths:\n        tif_path=glob()[]\n        img.append(cv2.imread(tif_path, cv2.IMREAD_GRAYSCALE))\n:\n    img = [cv2.imread(, cv2.IMREAD_GRAYSCALE)]\n\n\n</code></pre>\n<p>What will happen when data change to private??</p>\n<p><strong>2 , the voxel size</strong></p>\n<p>As the LB leader said, there is a difference between the public and private. </p>\n<p>\"\"\"\"\"\"<br>\nPublic Test:<br>\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 25.14um/voxel and binned to 50.28um/voxel (bin x2) before segmentation.</p>\n<p>Private Test:<br>\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 15.77um/voxel binned to 63.08um/voxel (bin x4) before segmentation.</p>\n<p>\"\"\"\"\"\"</p>\n<p><a href=\"https://www.kaggle.com/competitions/blood-vessel-segmentation/discussion/456118\" target=\"_blank\">[lb0.870 !!!] experiment results, hopefully open gold solution till 21-jan-2024</a></p>\n<p>I understand standard coordinate is important. but in 2.5D interface, should we just resize xy? or xyz ? </p>\n<p>should I change this : ???</p>\n<pre><code>\n ():\n     ():\n        self.paths = glob(path + )\n        self.paths.sort()\n        self. = s == \n\n     ():\n         (self.paths)\n\n     ():\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n         self.:\n            img = img.to(tc.)\n        :\n            img = img.to(tc.uint8)\n         img\n</code></pre>\n<p>to this:</p>\n<pre><code>private= \nbase = \ns = base/private\n\n\n ():\n     ():\n        self.paths = glob(path + )\n        self.paths.sort()\n        self. = s == \n\n     ():\n         (self.paths)\n\n     ():\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = cv2.resize(img,dsize=, fx=s,fy=s)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n         self.:\n            img = img.to(tc.)\n        :\n            img = img.to(tc.uint8)\n         img\n</code></pre>\n<p>and there:</p>\n<pre><code>\n ():\n    top_ = \n    left_ = \n\n    \n     im_after.shape[] &gt; img.shape[]:\n        top_ = (image_size - img.shape[]) // \n\n    \n     im_after.shape[] &gt; img.shape[]:\n        left_ = (image_size - img.shape[]) // \n\n    \n     (top_ &gt; )  (left_ &gt; ):\n        img_result = im_after[top_: img.shape[] + top_, left_: img.shape[] + left_]\n    :\n        img_result = im_after\n\n     img_result\n</code></pre>\n<p>to : </p>\n<pre><code>private= \nbase = \ns = base/private\n\n ():\n    top_ = \n    left_ = \n    H,W = image.shape\n    img = cv2.resize(img,dsize=, fx=s,fy=s)\n\n    \n     im_after.shape[] &gt; img.shape[]:\n        top_ = (image_size - img.shape[]) // \n\n    \n     im_after.shape[] &gt; img.shape[]:\n        left_ = (image_size - img.shape[]) // \n\n    \n     (top_ &gt; )  (left_ &gt; ):\n        img_result = im_after[top_: img.shape[] + top_, left_: img.shape[] + left_]\n    :\n        img_result = im_after\n\n    img_result = cv2.resize(img_result,dsize=(W,H))\n     img_result\n</code></pre>\n<p>Does it correct?  😑 It will get lower LB, as we treat 50(public) as private(63)<br>\nSo I also need to select this lower LB notebook instand of the highest one .</p>\n<p>Anything else?</p>\n<p>Oh , Can we change the private notebook? or when the last day comes, The notebook we select will be used in private automatically. even when it meet bug (something unexpectedly<br>\n), we cannot fix the problem and get 0???</p>\n<p>Thanks all. really learned a lot in these three months 🎉⭐</p>",
  "messages": [
    {
      "id": "2637585",
      "postDate": "02/05/2024 19:37:59",
      "content": "<p>Hello, Every computer vision engineer, I am really new here. This is my first competition.<br>\nSo I have some questions when the dataset change to the private.</p>\n<p>First of all , how to upload img ??🤣🤣🤣 I am sorrrrrrrrrrry…..</p>\n<p><strong>1 , About the path</strong></p>\n<p>All my work base on helpful open source solutions of 0.859&amp;0.860 LB. ( learn a lot ,Thanks !!!!!</p>\n<p><a href=\"https://www.kaggle.com/code/bhavyadhingra00020/clean-code-weighted-ensemble-inference\" target=\"_blank\">Clean Code 📚| Weighted Ensemble [Inference]</a></p>\n<p>In this solution, dalao use absolute path to determine the submission state and the original size of image. What will happen when dataset change to private???</p>\n<pre><code>\nis_submit = (glob()) != \n\n\noutput, ids = get_output( is_submit)\n\n\nTH = [x.flatten().numpy()  x  output]\nTH = np.concatenate(TH)\nindex = -((TH) * CFG.th_percentile)\nTH:  = np.partition(TH, index)[index]\n(TH)\n\n\nimg = cv2.imread(, cv2.IMREAD_GRAYSCALE)\n</code></pre>\n<p>inference from the runtime (tqdm time in log) , I guess we just inference kidney_5? where is kidney_6?  Is it the private one ?  We may have bug when the tif size different in kidney_6 and kidney_5.</p>\n<p>Should I change to : ？？？？？？</p>\n<pre><code>img=[]\n is_submit:\n    paths = glob()\n     path  paths:\n        tif_path=glob()[]\n        img.append(cv2.imread(tif_path, cv2.IMREAD_GRAYSCALE))\n:\n    img = [cv2.imread(, cv2.IMREAD_GRAYSCALE)]\n\n\n</code></pre>\n<p>What will happen when data change to private??</p>\n<p><strong>2 , the voxel size</strong></p>\n<p>As the LB leader said, there is a difference between the public and private. </p>\n<p>\"\"\"\"\"\"<br>\nPublic Test:<br>\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 25.14um/voxel and binned to 50.28um/voxel (bin x2) before segmentation.</p>\n<p>Private Test:<br>\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 15.77um/voxel binned to 63.08um/voxel (bin x4) before segmentation.</p>\n<p>\"\"\"\"\"\"</p>\n<p><a href=\"https://www.kaggle.com/competitions/blood-vessel-segmentation/discussion/456118\" target=\"_blank\">[lb0.870 !!!] experiment results, hopefully open gold solution till 21-jan-2024</a></p>\n<p>I understand standard coordinate is important. but in 2.5D interface, should we just resize xy? or xyz ? </p>\n<p>should I change this : ???</p>\n<pre><code>\n ():\n     ():\n        self.paths = glob(path + )\n        self.paths.sort()\n        self. = s == \n\n     ():\n         (self.paths)\n\n     ():\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n         self.:\n            img = img.to(tc.)\n        :\n            img = img.to(tc.uint8)\n         img\n</code></pre>\n<p>to this:</p>\n<pre><code>private= \nbase = \ns = base/private\n\n\n ():\n     ():\n        self.paths = glob(path + )\n        self.paths.sort()\n        self. = s == \n\n     ():\n         (self.paths)\n\n     ():\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = cv2.resize(img,dsize=, fx=s,fy=s)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n         self.:\n            img = img.to(tc.)\n        :\n            img = img.to(tc.uint8)\n         img\n</code></pre>\n<p>and there:</p>\n<pre><code>\n ():\n    top_ = \n    left_ = \n\n    \n     im_after.shape[] &gt; img.shape[]:\n        top_ = (image_size - img.shape[]) // \n\n    \n     im_after.shape[] &gt; img.shape[]:\n        left_ = (image_size - img.shape[]) // \n\n    \n     (top_ &gt; )  (left_ &gt; ):\n        img_result = im_after[top_: img.shape[] + top_, left_: img.shape[] + left_]\n    :\n        img_result = im_after\n\n     img_result\n</code></pre>\n<p>to : </p>\n<pre><code>private= \nbase = \ns = base/private\n\n ():\n    top_ = \n    left_ = \n    H,W = image.shape\n    img = cv2.resize(img,dsize=, fx=s,fy=s)\n\n    \n     im_after.shape[] &gt; img.shape[]:\n        top_ = (image_size - img.shape[]) // \n\n    \n     im_after.shape[] &gt; img.shape[]:\n        left_ = (image_size - img.shape[]) // \n\n    \n     (top_ &gt; )  (left_ &gt; ):\n        img_result = im_after[top_: img.shape[] + top_, left_: img.shape[] + left_]\n    :\n        img_result = im_after\n\n    img_result = cv2.resize(img_result,dsize=(W,H))\n     img_result\n</code></pre>\n<p>Does it correct?  😑 It will get lower LB, as we treat 50(public) as private(63)<br>\nSo I also need to select this lower LB notebook instand of the highest one .</p>\n<p>Anything else?</p>\n<p>Oh , Can we change the private notebook? or when the last day comes, The notebook we select will be used in private automatically. even when it meet bug (something unexpectedly<br>\n), we cannot fix the problem and get 0???</p>\n<p>Thanks all. really learned a lot in these three months 🎉⭐</p>",
      "rawMarkdown": "Hello, Every computer vision engineer, I am really new here. This is my first competition.\nSo I have some questions when the dataset change to the private.\n\nFirst of all , how to upload img ??🤣🤣🤣 I am sorrrrrrrrrrry.....\n\n**1 , About the path**\n\nAll my work base on helpful open source solutions of 0.859&0.860 LB. ( learn a lot ,Thanks !!!!!\n\n[Clean Code 📚| Weighted Ensemble [Inference]](https://www.kaggle.com/code/bhavyadhingra00020/clean-code-weighted-ensemble-inference)\n\nIn this solution, dalao use absolute path to determine the submission state and the original size of image. What will happen when dataset change to private???\n\n```python\n# Check if it's for submission based on the presence of test images\nis_submit = len(glob(\"/kaggle/input/blood-vessel-segmentation/test/kidney_5/images/*.tif\")) != 3\n\n# Get segmentation output and associated ids\noutput, ids = get_output(not is_submit)\n\n# Calculate threshold for binary predictions\nTH = [x.flatten().numpy() for x in output]\nTH = np.concatenate(TH)\nindex = -int(len(TH) * CFG.th_percentile)\nTH: int = np.partition(TH, index)[index]\nprint(TH)\n\n# Read an example image for visualization\nimg = cv2.imread(\"/kaggle/input/blood-vessel-segmentation/test/kidney_5/images/0001.tif\", cv2.IMREAD_GRAYSCALE)\n```\n\ninference from the runtime (tqdm time in log) , I guess we just inference kidney_5? where is kidney_6?  Is it the private one ?  We may have bug when the tif size different in kidney_6 and kidney_5.\n\nShould I change to : ？？？？？？\n\n```python\nimg=[]\nif is_submit:\n    paths = glob(\"/kaggle/input/blood-vessel-segmentation/test/*\")\n    for path in paths:\n        tif_path=glob(f\"{path}/images/*\")[0]\n        img.append(cv2.imread(tif_path, cv2.IMREAD_GRAYSCALE))\nelse:\n    img = [cv2.imread(\"/kaggle/input/blood-vessel-segmentation/test/kidney_2/images/0001.tif\", cv2.IMREAD_GRAYSCALE)]\n\n# use img[i] instand\n```\n\nWhat will happen when data change to private??\n\n**2 , the voxel size**\n\nAs the LB leader said, there is a difference between the public and private. \n\n\"\"\"\"\"\"\nPublic Test:\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 25.14um/voxel and binned to 50.28um/voxel (bin x2) before segmentation.\n\nPrivate Test:\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 15.77um/voxel binned to 63.08um/voxel (bin x4) before segmentation.\n\n\"\"\"\"\"\"\n\n[[lb0.870 !!!] experiment results, hopefully open gold solution till 21-jan-2024](https://www.kaggle.com/competitions/blood-vessel-segmentation/discussion/456118)\n\nI understand standard coordinate is important. but in 2.5D interface, should we just resize xy? or xyz ? \n\nshould I change this : ???\n```python\n# Dataset class for loading images\nclass Data_loader(Dataset):\n    def __init__(self, path, s=\"/images/\"):\n        self.paths = glob(path + f\"{s}*.tif\")\n        self.paths.sort()\n        self.bool = s == \"/labels/\"\n\n    def __len__(self):\n        return len(self.paths)\n\n    def __getitem__(self, index):\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n        if self.bool:\n            img = img.to(tc.bool)\n        else:\n            img = img.to(tc.uint8)\n        return img\n```\n\nto this:\n\n```python\nprivate= 63.08\nbase = 50.00\ns = base/private\n\n# Dataset class for loading images\nclass Data_loader(Dataset):\n    def __init__(self, path, s=\"/images/\"):\n        self.paths = glob(path + f\"{s}*.tif\")\n        self.paths.sort()\n        self.bool = s == \"/labels/\"\n\n    def __len__(self):\n        return len(self.paths)\n\n    def __getitem__(self, index):\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = cv2.resize(img,dsize=None, fx=s,fy=s)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n        if self.bool:\n            img = img.to(tc.bool)\n        else:\n            img = img.to(tc.uint8)\n        return img\n\n```\n\nand there:\n```python\n# Function to resize image back to original size\ndef to_original(im_after, img, image_size=1024):\n    top_ = 0\n    left_ = 0\n    \n    # Calculate padding for top\n    if im_after.shape[0] > img.shape[0]:\n        top_ = (image_size - img.shape[0]) // 2\n    \n    # Calculate padding for left\n    if im_after.shape[1] > img.shape[1]:\n        left_ = (image_size - img.shape[1]) // 2\n    \n    # Extract the region of interest from the resized image\n    if (top_ > 0) or (left_ > 0):\n        img_result = im_after[top_: img.shape[0] + top_, left_: img.shape[1] + left_]\n    else:\n        img_result = im_after\n    \n    return img_result\n```\n\n\nto : \n\n\n```python\nprivate= 63.08\nbase = 50.00\ns = base/private\n# Function to resize image back to original size\ndef to_original(im_after, img, image_size=1024):\n    top_ = 0\n    left_ = 0\n    H,W = image.shape\n    img = cv2.resize(img,dsize=None, fx=s,fy=s)\n    \n    # Calculate padding for top\n    if im_after.shape[0] > img.shape[0]:\n        top_ = (image_size - img.shape[0]) // 2\n    \n    # Calculate padding for left\n    if im_after.shape[1] > img.shape[1]:\n        left_ = (image_size - img.shape[1]) // 2\n    \n    # Extract the region of interest from the resized image\n    if (top_ > 0) or (left_ > 0):\n        img_result = im_after[top_: img.shape[0] + top_, left_: img.shape[1] + left_]\n    else:\n        img_result = im_after\n    \n    img_result = cv2.resize(img_result,dsize=(W,H))\n    return img_result\n```\n\nDoes it correct?  😑 It will get lower LB, as we treat 50(public) as private(63)\nSo I also need to select this lower LB notebook instand of the highest one .\n\nAnything else?\n\nOh , Can we change the private notebook? or when the last day comes, The notebook we select will be used in private automatically. even when it meet bug (something unexpectedly\n), we cannot fix the problem and get 0???\n\nThanks all. really learned a lot in these three months 🎉⭐",
      "votes": null
    },
    {
      "id": "2638019",
      "postDate": "02/06/2024 03:57:05",
      "content": "<p>Downscaling and upscaling it back didn’t work in my case! It reduced the score significantly. </p>",
      "rawMarkdown": "Downscaling and upscaling it back didn’t work in my case! It reduced the score significantly.",
      "votes": null
    },
    {
      "id": "2638190",
      "postDate": "02/06/2024 06:15:21",
      "content": "<p>yes, thanks for my first comment, I will record it.😃😃</p>\n<p>this also reduce in my notebook. And I guess this because :</p>\n<p>\"\"\"\"\"\"\"<br>\nFile and Field Information<br>\ntrain/{dataset}/images - Contains TIFF scans from several kidney datasets. Each image represents a 2D slice of a 3D volume. The slices run along the z-axis, with files enumerated from top to bottom. (The slices should be stacked vertically or depth-wise, in other words.)</p>\n<p>train/{dataset}/labels - Contains blood vessel segmentation masks in TIFF format for the images.<br>\nThe {dataset} folders comprise the following:</p>\n<p>kidney_1_dense - The whole of a right kidney at 50um resolution. The entire 3D arterial vascular tree has been densely segmented, down to two generations from the glomeruli (i.e. the capillary bed). Uses beamline BM05.<br>\nkidney_1_voi - A high-resolution subset of kidney_1, at 5.2um resolution.<br>\nkidney_2 - The whole of a kidney from another donor, at 50um resolution. Sparsely segmented (about 65%).<br>\nkidney_3_dense - A portion (500 slices) of a kidney at 50.16um resolution using BM05. Densely segmented. Note that we provide all of the images for kidney_3 in the kidney_3_sparse/images folder. This dataset accordingly has only a labels folder.<br>\nkidney_3_sparse - The remainder of the segmentation masks for kidney_3. Sparsely segmented (about 85%).<br>\n\"\"\"\"\"\"\"</p>\n<p>In data introduction text , kidney_1_dense and 3 even 2 are all 50um/voxel , and the public LB we also use the data of 50um/voxel. <br>\nObviously, model based on 50um will work when test also 50um.</p>\n<p>However we didn't test our model in different voxel size ( no 63.08um/voxel for reference ), <br>\nOh maybe <br>\n<strong>we can do locally may be just resize the kidney_1_dense and 3 even 2 and their labels to 63.08um/voxel by the rate 63/50.  Then we can evaluate our 50um model in 63um size.</strong></p>\n<p>enm, maybe I can try this………………<br>\nif you means resize size and test in CV………… I need to try,to try,try………….</p>",
      "rawMarkdown": "yes, thanks for my first comment, I will record it.😃😃\n\nthis also reduce in my notebook. And I guess this because :\n\n\"\"\"\"\"\"\"\nFile and Field Information\ntrain/{dataset}/images - Contains TIFF scans from several kidney datasets. Each image represents a 2D slice of a 3D volume. The slices run along the z-axis, with files enumerated from top to bottom. (The slices should be stacked vertically or depth-wise, in other words.)\n\ntrain/{dataset}/labels - Contains blood vessel segmentation masks in TIFF format for the images.\nThe {dataset} folders comprise the following:\n\nkidney_1_dense - The whole of a right kidney at 50um resolution. The entire 3D arterial vascular tree has been densely segmented, down to two generations from the glomeruli (i.e. the capillary bed). Uses beamline BM05.\nkidney_1_voi - A high-resolution subset of kidney_1, at 5.2um resolution.\nkidney_2 - The whole of a kidney from another donor, at 50um resolution. Sparsely segmented (about 65%).\nkidney_3_dense - A portion (500 slices) of a kidney at 50.16um resolution using BM05. Densely segmented. Note that we provide all of the images for kidney_3 in the kidney_3_sparse/images folder. This dataset accordingly has only a labels folder.\nkidney_3_sparse - The remainder of the segmentation masks for kidney_3. Sparsely segmented (about 85%).\n\"\"\"\"\"\"\"\n\nIn data introduction text , kidney_1_dense and 3 even 2 are all 50um/voxel , and the public LB we also use the data of 50um/voxel. \nObviously, model based on 50um will work when test also 50um.\n\nHowever we didn't test our model in different voxel size ( no 63.08um/voxel for reference ), \nOh maybe \n**we can do locally may be just resize the kidney_1_dense and 3 even 2 and their labels to 63.08um/voxel by the rate 63/50.  Then we can evaluate our 50um model in 63um size.**\n\nenm, maybe I can try this..................\nif you means resize size and test in CV............ I need to try,to try,try.............",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2638019,
      "author_name": "aravind36",
      "author_url": "",
      "post_date": "02/06/2024 03:57:05",
      "content": "<p>Downscaling and upscaling it back didn’t work in my case! It reduced the score significantly. </p>",
      "votes": null,
      "replies": [
        {
          "id": 2638190,
          "author_name": "nooneuse",
          "author_url": "",
          "post_date": "02/06/2024 06:15:21",
          "content": "<p>yes, thanks for my first comment, I will record it.😃😃</p>\n<p>this also reduce in my notebook. And I guess this because :</p>\n<p>\"\"\"\"\"\"\"<br>\nFile and Field Information<br>\ntrain/{dataset}/images - Contains TIFF scans from several kidney datasets. Each image represents a 2D slice of a 3D volume. The slices run along the z-axis, with files enumerated from top to bottom. (The slices should be stacked vertically or depth-wise, in other words.)</p>\n<p>train/{dataset}/labels - Contains blood vessel segmentation masks in TIFF format for the images.<br>\nThe {dataset} folders comprise the following:</p>\n<p>kidney_1_dense - The whole of a right kidney at 50um resolution. The entire 3D arterial vascular tree has been densely segmented, down to two generations from the glomeruli (i.e. the capillary bed). Uses beamline BM05.<br>\nkidney_1_voi - A high-resolution subset of kidney_1, at 5.2um resolution.<br>\nkidney_2 - The whole of a kidney from another donor, at 50um resolution. Sparsely segmented (about 65%).<br>\nkidney_3_dense - A portion (500 slices) of a kidney at 50.16um resolution using BM05. Densely segmented. Note that we provide all of the images for kidney_3 in the kidney_3_sparse/images folder. This dataset accordingly has only a labels folder.<br>\nkidney_3_sparse - The remainder of the segmentation masks for kidney_3. Sparsely segmented (about 85%).<br>\n\"\"\"\"\"\"\"</p>\n<p>In data introduction text , kidney_1_dense and 3 even 2 are all 50um/voxel , and the public LB we also use the data of 50um/voxel. <br>\nObviously, model based on 50um will work when test also 50um.</p>\n<p>However we didn't test our model in different voxel size ( no 63.08um/voxel for reference ), <br>\nOh maybe <br>\n<strong>we can do locally may be just resize the kidney_1_dense and 3 even 2 and their labels to 63.08um/voxel by the rate 63/50.  Then we can evaluate our 50um model in 63um size.</strong></p>\n<p>enm, maybe I can try this………………<br>\nif you means resize size and test in CV………… I need to try,to try,try………….</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2637585": "Hello, Every computer vision engineer, I am really new here. This is my first competition.\nSo I have some questions when the dataset change to the private.\n\nFirst of all , how to upload img ??🤣🤣🤣 I am sorrrrrrrrrrry.....\n\n**1 , About the path**\n\nAll my work base on helpful open source solutions of 0.859&0.860 LB. ( learn a lot ,Thanks !!!!!\n\n[Clean Code 📚| Weighted Ensemble [Inference]](https://www.kaggle.com/code/bhavyadhingra00020/clean-code-weighted-ensemble-inference)\n\nIn this solution, dalao use absolute path to determine the submission state and the original size of image. What will happen when dataset change to private???\n\n```python\n# Check if it's for submission based on the presence of test images\nis_submit = len(glob(\"/kaggle/input/blood-vessel-segmentation/test/kidney_5/images/*.tif\")) != 3\n\n# Get segmentation output and associated ids\noutput, ids = get_output(not is_submit)\n\n# Calculate threshold for binary predictions\nTH = [x.flatten().numpy() for x in output]\nTH = np.concatenate(TH)\nindex = -int(len(TH) * CFG.th_percentile)\nTH: int = np.partition(TH, index)[index]\nprint(TH)\n\n# Read an example image for visualization\nimg = cv2.imread(\"/kaggle/input/blood-vessel-segmentation/test/kidney_5/images/0001.tif\", cv2.IMREAD_GRAYSCALE)\n```\n\ninference from the runtime (tqdm time in log) , I guess we just inference kidney_5? where is kidney_6?  Is it the private one ?  We may have bug when the tif size different in kidney_6 and kidney_5.\n\nShould I change to : ？？？？？？\n\n```python\nimg=[]\nif is_submit:\n    paths = glob(\"/kaggle/input/blood-vessel-segmentation/test/*\")\n    for path in paths:\n        tif_path=glob(f\"{path}/images/*\")[0]\n        img.append(cv2.imread(tif_path, cv2.IMREAD_GRAYSCALE))\nelse:\n    img = [cv2.imread(\"/kaggle/input/blood-vessel-segmentation/test/kidney_2/images/0001.tif\", cv2.IMREAD_GRAYSCALE)]\n\n# use img[i] instand\n```\n\nWhat will happen when data change to private??\n\n**2 , the voxel size**\n\nAs the LB leader said, there is a difference between the public and private. \n\n\"\"\"\"\"\"\nPublic Test:\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 25.14um/voxel and binned to 50.28um/voxel (bin x2) before segmentation.\n\nPrivate Test:\nContinuous 3D part of a whole human kidney imaged with HiP-CT - Originally scanned at 15.77um/voxel binned to 63.08um/voxel (bin x4) before segmentation.\n\n\"\"\"\"\"\"\n\n[[lb0.870 !!!] experiment results, hopefully open gold solution till 21-jan-2024](https://www.kaggle.com/competitions/blood-vessel-segmentation/discussion/456118)\n\nI understand standard coordinate is important. but in 2.5D interface, should we just resize xy? or xyz ? \n\nshould I change this : ???\n```python\n# Dataset class for loading images\nclass Data_loader(Dataset):\n    def __init__(self, path, s=\"/images/\"):\n        self.paths = glob(path + f\"{s}*.tif\")\n        self.paths.sort()\n        self.bool = s == \"/labels/\"\n\n    def __len__(self):\n        return len(self.paths)\n\n    def __getitem__(self, index):\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n        if self.bool:\n            img = img.to(tc.bool)\n        else:\n            img = img.to(tc.uint8)\n        return img\n```\n\nto this:\n\n```python\nprivate= 63.08\nbase = 50.00\ns = base/private\n\n# Dataset class for loading images\nclass Data_loader(Dataset):\n    def __init__(self, path, s=\"/images/\"):\n        self.paths = glob(path + f\"{s}*.tif\")\n        self.paths.sort()\n        self.bool = s == \"/labels/\"\n\n    def __len__(self):\n        return len(self.paths)\n\n    def __getitem__(self, index):\n        img = cv2.imread(self.paths[index], cv2.IMREAD_GRAYSCALE)\n        img = cv2.resize(img,dsize=None, fx=s,fy=s)\n        img = to_1024_1024(img, image_size=CFG.image_size)\n\n        img = tc.from_numpy(img.copy())\n        if self.bool:\n            img = img.to(tc.bool)\n        else:\n            img = img.to(tc.uint8)\n        return img\n\n```\n\nand there:\n```python\n# Function to resize image back to original size\ndef to_original(im_after, img, image_size=1024):\n    top_ = 0\n    left_ = 0\n    \n    # Calculate padding for top\n    if im_after.shape[0] > img.shape[0]:\n        top_ = (image_size - img.shape[0]) // 2\n    \n    # Calculate padding for left\n    if im_after.shape[1] > img.shape[1]:\n        left_ = (image_size - img.shape[1]) // 2\n    \n    # Extract the region of interest from the resized image\n    if (top_ > 0) or (left_ > 0):\n        img_result = im_after[top_: img.shape[0] + top_, left_: img.shape[1] + left_]\n    else:\n        img_result = im_after\n    \n    return img_result\n```\n\n\nto : \n\n\n```python\nprivate= 63.08\nbase = 50.00\ns = base/private\n# Function to resize image back to original size\ndef to_original(im_after, img, image_size=1024):\n    top_ = 0\n    left_ = 0\n    H,W = image.shape\n    img = cv2.resize(img,dsize=None, fx=s,fy=s)\n    \n    # Calculate padding for top\n    if im_after.shape[0] > img.shape[0]:\n        top_ = (image_size - img.shape[0]) // 2\n    \n    # Calculate padding for left\n    if im_after.shape[1] > img.shape[1]:\n        left_ = (image_size - img.shape[1]) // 2\n    \n    # Extract the region of interest from the resized image\n    if (top_ > 0) or (left_ > 0):\n        img_result = im_after[top_: img.shape[0] + top_, left_: img.shape[1] + left_]\n    else:\n        img_result = im_after\n    \n    img_result = cv2.resize(img_result,dsize=(W,H))\n    return img_result\n```\n\nDoes it correct?  😑 It will get lower LB, as we treat 50(public) as private(63)\nSo I also need to select this lower LB notebook instand of the highest one .\n\nAnything else?\n\nOh , Can we change the private notebook? or when the last day comes, The notebook we select will be used in private automatically. even when it meet bug (something unexpectedly\n), we cannot fix the problem and get 0???\n\nThanks all. really learned a lot in these three months 🎉⭐",
    "2638019": "Downscaling and upscaling it back didn’t work in my case! It reduced the score significantly.",
    "2638190": "yes, thanks for my first comment, I will record it.😃😃\n\nthis also reduce in my notebook. And I guess this because :\n\n\"\"\"\"\"\"\"\nFile and Field Information\ntrain/{dataset}/images - Contains TIFF scans from several kidney datasets. Each image represents a 2D slice of a 3D volume. The slices run along the z-axis, with files enumerated from top to bottom. (The slices should be stacked vertically or depth-wise, in other words.)\n\ntrain/{dataset}/labels - Contains blood vessel segmentation masks in TIFF format for the images.\nThe {dataset} folders comprise the following:\n\nkidney_1_dense - The whole of a right kidney at 50um resolution. The entire 3D arterial vascular tree has been densely segmented, down to two generations from the glomeruli (i.e. the capillary bed). Uses beamline BM05.\nkidney_1_voi - A high-resolution subset of kidney_1, at 5.2um resolution.\nkidney_2 - The whole of a kidney from another donor, at 50um resolution. Sparsely segmented (about 65%).\nkidney_3_dense - A portion (500 slices) of a kidney at 50.16um resolution using BM05. Densely segmented. Note that we provide all of the images for kidney_3 in the kidney_3_sparse/images folder. This dataset accordingly has only a labels folder.\nkidney_3_sparse - The remainder of the segmentation masks for kidney_3. Sparsely segmented (about 85%).\n\"\"\"\"\"\"\"\n\nIn data introduction text , kidney_1_dense and 3 even 2 are all 50um/voxel , and the public LB we also use the data of 50um/voxel. \nObviously, model based on 50um will work when test also 50um.\n\nHowever we didn't test our model in different voxel size ( no 63.08um/voxel for reference ), \nOh maybe \n**we can do locally may be just resize the kidney_1_dense and 3 even 2 and their labels to 63.08um/voxel by the rate 63/50.  Then we can evaluate our 50um model in 63um size.**\n\nenm, maybe I can try this..................\nif you means resize size and test in CV............ I need to try,to try,try............."
  },
  "source": "meta"
}