Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,6 @@ from PIL import Image
|
|
| 17 |
from segment_anything import sam_model_registry, SamPredictor
|
| 18 |
|
| 19 |
|
| 20 |
-
|
| 21 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 22 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
| 23 |
print(torch.version.cuda)
|
|
@@ -29,8 +28,7 @@ model_type = "vit_h"
|
|
| 29 |
device = "cuda"
|
| 30 |
sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
|
| 31 |
|
| 32 |
-
|
| 33 |
-
@spaces.GPU(duration=10)
|
| 34 |
def generate_image(prompt, image):
|
| 35 |
sam.to(device=device)
|
| 36 |
predictor = SamPredictor(sam)
|
|
|
|
| 17 |
from segment_anything import sam_model_registry, SamPredictor
|
| 18 |
|
| 19 |
|
|
|
|
| 20 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 21 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
| 22 |
print(torch.version.cuda)
|
|
|
|
| 28 |
device = "cuda"
|
| 29 |
sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
|
| 30 |
|
| 31 |
+
@spaces.GPU(duration=11)
|
|
|
|
| 32 |
def generate_image(prompt, image):
|
| 33 |
sam.to(device=device)
|
| 34 |
predictor = SamPredictor(sam)
|