Spaces:
Runtime error
Runtime error
Update gradio_app.py
Browse files- gradio_app.py +13 -3
gradio_app.py
CHANGED
|
@@ -47,6 +47,10 @@ from fastapi.staticfiles import StaticFiles
|
|
| 47 |
import uuid
|
| 48 |
import numpy as np
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
from hy3dshape.utils import logger
|
| 51 |
from hy3dpaint.convert_utils import create_glb_with_pbr_materials
|
| 52 |
|
|
@@ -92,8 +96,14 @@ if ENV == 'Huggingface':
|
|
| 92 |
# os.system(f"cd /home/user/app/hy3dpaint/packages/custom_rasterizer && pip install -e .")
|
| 93 |
subprocess.run(shlex.split("pip install custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl"), check=True)
|
| 94 |
|
| 95 |
-
print("cd /home/user/app/hy3dpaint/
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
# print("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P /home/user/app/hy3dpaint/ckpt")
|
| 98 |
# os.system("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P /home/user/app/hy3dpaint/ckpt")
|
| 99 |
|
|
@@ -924,4 +934,4 @@ if __name__ == '__main__':
|
|
| 924 |
from spaces import zero
|
| 925 |
zero.startup()
|
| 926 |
|
| 927 |
-
uvicorn.run(app, host=args.host, port=args.port)
|
|
|
|
| 47 |
import uuid
|
| 48 |
import numpy as np
|
| 49 |
|
| 50 |
+
# Suppress filesystem warning
|
| 51 |
+
import warnings
|
| 52 |
+
warnings.filterwarnings('ignore', message='could not get a list of mounted file-systems')
|
| 53 |
+
|
| 54 |
from hy3dshape.utils import logger
|
| 55 |
from hy3dpaint.convert_utils import create_glb_with_pbr_materials
|
| 56 |
|
|
|
|
| 96 |
# os.system(f"cd /home/user/app/hy3dpaint/packages/custom_rasterizer && pip install -e .")
|
| 97 |
subprocess.run(shlex.split("pip install custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl"), check=True)
|
| 98 |
|
| 99 |
+
print("cd /home/user/app/hy3dpaint/DifferentiableRenderer && bash compile_mesh_painter.sh")
|
| 100 |
+
# Fix: corrected path from differentiable_renderer to DifferentiableRenderer
|
| 101 |
+
if os.path.exists("/home/user/app/hy3dpaint/DifferentiableRenderer"):
|
| 102 |
+
os.system("cd /home/user/app/hy3dpaint/DifferentiableRenderer && bash compile_mesh_painter.sh")
|
| 103 |
+
elif os.path.exists("/home/user/app/hy3dpaint/differentiable_renderer"):
|
| 104 |
+
os.system("cd /home/user/app/hy3dpaint/differentiable_renderer && bash compile_mesh_painter.sh")
|
| 105 |
+
else:
|
| 106 |
+
print("Warning: DifferentiableRenderer directory not found, skipping compilation")
|
| 107 |
# print("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P /home/user/app/hy3dpaint/ckpt")
|
| 108 |
# os.system("wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P /home/user/app/hy3dpaint/ckpt")
|
| 109 |
|
|
|
|
| 934 |
from spaces import zero
|
| 935 |
zero.startup()
|
| 936 |
|
| 937 |
+
uvicorn.run(app, host=args.host, port=args.port)
|