load model
Browse files- .gitignore +1 -0
- app.py +2 -1
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
env*
|
app.py
CHANGED
@@ -3,7 +3,8 @@ import numpy as np
|
|
3 |
import cv2
|
4 |
from PIL import Image
|
5 |
import spaces
|
6 |
-
|
|
|
7 |
|
8 |
def preprocess_image(image):
|
9 |
return image, gr.State([]), gr.State([]), image, None
|
|
|
3 |
import cv2
|
4 |
from PIL import Image
|
5 |
import spaces
|
6 |
+
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
7 |
+
predictor = SAM2ImagePredictor.from_pretrained("facebook/sam2-hiera-small",device="cpu")
|
8 |
|
9 |
def preprocess_image(image):
|
10 |
return image, gr.State([]), gr.State([]), image, None
|