apailang commited on
Commit
594ba05
β€’
1 Parent(s): a65b5c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -128,7 +128,8 @@ test10 = os.path.join(os.path.dirname(__file__), "data/test10.jpeg")
128
  test11 = os.path.join(os.path.dirname(__file__), "data/test11.jpeg")
129
  test12 = os.path.join(os.path.dirname(__file__), "data/test12.jpeg")
130
 
131
- gr.Interface(
 
132
  fn=predict,
133
  inputs=gr.Image(type="pil"),
134
  outputs=gr.Image(type="pil"),
@@ -136,7 +137,7 @@ gr.Interface(
136
  description="Upload a Image for prediction",
137
  examples=[[test1],[test2],[test3],[test4],[test5],[test6],[test7],[test8],[test9],[test10],[test11],[test12],],
138
  cache_examples=True
139
- ).launch(share=True)
140
 
141
 
142
  a = os.path.join(os.path.dirname(__file__), "data/a.mp4") # Video
@@ -147,7 +148,8 @@ basename = Path(video_in_file).stem
147
  video_out_file = os.path.join('data/detected' + '.mp4')
148
  samples_folder = 'test_samples'
149
 
150
- demo = gr.Interface(
 
151
  fn=lambda x: x, #detect_video
152
  inputs=gr.Video(),
153
  outputs=gr.Video(),
@@ -158,6 +160,7 @@ demo = gr.Interface(
158
  ],
159
  cache_examples=True
160
  )
 
161
 
162
  if __name__ == "__main__":
163
  demo.launch()
 
128
  test11 = os.path.join(os.path.dirname(__file__), "data/test11.jpeg")
129
  test12 = os.path.join(os.path.dirname(__file__), "data/test12.jpeg")
130
 
131
+ #gr.Interface(
132
+ tts_demo = gr.load(
133
  fn=predict,
134
  inputs=gr.Image(type="pil"),
135
  outputs=gr.Image(type="pil"),
 
137
  description="Upload a Image for prediction",
138
  examples=[[test1],[test2],[test3],[test4],[test5],[test6],[test7],[test8],[test9],[test10],[test11],[test12],],
139
  cache_examples=True
140
+ )#.launch(share=True)
141
 
142
 
143
  a = os.path.join(os.path.dirname(__file__), "data/a.mp4") # Video
 
148
  video_out_file = os.path.join('data/detected' + '.mp4')
149
  samples_folder = 'test_samples'
150
 
151
+ #demo = gr.Interface(
152
+ stt_demo = gr.load(
153
  fn=lambda x: x, #detect_video
154
  inputs=gr.Video(),
155
  outputs=gr.Video(),
 
160
  ],
161
  cache_examples=True
162
  )
163
+ demo = gr.TabbedInterface([tts_demo, stt_demo], ["Image", "Video"])
164
 
165
  if __name__ == "__main__":
166
  demo.launch()