Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,9 +31,9 @@ if raw_image != 'Select image':
|
|
| 31 |
image = np.asarray(image)
|
| 32 |
|
| 33 |
with st.spinner('Loading Model...'):
|
| 34 |
-
|
| 35 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 36 |
-
|
| 37 |
model = model.to(device)
|
| 38 |
model.eval()
|
| 39 |
|
|
|
|
| 31 |
image = np.asarray(image)
|
| 32 |
|
| 33 |
with st.spinner('Loading Model...'):
|
| 34 |
+
feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large-ade")
|
| 35 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 36 |
+
model = DPTForSemanticSegmentation.from_pretrained("Intel/dpt-large-ade",ignore_mismatched_sizes=True,num_labels=len(id2label), id2label=id2label, label2id=label2id,reshape_last_stage=True)
|
| 37 |
model = model.to(device)
|
| 38 |
model.eval()
|
| 39 |
|