Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
13 |
# Load the image processor and the model
|
14 |
# The model is loaded once and cached for all subsequent inference calls
|
15 |
print("Loading model...")
|
16 |
-
processor = AutoImageProcessor.from_pretrained("
|
17 |
-
model = Mask2FormerForUniversalSegmentation.from_pretrained("
|
18 |
print("Model loaded successfully.")
|
19 |
|
20 |
# Define the classes we are interested in.
|
|
|
13 |
# Load the image processor and the model
|
14 |
# The model is loaded once and cached for all subsequent inference calls
|
15 |
print("Loading model...")
|
16 |
+
processor = AutoImageProcessor.from_pretrained("facebook/mask2former-swin-tiny-coco-instance")
|
17 |
+
model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-tiny-coco-instance").to(device)
|
18 |
print("Model loaded successfully.")
|
19 |
|
20 |
# Define the classes we are interested in.
|