Spaces:
Running
on
Zero
Running
on
Zero
update to 2.1
Browse files- app.py +2 -1
- sam2_mask.py +1 -1
app.py
CHANGED
|
@@ -13,7 +13,6 @@ from sam2_mask import create_sam2_mask_interface
|
|
| 13 |
|
| 14 |
#from sam2.sam2_image_predictor import SAM2ImagePredictor
|
| 15 |
|
| 16 |
-
sam2_mask_tab = create_sam2_mask_interface()
|
| 17 |
|
| 18 |
MODELS = {
|
| 19 |
"RealVisXL V5.0 Lightning": "SG161222/RealVisXL_V5.0_Lightning",
|
|
@@ -315,6 +314,8 @@ def clear_cache():
|
|
| 315 |
torch.cuda.empty_cache()
|
| 316 |
return gr.update(value="Cache cleared!")
|
| 317 |
|
|
|
|
|
|
|
| 318 |
css = """
|
| 319 |
.nulgradio-container {
|
| 320 |
width: 86vw !important;
|
|
|
|
| 13 |
|
| 14 |
#from sam2.sam2_image_predictor import SAM2ImagePredictor
|
| 15 |
|
|
|
|
| 16 |
|
| 17 |
MODELS = {
|
| 18 |
"RealVisXL V5.0 Lightning": "SG161222/RealVisXL_V5.0_Lightning",
|
|
|
|
| 314 |
torch.cuda.empty_cache()
|
| 315 |
return gr.update(value="Cache cleared!")
|
| 316 |
|
| 317 |
+
sam2_mask_tab = create_sam2_mask_interface()
|
| 318 |
+
|
| 319 |
css = """
|
| 320 |
.nulgradio-container {
|
| 321 |
width: 86vw !important;
|
sam2_mask.py
CHANGED
|
@@ -8,7 +8,7 @@ import numpy as np
|
|
| 8 |
from PIL import Image as PILImage
|
| 9 |
|
| 10 |
# Initialize SAM2 predictor
|
| 11 |
-
MODEL = "facebook/sam2-hiera-large"
|
| 12 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 13 |
PREDICTOR = SAM2ImagePredictor.from_pretrained(MODEL, device=DEVICE)
|
| 14 |
|
|
|
|
| 8 |
from PIL import Image as PILImage
|
| 9 |
|
| 10 |
# Initialize SAM2 predictor
|
| 11 |
+
MODEL = "facebook/sam2.1-hiera-large"
|
| 12 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 13 |
PREDICTOR = SAM2ImagePredictor.from_pretrained(MODEL, device=DEVICE)
|
| 14 |
|