timmy0079 commited on
Commit
8919890
1 Parent(s): 127b299

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,9 +9,9 @@ import numpy as np
9
  import tensorflow as tf
10
 
11
  feature_extractor = SegformerFeatureExtractor.from_pretrained(
12
- "nvidia/segformer-b0-finetuned-ade-512-512")
13
  model = SegformerForSemanticSegmentation.from_pretrained(
14
- "segments-tobias/segformer-b0-finetuned-segments-sidewalk")
15
 
16
  def ade_palette():
17
  """ADE20K palette that maps each class to RGB values."""
@@ -117,7 +117,7 @@ def sepia(input_img):
117
  return fig
118
 
119
  demo = gr.Interface(fn=sepia,
120
- inputs=gr.Image(shape=(512, 512)),
121
  outputs=['plot'],
122
  examples=["Sidewalk_1.jpg", "Sidewalk_2.jpg", "Sidewalk_3.jpg"],
123
  allow_flagging='never')
 
9
  import tensorflow as tf
10
 
11
  feature_extractor = SegformerFeatureExtractor.from_pretrained(
12
+ "nvidia/segformer-b0-finetuned-ade-512-512", from_pt=True)
13
  model = SegformerForSemanticSegmentation.from_pretrained(
14
+ "segments-tobias/segformer-b0-finetuned-segments-sidewalk", from_pt=True)
15
 
16
  def ade_palette():
17
  """ADE20K palette that maps each class to RGB values."""
 
117
  return fig
118
 
119
  demo = gr.Interface(fn=sepia,
120
+ inputs=gr.Image(),
121
  outputs=['plot'],
122
  examples=["Sidewalk_1.jpg", "Sidewalk_2.jpg", "Sidewalk_3.jpg"],
123
  allow_flagging='never')