flaviagiammarino commited on
Commit
5622644
1 Parent(s): 6d5afa0

Upload 2 files

Browse files
Files changed (2) hide show
  1. scripts/pt_example.py +2 -2
  2. scripts/tf_example.py +1 -1
scripts/pt_example.py CHANGED
@@ -10,7 +10,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
10
  model = SamModel.from_pretrained("flaviagiammarino/medsam-vit-base").to(device)
11
  processor = SamProcessor.from_pretrained("flaviagiammarino/medsam-vit-base")
12
 
13
- img_url = "https://raw.githubusercontent.com/bowang-lab/MedSAM/main/assets/img_demo.png"
14
  raw_image = Image.open(requests.get(img_url, stream=True).raw).convert("RGB")
15
  input_boxes = [95., 255., 190., 350.]
16
 
@@ -42,4 +42,4 @@ show_mask(mask=probs[0] > 0.5, ax=ax[1], random_color=False)
42
  show_box(input_boxes, ax[1])
43
  ax[1].set_title("MedSAM Segmentation")
44
  ax[1].axis("off")
45
- plt.show()
 
10
  model = SamModel.from_pretrained("flaviagiammarino/medsam-vit-base").to(device)
11
  processor = SamProcessor.from_pretrained("flaviagiammarino/medsam-vit-base")
12
 
13
+ img_url = "https://huggingface.co/flaviagiammarino/medsam-vit-base/resolve/main/scripts/input.png"
14
  raw_image = Image.open(requests.get(img_url, stream=True).raw).convert("RGB")
15
  input_boxes = [95., 255., 190., 350.]
16
 
 
42
  show_box(input_boxes, ax[1])
43
  ax[1].set_title("MedSAM Segmentation")
44
  ax[1].axis("off")
45
+ plt.show()
scripts/tf_example.py CHANGED
@@ -8,7 +8,7 @@ import tensorflow as tf
8
  model = TFSamModel.from_pretrained("flaviagiammarino/medsam-vit-base")
9
  processor = SamProcessor.from_pretrained("flaviagiammarino/medsam-vit-base")
10
 
11
- img_url = "https://raw.githubusercontent.com/bowang-lab/MedSAM/main/assets/img_demo.png"
12
  raw_image = Image.open(requests.get(img_url, stream=True).raw).convert("RGB")
13
  input_boxes = [95., 255., 190., 350.]
14
 
 
8
  model = TFSamModel.from_pretrained("flaviagiammarino/medsam-vit-base")
9
  processor = SamProcessor.from_pretrained("flaviagiammarino/medsam-vit-base")
10
 
11
+ img_url = "https://huggingface.co/flaviagiammarino/medsam-vit-base/resolve/main/scripts/input.png"
12
  raw_image = Image.open(requests.get(img_url, stream=True).raw).convert("RGB")
13
  input_boxes = [95., 255., 190., 350.]
14