Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import AutoProcessor, AutoModelForMaskGeneration
|
|
|
3 |
from transformers import pipeline
|
4 |
from PIL import Image, ImageOps
|
5 |
# from PIL import Image
|
@@ -11,11 +12,13 @@ from io import BytesIO
|
|
11 |
|
12 |
def main():
|
13 |
st.title("Image Segmentation w/ Object Detection")
|
14 |
-
st.subheader("models :
|
15 |
|
16 |
# Load SAM by Facebook
|
17 |
-
processor = AutoProcessor.from_pretrained("facebook/sam-vit-huge")
|
18 |
-
model = AutoModelForMaskGeneration.from_pretrained("facebook/sam-vit-huge")
|
|
|
|
|
19 |
# Load Object Detection
|
20 |
od_pipe = pipeline("object-detection", "facebook/detr-resnet-50")
|
21 |
|
|
|
1 |
import streamlit as st
|
2 |
+
# from transformers import AutoProcessor, AutoModelForMaskGeneration
|
3 |
+
from transformers import SamModel, SamProcessor
|
4 |
from transformers import pipeline
|
5 |
from PIL import Image, ImageOps
|
6 |
# from PIL import Image
|
|
|
12 |
|
13 |
def main():
|
14 |
st.title("Image Segmentation w/ Object Detection")
|
15 |
+
st.subheader("models : Zigeng/SlimSAM-uniform-77, facebook/detr-resnet-50")
|
16 |
|
17 |
# Load SAM by Facebook
|
18 |
+
# processor = AutoProcessor.from_pretrained("facebook/sam-vit-huge")
|
19 |
+
# model = AutoModelForMaskGeneration.from_pretrained("facebook/sam-vit-huge")
|
20 |
+
model = SamModel.from_pretrained("Zigeng/SlimSAM-uniform-77")
|
21 |
+
processor = SamProcessor.from_pretrained("Zigeng/SlimSAM-uniform-77")
|
22 |
# Load Object Detection
|
23 |
od_pipe = pipeline("object-detection", "facebook/detr-resnet-50")
|
24 |
|