Spaces:
Running
Running
zhang-ziang
commited on
Commit
·
adf34e4
1
Parent(s):
b03b419
resume download
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ from typing import Any
|
|
| 13 |
|
| 14 |
|
| 15 |
from huggingface_hub import hf_hub_download
|
| 16 |
-
ckpt_path = hf_hub_download(repo_id="Viglong/OriNet", filename="celarge/dino_weight.pt", repo_type="model", cache_dir='./')
|
| 17 |
print(ckpt_path)
|
| 18 |
|
| 19 |
save_path = './'
|
|
@@ -146,12 +146,13 @@ def figure_to_img(fig):
|
|
| 146 |
return image
|
| 147 |
|
| 148 |
def infer_func(img, do_rm_bkg):
|
|
|
|
| 149 |
img = background_preprocess(img, do_rm_bkg)
|
| 150 |
angles = get_3angle(img)
|
| 151 |
|
| 152 |
fig, ax = plt.subplots(figsize=(8, 8))
|
| 153 |
|
| 154 |
-
|
| 155 |
if h>w:
|
| 156 |
extent = [-5*w/h, 5*w/h, -5, 5]
|
| 157 |
else:
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
from huggingface_hub import hf_hub_download
|
| 16 |
+
ckpt_path = hf_hub_download(repo_id="Viglong/OriNet", filename="celarge/dino_weight.pt", repo_type="model", cache_dir='./', resume_download=True)
|
| 17 |
print(ckpt_path)
|
| 18 |
|
| 19 |
save_path = './'
|
|
|
|
| 146 |
return image
|
| 147 |
|
| 148 |
def infer_func(img, do_rm_bkg):
|
| 149 |
+
img = Image.fromarray(img)
|
| 150 |
img = background_preprocess(img, do_rm_bkg)
|
| 151 |
angles = get_3angle(img)
|
| 152 |
|
| 153 |
fig, ax = plt.subplots(figsize=(8, 8))
|
| 154 |
|
| 155 |
+
w, h = img.size
|
| 156 |
if h>w:
|
| 157 |
extent = [-5*w/h, 5*w/h, -5, 5]
|
| 158 |
else:
|