Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,13 +23,16 @@ from transformers import AutoProcessor, AutoModelForCausalLM, pipeline
|
|
| 23 |
import requests
|
| 24 |
|
| 25 |
try:
|
| 26 |
-
from
|
| 27 |
except ImportError:
|
| 28 |
import subprocess
|
| 29 |
-
subprocess.run([sys.executable, "-m", "pip", "install", "
|
|
|
|
|
|
|
| 30 |
subprocess.run(["git", "clone", "https://github.com/xinntao/Real-ESRGAN.git", "/tmp/Real-ESRGAN"], check=True)
|
|
|
|
| 31 |
subprocess.run([sys.executable, "setup.py", "develop"], cwd="/tmp/Real-ESRGAN", check=True)
|
| 32 |
-
from
|
| 33 |
|
| 34 |
def download_file(url, folder_path, filename):
|
| 35 |
if not os.path.exists(folder_path):
|
|
|
|
| 23 |
import requests
|
| 24 |
|
| 25 |
try:
|
| 26 |
+
from realesrgan import RealESRGAN
|
| 27 |
except ImportError:
|
| 28 |
import subprocess
|
| 29 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "basicsr"], check=True)
|
| 30 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "facexlib"], check=True)
|
| 31 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "gfpgan"], check=True)
|
| 32 |
subprocess.run(["git", "clone", "https://github.com/xinntao/Real-ESRGAN.git", "/tmp/Real-ESRGAN"], check=True)
|
| 33 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "-r", "/tmp/Real-ESRGAN/requirements.txt"], check=True)
|
| 34 |
subprocess.run([sys.executable, "setup.py", "develop"], cwd="/tmp/Real-ESRGAN", check=True)
|
| 35 |
+
from realesrgan import RealESRGAN
|
| 36 |
|
| 37 |
def download_file(url, folder_path, filename):
|
| 38 |
if not os.path.exists(folder_path):
|