yeonmorae commited on
Commit
63b03ac
·
1 Parent(s): e2a792e
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -47,7 +47,6 @@ with open(r'labels.txt', 'r') as fp:
47
 
48
  colormap = np.asarray(ade_palette())
49
 
50
-
51
  def label_to_color_image(label):
52
  if label.ndim != 2:
53
  raise ValueError("Expect 2-D input label")
@@ -56,7 +55,6 @@ def label_to_color_image(label):
56
  raise ValueError("label value too large.")
57
  return colormap[label]
58
 
59
-
60
  def draw_plot(pred_img, seg):
61
  fig = plt.figure(figsize=(20, 15))
62
 
@@ -78,7 +76,6 @@ def draw_plot(pred_img, seg):
78
  ax.tick_params(width=0.0, labelsize=25)
79
  return fig
80
 
81
-
82
  def sepia(input_img):
83
  input_img = Image.fromarray(input_img)
84
 
@@ -105,10 +102,9 @@ def sepia(input_img):
105
  fig = draw_plot(pred_img, seg)
106
  return fig
107
 
108
-
109
  demo = gr.Interface(fn=sepia,
110
- inputs=gr.Image(size=(400, 600)),
111
- outputs='plot',
112
  examples=["person-1.jpg", "person-2.jpg", "person-3.jpg", "person-4.jpg", "person-5.jpg"],
113
  allow_flagging='never')
114
 
 
47
 
48
  colormap = np.asarray(ade_palette())
49
 
 
50
  def label_to_color_image(label):
51
  if label.ndim != 2:
52
  raise ValueError("Expect 2-D input label")
 
55
  raise ValueError("label value too large.")
56
  return colormap[label]
57
 
 
58
  def draw_plot(pred_img, seg):
59
  fig = plt.figure(figsize=(20, 15))
60
 
 
76
  ax.tick_params(width=0.0, labelsize=25)
77
  return fig
78
 
 
79
  def sepia(input_img):
80
  input_img = Image.fromarray(input_img)
81
 
 
102
  fig = draw_plot(pred_img, seg)
103
  return fig
104
 
 
105
  demo = gr.Interface(fn=sepia,
106
+ inputs=gr.Image(shape=(400, 600)),
107
+ outputs=['plot'],
108
  examples=["person-1.jpg", "person-2.jpg", "person-3.jpg", "person-4.jpg", "person-5.jpg"],
109
  allow_flagging='never')
110