Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ class Classifier:
|
|
| 19 |
"Canopied",
|
| 20 |
]
|
| 21 |
|
| 22 |
-
@
|
| 23 |
def __init__(
|
| 24 |
self, model_path="Litton-7type-visual-landscape-model.pth", device="cuda:0"
|
| 25 |
):
|
|
@@ -41,7 +41,7 @@ class Classifier:
|
|
| 41 |
]
|
| 42 |
)
|
| 43 |
|
| 44 |
-
@
|
| 45 |
def predict(self, image: Image.Image) -> tuple[Literal["Failed", "Success"], Any]:
|
| 46 |
image = image.convert("RGB")
|
| 47 |
input_tensor = self.preprocess(image).unsqueeze(0).to(self.device)
|
|
|
|
| 19 |
"Canopied",
|
| 20 |
]
|
| 21 |
|
| 22 |
+
@spaces.GPU(duration=60)
|
| 23 |
def __init__(
|
| 24 |
self, model_path="Litton-7type-visual-landscape-model.pth", device="cuda:0"
|
| 25 |
):
|
|
|
|
| 41 |
]
|
| 42 |
)
|
| 43 |
|
| 44 |
+
@spaces.GPU(duration=60)
|
| 45 |
def predict(self, image: Image.Image) -> tuple[Literal["Failed", "Success"], Any]:
|
| 46 |
image = image.convert("RGB")
|
| 47 |
input_tensor = self.preprocess(image).unsqueeze(0).to(self.device)
|