abhishek HF staff commited on
Commit
125bdfb
1 Parent(s): a1593c2

add weights

Browse files
Files changed (2) hide show
  1. app.py +1 -7
  2. sam_vit_h_4b8939.pth +3 -0
app.py CHANGED
@@ -8,18 +8,12 @@ from diffusers import ControlNetModel
8
  from diffusers import UniPCMultistepScheduler
9
  from controlnet_inpaint import StableDiffusionControlNetInpaintPipeline
10
  import colorsys
11
- import urllib.request
12
-
13
- url = "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth"
14
- filename = "sam_vit_h_4b8939.pth"
15
-
16
- urllib.request.urlretrieve(url, filename)
17
-
18
 
19
  sam_checkpoint = "sam_vit_h_4b8939.pth"
20
  model_type = "vit_h"
21
  device = "cuda"
22
 
 
23
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
24
  sam.to(device=device)
25
  predictor = SamPredictor(sam)
 
8
  from diffusers import UniPCMultistepScheduler
9
  from controlnet_inpaint import StableDiffusionControlNetInpaintPipeline
10
  import colorsys
 
 
 
 
 
 
 
11
 
12
  sam_checkpoint = "sam_vit_h_4b8939.pth"
13
  model_type = "vit_h"
14
  device = "cuda"
15
 
16
+
17
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
18
  sam.to(device=device)
19
  predictor = SamPredictor(sam)
sam_vit_h_4b8939.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7bf3b02f3ebf1267aba913ff637d9a2d5c33d3173bb679e46d9f338c26f262e
3
+ size 2564550879