Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,14 +18,6 @@ import base64
|
|
18 |
DESCRIPTION = "# [KichangKim/DeepDanbooru](https://github.com/KichangKim/DeepDanbooru)"
|
19 |
|
20 |
|
21 |
-
def load_sample_image_paths() -> list[pathlib.Path]:
|
22 |
-
image_dir = pathlib.Path("images")
|
23 |
-
if not image_dir.exists():
|
24 |
-
path = huggingface_hub.hf_hub_download("public-data/sample-images-TADNE", "images.tar.gz", repo_type="dataset")
|
25 |
-
with tarfile.open(path) as f:
|
26 |
-
f.extractall()
|
27 |
-
return sorted(image_dir.glob("*"))
|
28 |
-
|
29 |
|
30 |
def load_model() -> tf.keras.Model:
|
31 |
path = huggingface_hub.hf_hub_download("public-data/DeepDanbooru", "model-resnet_custom_v3.h5")
|
@@ -71,8 +63,6 @@ def predict(image: PIL.Image.Image, score_threshold: float) -> tuple[dict[str, f
|
|
71 |
return result_threshold, result_all, result_text
|
72 |
|
73 |
|
74 |
-
image_paths = load_sample_image_paths()
|
75 |
-
examples = [[path.as_posix(), 0.5] for path in image_paths]
|
76 |
|
77 |
with gr.Blocks(css="style.css") as demo:
|
78 |
gr.Markdown(DESCRIPTION)
|
|
|
18 |
DESCRIPTION = "# [KichangKim/DeepDanbooru](https://github.com/KichangKim/DeepDanbooru)"
|
19 |
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
def load_model() -> tf.keras.Model:
|
23 |
path = huggingface_hub.hf_hub_download("public-data/DeepDanbooru", "model-resnet_custom_v3.h5")
|
|
|
63 |
return result_threshold, result_all, result_text
|
64 |
|
65 |
|
|
|
|
|
66 |
|
67 |
with gr.Blocks(css="style.css") as demo:
|
68 |
gr.Markdown(DESCRIPTION)
|