update
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ import torch.nn.functional as F
|
|
| 6 |
from models.arch.RDnet_ import FullNet_NLP
|
| 7 |
from models.arch.classifier import PretrainedConvNext
|
| 8 |
import torchvision.transforms.functional as TF
|
|
|
|
| 9 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 10 |
# True
|
| 11 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
@@ -26,6 +27,7 @@ def align(x1):
|
|
| 26 |
h, w = h // 32 * 32, w // 32 * 32
|
| 27 |
x1 = np.resize(x1, (h, w, x1.shape[2]))
|
| 28 |
return x1
|
|
|
|
| 29 |
def predict(img):
|
| 30 |
with torch.no_grad():
|
| 31 |
img=align(img)
|
|
|
|
| 6 |
from models.arch.RDnet_ import FullNet_NLP
|
| 7 |
from models.arch.classifier import PretrainedConvNext
|
| 8 |
import torchvision.transforms.functional as TF
|
| 9 |
+
import spaces
|
| 10 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 11 |
# True
|
| 12 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
|
|
| 27 |
h, w = h // 32 * 32, w // 32 * 32
|
| 28 |
x1 = np.resize(x1, (h, w, x1.shape[2]))
|
| 29 |
return x1
|
| 30 |
+
@spaces.GPU(duration=120)
|
| 31 |
def predict(img):
|
| 32 |
with torch.no_grad():
|
| 33 |
img=align(img)
|
models/arch/__pycache__/RDnet_.cpython-310.pyc
CHANGED
|
Binary files a/models/arch/__pycache__/RDnet_.cpython-310.pyc and b/models/arch/__pycache__/RDnet_.cpython-310.pyc differ
|
|
|
models/arch/__pycache__/classifier.cpython-310.pyc
CHANGED
|
Binary files a/models/arch/__pycache__/classifier.cpython-310.pyc and b/models/arch/__pycache__/classifier.cpython-310.pyc differ
|
|
|
models/arch/__pycache__/focalnet.cpython-310.pyc
CHANGED
|
Binary files a/models/arch/__pycache__/focalnet.cpython-310.pyc and b/models/arch/__pycache__/focalnet.cpython-310.pyc differ
|
|
|
models/arch/__pycache__/modules_sig.cpython-310.pyc
CHANGED
|
Binary files a/models/arch/__pycache__/modules_sig.cpython-310.pyc and b/models/arch/__pycache__/modules_sig.cpython-310.pyc differ
|
|
|
models/arch/__pycache__/reverse_function.cpython-310.pyc
CHANGED
|
Binary files a/models/arch/__pycache__/reverse_function.cpython-310.pyc and b/models/arch/__pycache__/reverse_function.cpython-310.pyc differ
|
|
|