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

upload v1667704347 model

Browse files
.gitattributes CHANGED
@@ -31,4 +31,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
31
  *.zip filter=lfs diff=lfs merge=lfs -text
32
  *.zst filter=lfs diff=lfs merge=lfs -text
33
  *tfevents* filter=lfs diff=lfs merge=lfs -text
34
- test-image.jpg filter=lfs diff=lfs merge=lfs -text
 
 
31
  *.zip filter=lfs diff=lfs merge=lfs -text
32
  *.zst 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
app.py CHANGED
@@ -4,18 +4,16 @@ 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@v1667662600"
8
  MODEL = from_pretrained_keras(MODEL_CKPT)
9
 
10
  RESOLTUION = 128
11
 
12
- RESOLTUION = 128
13
-
14
- ADE_PALETTE = []
15
  with open(r"./palette.txt", "r") as fp:
16
  for line in fp:
17
  tmp_list = list(map(int, line[:-1].strip("][").split(", ")))
18
- ADE_PALETTE.append(tmp_list)
19
 
20
 
21
  def preprocess_input(image: Image) -> tf.Tensor:
@@ -36,7 +34,7 @@ def get_seg_overlay(image, seg):
36
  color_seg = np.zeros(
37
  (seg.shape[0], seg.shape[1], 3), dtype=np.uint8
38
  ) # height, width, 3
39
- palette = np.array(ADE_PALETTE)
40
 
41
  for label, color in enumerate(palette):
42
  color_seg[seg == label, :] = color
@@ -88,7 +86,7 @@ demo = gr.Interface(
88
  allow_flagging="never",
89
  title=title,
90
  description=description,
91
- examples=[["test-image.jpg"]],
92
  )
93
 
94
  demo.launch()
 
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
11
 
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:
 
34
  color_seg = np.zeros(
35
  (seg.shape[0], seg.shape[1], 3), dtype=np.uint8
36
  ) # height, width, 3
37
+ palette = np.array(PETS_PALETTE)
38
 
39
  for label, color in enumerate(palette):
40
  color_seg[seg == label, :] = color
 
86
  allow_flagging="never",
87
  title=title,
88
  description=description,
89
+ examples=[["test-image1.png"], ["test-image2.png"]],
90
  )
91
 
92
  demo.launch()
palette.txt CHANGED
@@ -1,35 +1,3 @@
1
- [0, 0, 0]
2
- [216, 82, 24]
3
- [255, 255, 0]
4
- [125, 46, 141]
5
- [118, 171, 47]
6
- [161, 19, 46]
7
- [255, 0, 0]
8
- [0, 128, 128]
9
- [190, 190, 0]
10
- [0, 255, 0]
11
- [0, 0, 255]
12
- [170, 0, 255]
13
- [84, 84, 0]
14
- [84, 170, 0]
15
- [84, 255, 0]
16
- [170, 84, 0]
17
- [170, 170, 0]
18
- [170, 255, 0]
19
- [255, 84, 0]
20
- [255, 170, 0]
21
- [255, 255, 0]
22
- [33, 138, 200]
23
- [0, 170, 127]
24
- [0, 255, 127]
25
- [84, 0, 127]
26
- [84, 84, 127]
27
- [84, 170, 127]
28
- [84, 255, 127]
29
- [170, 0, 127]
30
- [170, 84, 127]
31
- [170, 170, 127]
32
- [170, 255, 127]
33
- [255, 0, 127]
34
- [255, 84, 127]
35
- [255, 170, 127]
 
1
+ [0, 10, 146]
2
+ [38, 0, 44]
3
+ [255, 232, 0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test-image1.png ADDED

Git LFS Details

  • SHA256: d2c36384c1c969a3d121edf21de50ef2b2a7a1c4bfc56881952c7101ec80edb8
  • Pointer size: 132 Bytes
  • Size of remote file: 1.05 MB
test-image.jpg → test-image2.png RENAMED
File without changes