Trying to segment a jpg image using a model trained on Nifti files

Shatha_Alotaibi: <p>Hi…<br>
I am a beginner in medical programming…but I try hard to finish this project<br>
I used this model from Kaggle to build a model to segment liver tumors: <a href="https://www.kaggle.com/code/lironb/liver-segmentation-with-monai/notebook" class="inline-onebox" rel="noopener nofollow ugc">liver segmentation with MONAI | Kaggle</a><br>
here they deal with task 3 from the MSD dataset, which contains Nifti files</p>
<p>the code has some issues, like the class Toliver<br>
but I said that I will deal with it later</p>
<p>Now…<br>
I have 3 folders containing JPG images for the liver…each folder is class. For example, the first is normal, the second is benign, and the third is malignant.</p>
<p>I want to use the model to segment these JPG images, which I did (but I got an error :ValueError: Sequence must have length 2, got 3.):</p>
<p>Note (I am working on two images only to make it easy for me to track the errors)</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/2/a2d45bc5450f4a750e00a45f3ae4bc797e7cdc0d.png" data-download-href="https://discuss.pytorch.org/uploads/default/a2d45bc5450f4a750e00a45f3ae4bc797e7cdc0d" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/a/2/a2d45bc5450f4a750e00a45f3ae4bc797e7cdc0d.png" alt="image" data-base62-sha1="neskdJX3E7JlBZ3124w8lq1ycR7" width="561" height="500" data-dominant-color="F1F1F1"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">803×715 29.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/6/a6e40bef5b855f8f243f28041e04c17b29b20230.png" data-download-href="https://discuss.pytorch.org/uploads/default/a6e40bef5b855f8f243f28041e04c17b29b20230" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/a/6/a6e40bef5b855f8f243f28041e04c17b29b20230.png" alt="image" data-base62-sha1="nOnQyF2dxSyOzDiOXAiLBaG3fsA" width="586" height="500" data-dominant-color="F2F2F2"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">719×613 12.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/9/c9e92fb18be11f9c9fb4c314f6c2a8a344ce36eb.png" data-download-href="https://discuss.pytorch.org/uploads/default/c9e92fb18be11f9c9fb4c314f6c2a8a344ce36eb" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/c/9/c9e92fb18be11f9c9fb4c314f6c2a8a344ce36eb.png" alt="image" data-base62-sha1="sObzozRb1ryd4fI9BoVRWx50DO3" width="690" height="255" data-dominant-color="F3F3F3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1123×416 13.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/b/6/b6081041138575dd1941f826b64c9a3b32c42619.png" data-download-href="https://discuss.pytorch.org/uploads/default/b6081041138575dd1941f826b64c9a3b32c42619" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/b/6/b6081041138575dd1941f826b64c9a3b32c42619.png" alt="image" data-base62-sha1="pYkaSUCB49g4bbIpoL7B9jvlSzv" width="690" height="458" data-dominant-color="F5F5F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1021×678 31.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>here, I tested the output and got this :<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/b/fb562e10d16df723615cfa9937bf3444ee545a63.png" data-download-href="https://discuss.pytorch.org/uploads/default/fb562e10d16df723615cfa9937bf3444ee545a63" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/f/b/fb562e10d16df723615cfa9937bf3444ee545a63.png" alt="image" data-base62-sha1="zRqu3qe2dwUkANqIyL86SRbCTSj" width="690" height="201" data-dominant-color="F6F7F6"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1377×403 11.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>from where the ‘foreground_start_coord’ is and how I can fix my program …pls help me</p>