Spaces:
Sleeping
Sleeping
Reverted back to CPU
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ cwd = os.getcwd()
|
|
| 26 |
print("Current working directory:", cwd)
|
| 27 |
|
| 28 |
# Installing dependencies not in requirements.txt
|
| 29 |
-
|
| 30 |
def install_add_dependencies():
|
| 31 |
print("inside install_add_dependencies")
|
| 32 |
print(torch.cuda.is_available())
|
|
@@ -43,7 +43,7 @@ build_custom_prompter()
|
|
| 43 |
from gradio_image_prompter import ImagePrompter
|
| 44 |
print("torch version")
|
| 45 |
print(torch.version.cuda)
|
| 46 |
-
install_add_dependencies()
|
| 47 |
|
| 48 |
class AppSteps(Enum):
|
| 49 |
JUST_TEXT = 1
|
|
@@ -112,7 +112,7 @@ def get_args_parser():
|
|
| 112 |
parser.add_argument("--amp", action="store_true", help="Train with mixed precision")
|
| 113 |
return parser
|
| 114 |
|
| 115 |
-
|
| 116 |
# Get counting model.
|
| 117 |
def build_model_and_transforms(args):
|
| 118 |
normalize = T.Compose(
|
|
@@ -308,7 +308,7 @@ def count(image, text, prompts, state, device):
|
|
| 308 |
out_label = "Nothing specified to detect."
|
| 309 |
return (gr.Image(output_img, visible=True, label=out_label, show_label=True), gr.Number(label="Predicted Count", visible=True, value=boxes.shape[0]), new_submit_btn, gr.Tab(visible=True), step_3, state)
|
| 310 |
|
| 311 |
-
|
| 312 |
def count_main(image, text, prompts, device):
|
| 313 |
keywords = "" # do not handle this for now
|
| 314 |
# Handle no prompt case.
|
|
|
|
| 26 |
print("Current working directory:", cwd)
|
| 27 |
|
| 28 |
# Installing dependencies not in requirements.txt
|
| 29 |
+
#@spaces.GPU
|
| 30 |
def install_add_dependencies():
|
| 31 |
print("inside install_add_dependencies")
|
| 32 |
print(torch.cuda.is_available())
|
|
|
|
| 43 |
from gradio_image_prompter import ImagePrompter
|
| 44 |
print("torch version")
|
| 45 |
print(torch.version.cuda)
|
| 46 |
+
#install_add_dependencies()
|
| 47 |
|
| 48 |
class AppSteps(Enum):
|
| 49 |
JUST_TEXT = 1
|
|
|
|
| 112 |
parser.add_argument("--amp", action="store_true", help="Train with mixed precision")
|
| 113 |
return parser
|
| 114 |
|
| 115 |
+
#@spaces.GPU
|
| 116 |
# Get counting model.
|
| 117 |
def build_model_and_transforms(args):
|
| 118 |
normalize = T.Compose(
|
|
|
|
| 308 |
out_label = "Nothing specified to detect."
|
| 309 |
return (gr.Image(output_img, visible=True, label=out_label, show_label=True), gr.Number(label="Predicted Count", visible=True, value=boxes.shape[0]), new_submit_btn, gr.Tab(visible=True), step_3, state)
|
| 310 |
|
| 311 |
+
#@spaces.GPU
|
| 312 |
def count_main(image, text, prompts, device):
|
| 313 |
keywords = "" # do not handle this for now
|
| 314 |
# Handle no prompt case.
|