File size: 1,072 Bytes
d4c3572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import subprocess
import sys

def run_setup(directory):
    try:
        os.chdir(directory)
        result = subprocess.run([sys.executable, "setup.py", "install"], check=True, capture_output=True, text=True)
        print(f"Successfully installed {directory}: {result.stdout}")
    except subprocess.CalledProcessError as e:
        print(f"Error installing {directory}: {e.stderr}")
    except Exception as e:
        print(f"Unexpected error in {directory}: {e}")

# Install custom_rasterizer
run_setup("hy3dgen/texgen/custom_rasterizer")

# Install differentiable_renderer
run_setup("hy3dgen/texgen/differentiable_renderer")

# Download Real-ESRGAN model
try:
    os.makedirs("hy3dpaint/ckpt", exist_ok=True)
    realesrgan_url = "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth"
    subprocess.run(["wget", realesrgan_url, "-P", "hy3dpaint/ckpt"], check=True, capture_output=True, text=True)
    print("Successfully downloaded Real-ESRGAN model")
except Exception as e:
    print(f"Error downloading Real-ESRGAN: {e}")