Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,16 @@ import sys
|
|
| 9 |
import subprocess
|
| 10 |
from glob import glob
|
| 11 |
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
def remove_background(input_url):
|
| 14 |
# Create a temporary folder for downloaded and processed images
|
|
@@ -38,7 +48,7 @@ def remove_background(input_url):
|
|
| 38 |
def run_inference(temp_dir):
|
| 39 |
# Define the inference configuration
|
| 40 |
inference_config = "configs/inference-768-6view.yaml"
|
| 41 |
-
pretrained_model = "
|
| 42 |
crop_size = 740
|
| 43 |
seed = 600
|
| 44 |
num_views = 7
|
|
|
|
| 9 |
import subprocess
|
| 10 |
from glob import glob
|
| 11 |
import requests
|
| 12 |
+
from huggingface_hub import snapshot_download
|
| 13 |
+
|
| 14 |
+
# Download models
|
| 15 |
+
os.makedirs("ckpts", exist_ok=True)
|
| 16 |
+
|
| 17 |
+
snapshot_download(
|
| 18 |
+
repo_id = "pengHTYX/PSHuman_Unclip_768_6views",
|
| 19 |
+
local_dir = "./ckpts"
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
|
| 23 |
def remove_background(input_url):
|
| 24 |
# Create a temporary folder for downloaded and processed images
|
|
|
|
| 48 |
def run_inference(temp_dir):
|
| 49 |
# Define the inference configuration
|
| 50 |
inference_config = "configs/inference-768-6view.yaml"
|
| 51 |
+
pretrained_model = "./ckpts"
|
| 52 |
crop_size = 740
|
| 53 |
seed = 600
|
| 54 |
num_views = 7
|