chansung commited on
Commit
e98c94e
1 Parent(s): 6a33499

upload v1667722548 model

Browse files
Files changed (6) hide show
  1. .gitattributes +3 -0
  2. app.py +5 -4
  3. palette.txt +3 -0
  4. test-image3.png +3 -0
  5. test-image4.png +3 -0
  6. 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@v1667704347"
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
- tmp_list = list(map(int, line[:-1].strip("][").split(", ")))
16
- PETS_PALETTE.append(tmp_list)
 
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

  • SHA256: 6c5668994d12a95a9851bcaaafd1971cb0261a2bd46633c101cd1024d308c469
  • Pointer size: 132 Bytes
  • Size of remote file: 2.08 MB
test-image4.png ADDED

Git LFS Details

  • SHA256: 3fc983af9e26435f0b357aca70f3f9ebbfb1dc1a5e14c7e5f8df832d7072abad
  • Pointer size: 132 Bytes
  • Size of remote file: 1.87 MB
test-image5.png ADDED

Git LFS Details

  • SHA256: 9979748d9a8b657d244c95d9b4bdd22d4419ab888c1b06db069c00c3f31ae64d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.65 MB