Spaces:
Runtime error
Runtime error
namkwonwoo
commited on
Commit
·
af36da7
1
Parent(s):
8e83a0a
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,23 @@ import matplotlib.pyplot as plt
|
|
5 |
import numpy as np
|
6 |
from PIL import Image
|
7 |
import tensorflow as tf
|
8 |
-
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
"mattmdjaga/segformer_b2_clothes"
|
12 |
)
|
13 |
-
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
14 |
"mattmdjaga/segformer_b2_clothes"
|
15 |
)
|
16 |
|
|
|
5 |
import numpy as np
|
6 |
from PIL import Image
|
7 |
import tensorflow as tf
|
|
|
8 |
|
9 |
+
# Use a pipeline as a high-level helper
|
10 |
+
from transformers import pipeline
|
11 |
+
|
12 |
+
pipe = pipeline("image-segmentation", model="mattmdjaga/segformer_b2_clothes")
|
13 |
+
|
14 |
+
from transformers import AutoFeatureExtractor, SegformerForSemanticSegmentation
|
15 |
+
|
16 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained("mattmdjaga/segformer_b2_clothes")
|
17 |
+
model = SegformerForSemanticSegmentation.from_pretrained("mattmdjaga/segformer_b2_clothes")
|
18 |
+
|
19 |
+
#from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
20 |
+
|
21 |
+
#feature_extractor = SegformerFeatureExtractor.from_pretrained(
|
22 |
"mattmdjaga/segformer_b2_clothes"
|
23 |
)
|
24 |
+
#model = TFSegformerForSemanticSegmentation.from_pretrained(
|
25 |
"mattmdjaga/segformer_b2_clothes"
|
26 |
)
|
27 |
|