Spaces:
Runtime error
Runtime error
upload v1667722548 model
Browse files- .gitattributes +3 -0
- app.py +5 -4
- palette.txt +3 -0
- test-image3.png +3 -0
- test-image4.png +3 -0
- test-image5.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 34 |
test-image1.png filter=lfs diff=lfs merge=lfs -text
|
| 35 |
test-image2.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 34 |
test-image1.png filter=lfs diff=lfs merge=lfs -text
|
| 35 |
test-image2.png filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
test-image3.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
test-image4.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
test-image5.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import tensorflow as tf
|
|
| 4 |
from huggingface_hub import from_pretrained_keras
|
| 5 |
from PIL import Image
|
| 6 |
|
| 7 |
-
MODEL_CKPT = "chansung/segmentation-training-pipeline@
|
| 8 |
MODEL = from_pretrained_keras(MODEL_CKPT)
|
| 9 |
|
| 10 |
RESOLTUION = 128
|
|
@@ -12,8 +12,9 @@ RESOLTUION = 128
|
|
| 12 |
PETS_PALETTE = []
|
| 13 |
with open(r"./palette.txt", "r") as fp:
|
| 14 |
for line in fp:
|
| 15 |
-
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
def preprocess_input(image: Image) -> tf.Tensor:
|
|
@@ -86,7 +87,7 @@ demo = gr.Interface(
|
|
| 86 |
allow_flagging="never",
|
| 87 |
title=title,
|
| 88 |
description=description,
|
| 89 |
-
examples=[["test-image1.png"], ["test-image2.png"]],
|
| 90 |
)
|
| 91 |
|
| 92 |
demo.launch()
|
|
|
|
| 4 |
from huggingface_hub import from_pretrained_keras
|
| 5 |
from PIL import Image
|
| 6 |
|
| 7 |
+
MODEL_CKPT = "chansung/segmentation-training-pipeline@v1667722548"
|
| 8 |
MODEL = from_pretrained_keras(MODEL_CKPT)
|
| 9 |
|
| 10 |
RESOLTUION = 128
|
|
|
|
| 12 |
PETS_PALETTE = []
|
| 13 |
with open(r"./palette.txt", "r") as fp:
|
| 14 |
for line in fp:
|
| 15 |
+
if "#" not in line:
|
| 16 |
+
tmp_list = list(map(int, line[:-1].strip("][").split(", ")))
|
| 17 |
+
PETS_PALETTE.append(tmp_list)
|
| 18 |
|
| 19 |
|
| 20 |
def preprocess_input(image: Image) -> tf.Tensor:
|
|
|
|
| 87 |
allow_flagging="never",
|
| 88 |
title=title,
|
| 89 |
description=description,
|
| 90 |
+
examples=[["test-image1.png"], ["test-image2.png"], ["test-image3.png"], ["test-image4.png"], ["test-image5.png"]],
|
| 91 |
)
|
| 92 |
|
| 93 |
demo.launch()
|
palette.txt
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
[0, 10, 146]
|
| 2 |
[38, 0, 44]
|
| 3 |
[255, 232, 0]
|
|
|
|
| 1 |
+
# 0 for outer object
|
| 2 |
+
# 1 for inner object
|
| 3 |
+
# 2 for object border
|
| 4 |
[0, 10, 146]
|
| 5 |
[38, 0, 44]
|
| 6 |
[255, 232, 0]
|
test-image3.png
ADDED
|
Git LFS Details
|
test-image4.png
ADDED
|
Git LFS Details
|
test-image5.png
ADDED
|
Git LFS Details
|