Rajagopal commited on
Commit
911dce3
·
1 Parent(s): d912095

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -96,7 +96,7 @@ def inference(
96
  elif task == "audio-text":
97
  result = audio_text_zeroshot(audio, text_list)
98
  elif task == "video-text":
99
- result = video_text_zeroshot(image, text_list)
100
  else:
101
  raise NotImplementedError
102
  return result
@@ -117,19 +117,13 @@ def main():
117
  gr.inputs.Textbox(lines=1, label="Candidate texts"),
118
  gr.inputs.Image(type="filepath", label="Input image"),
119
  gr.inputs.Audio(type="filepath", label="Input audio"),
120
- gr.inputs.Image(type="filepath", label="Input image2"),
121
  ]
122
 
123
  iface = gr.Interface(
124
  inference,
125
  inputs,
126
  "label",
127
- examples=[
128
- ["image-text", "A dog|A car|A bird", "assets/dog_image.jpg", None, None],
129
- ["image-text", "A dog|A car|A bird", "assets/car_image.jpg", None, None],
130
- ["audio-text", "A dog|A car|A bird", None, "assets/bird_audio.wav", None],
131
- ["video-text", "A dog|A car|A bird", None, None, "assets/dog_video.mp4"],
132
- ],
133
  description="""<p>This is a simple demo of ImageBind for zero-shot cross-modal understanding (now including image classification, audio classification, and video classification). Please refer to the original <a href='https://arxiv.org/abs/2305.05665' target='_blank'>paper</a> and <a href='https://github.com/facebookresearch/ImageBind' target='_blank'>repo</a> for more details.<br>
134
  To test your own cases, you can upload an image, an audio or a video, and provide the candidate texts separated by "|".<br>
135
  You can duplicate this space and run it privately: <a href='https://huggingface.co/spaces/OFA-Sys/chinese-clip-zero-shot-image-classification?duplicate=true'><img src='https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14' alt='Duplicate Space'></a></p>""",
 
96
  elif task == "audio-text":
97
  result = audio_text_zeroshot(audio, text_list)
98
  elif task == "video-text":
99
+ result = image_text_zeroshot(image, text_list)
100
  else:
101
  raise NotImplementedError
102
  return result
 
117
  gr.inputs.Textbox(lines=1, label="Candidate texts"),
118
  gr.inputs.Image(type="filepath", label="Input image"),
119
  gr.inputs.Audio(type="filepath", label="Input audio"),
120
+ gr.inputs.Image(type="filepath", label="Input image2"),
121
  ]
122
 
123
  iface = gr.Interface(
124
  inference,
125
  inputs,
126
  "label",
 
 
 
 
 
 
127
  description="""<p>This is a simple demo of ImageBind for zero-shot cross-modal understanding (now including image classification, audio classification, and video classification). Please refer to the original <a href='https://arxiv.org/abs/2305.05665' target='_blank'>paper</a> and <a href='https://github.com/facebookresearch/ImageBind' target='_blank'>repo</a> for more details.<br>
128
  To test your own cases, you can upload an image, an audio or a video, and provide the candidate texts separated by "|".<br>
129
  You can duplicate this space and run it privately: <a href='https://huggingface.co/spaces/OFA-Sys/chinese-clip-zero-shot-image-classification?duplicate=true'><img src='https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14' alt='Duplicate Space'></a></p>""",