Skip to content

Commit

Permalink
Windows compatibility issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rasakereh committed Jan 16, 2024
1 parent 4fcaa48 commit 84e06bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions MedSAM/MedSAMLite/MedSAMLite.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def install_dependencies(self, ctk_path):

self.run_on_background(self.download_wrapper, (file_url, filename), 'Downloading additional files...')

self.server_dir = os.path.join(ctk_path.currentPath, 'server_essentials')
self.server_dir = os.path.join(ctk_path.currentPath + '/', 'server_essentials')

dependencies = {
'PyTorch': 'torch==2.0.1 torchvision==0.15.2',
Expand Down Expand Up @@ -545,7 +545,7 @@ def captureImage(self):
self.img_sitk = sitk.ReadImage(self.img_path)
self.image_data = slicer.util.arrayFromVolume(self.volume_node) ################ Only one node?

def sendImage(self, serverUrl='http://127.0.0.1:5555', numpyServerAddress=("0.0.0.0", 5556)):
def sendImage(self, serverUrl='http://127.0.0.1:5555', numpyServerAddress=("127.0.0.1", 5556)):
if not self.server_ready:
self.run_server()
print('sending setImage request...')
Expand Down
4 changes: 3 additions & 1 deletion server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import time
import json
import os

from tqdm import tqdm
from fastapi import FastAPI, BackgroundTasks
Expand Down Expand Up @@ -62,7 +63,8 @@ def medsam_inference(medsam_model, img_embed, box_1024, height, width):

# settings and app states
SAM_MODEL_TYPE = "vit_b"
MedSAM_CKPT_PATH = "/home/rasakereh/Desktop/wanglab/MedSam/slicer-plugin/MedSAM-Slicer/medsam_lite.pth"
PARENT_DIR = os.path.dirname(os.path.abspath(__file__))
MedSAM_CKPT_PATH = os.path.join(PARENT_DIR , "medsam_lite.pth")
MEDSAM_IMG_INPUT_SIZE = 1024
device = 'cpu'#torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

Expand Down
Binary file modified server_essentials.zip
Binary file not shown.

0 comments on commit 84e06bb

Please sign in to comment.