Update app.py
Browse files
app.py
CHANGED
@@ -10,16 +10,24 @@ import subprocess
|
|
10 |
from glob import glob
|
11 |
import requests
|
12 |
|
13 |
-
|
14 |
-
def
|
15 |
try:
|
16 |
-
subprocess.check_call([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
except subprocess.CalledProcessError as e:
|
18 |
-
print(
|
19 |
-
sys.exit(1)
|
20 |
|
21 |
-
#
|
22 |
-
|
23 |
|
24 |
def remove_background(input_url):
|
25 |
# Create a temporary folder for downloaded and processed images
|
|
|
10 |
from glob import glob
|
11 |
import requests
|
12 |
|
13 |
+
|
14 |
+
def install_torch_scatter():
|
15 |
try:
|
16 |
+
subprocess.check_call([
|
17 |
+
sys.executable,
|
18 |
+
"-m",
|
19 |
+
"pip",
|
20 |
+
"install",
|
21 |
+
"--no-build-isolation",
|
22 |
+
"torch-scatter==2.1.2"
|
23 |
+
])
|
24 |
+
print("torch-scatter installed successfully.")
|
25 |
except subprocess.CalledProcessError as e:
|
26 |
+
print("Error occurred while installing torch-scatter:", e)
|
27 |
+
sys.exit(1)
|
28 |
|
29 |
+
# Call the function during your app's initialization
|
30 |
+
install_torch_scatter()
|
31 |
|
32 |
def remove_background(input_url):
|
33 |
# Create a temporary folder for downloaded and processed images
|