Instead of creating a whole datalist file when running inference on a single image, this PR simplifies the inference procedure by directly loading the image using the standard Dataset/Dataloader.
Additionally, the script is also updated to output a binarized predicition thresholded at 0.5. Previously, a soft output was generated with values ranging in [0.5, 1].
Instead of creating a whole datalist file when running inference on a single image, this PR simplifies the inference procedure by directly loading the image using the standard Dataset/Dataloader.
Additionally, the script is also updated to output a binarized predicition thresholded at 0.5. Previously, a soft output was generated with values ranging in
[0.5, 1]
.The PR is the result @joshuacwnewton's suggestion https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4345#discussion_r1456523090 the review of PR https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4345.