taesiri commited on
Commit
6992194
·
1 Parent(s): d5bf018

Add examples and descriptions

Browse files
Files changed (1) hide show
  1. app.py +20 -8
app.py CHANGED
@@ -11,9 +11,6 @@ from collections import Counter
11
 
12
  from SimSearch import FaissCosineNeighbors
13
 
14
- # HELPERS
15
- # to_np = lambda x: x.data.to('cpu').numpy()
16
-
17
  # DOWNLOAD THE DATASET and Files
18
 
19
  torchvision.datasets.utils.download_file_from_google_drive('1kB1vNdVaNS1OGZ3K8BspBUKkPACCsnrG', '.', 'GTAV-Videos.zip')
@@ -127,8 +124,11 @@ def gradio_search(query, game_name, selected_model, aggregator, pool_size, k=6):
127
  list_of_games = ['Grand Theft Auto V']
128
 
129
 
130
-
131
-
 
 
 
132
 
133
  # GRADIO APP
134
  iface = gr.Interface(fn=gradio_search,
@@ -136,7 +136,7 @@ iface = gr.Interface(fn=gradio_search,
136
  gr.inputs.Radio(list_of_games, label="Game To Search"),
137
  gr.inputs.Radio(['ViT-B/32'], label="MODEL"),
138
  gr.inputs.Radio(['Majority', 'Top-K'], label="Aggregator"),
139
- gr.inputs.Slider(300, 2000, label="Pool Size"),
140
  ],
141
  outputs=[
142
  gr.outputs.Textbox(type="auto", label='Search Params'),
@@ -145,7 +145,19 @@ iface = gr.Interface(fn=gradio_search,
145
  gr.outputs.Video(type='mp4', label='Result 3'),
146
  gr.outputs.Video(type='mp4', label='Result 4'),
147
  gr.outputs.Video(type='mp4', label='Result 5')],
148
- # examples=[],
149
- title='CLIP Meets Game Physics Demo'
 
 
 
 
 
 
 
 
 
 
 
 
150
  )
151
  iface.launch()
 
11
 
12
  from SimSearch import FaissCosineNeighbors
13
 
 
 
 
14
  # DOWNLOAD THE DATASET and Files
15
 
16
  torchvision.datasets.utils.download_file_from_google_drive('1kB1vNdVaNS1OGZ3K8BspBUKkPACCsnrG', '.', 'GTAV-Videos.zip')
 
124
  list_of_games = ['Grand Theft Auto V']
125
 
126
 
127
+ title = "CLIP + GamePhysics - Searching dataset of Gameplay bugs"
128
+ description = "Enter your query and select the game you want to search. The results will be displayed in the console."
129
+ article = """
130
+ This demo shows how to use the CLIP model to search for gameplay bugs in a video game.
131
+ """
132
 
133
  # GRADIO APP
134
  iface = gr.Interface(fn=gradio_search,
 
136
  gr.inputs.Radio(list_of_games, label="Game To Search"),
137
  gr.inputs.Radio(['ViT-B/32'], label="MODEL"),
138
  gr.inputs.Radio(['Majority', 'Top-K'], label="Aggregator"),
139
+ gr.inputs.Slider(300, 2000, label="Pool Size", default=1000),
140
  ],
141
  outputs=[
142
  gr.outputs.Textbox(type="auto", label='Search Params'),
 
145
  gr.outputs.Video(type='mp4', label='Result 3'),
146
  gr.outputs.Video(type='mp4', label='Result 4'),
147
  gr.outputs.Video(type='mp4', label='Result 5')],
148
+ examples=[
149
+ ["A red car", list_of_games[0], 'ViT-B/32', 'Top-K', 1000],
150
+ ["A person wearing pink", list_of_games[0], 'ViT-B/32', 'Top-K', 1000],
151
+ ["A car flying in the air", list_of_games[0], 'ViT-B/32', 'Majority', 1000],
152
+ ["A person flying in the air", list_of_games[0], 'ViT-B/32', 'Majority', 1000],
153
+ ["A car in vertical position", list_of_games[0], 'ViT-B/32', 'Majority', 1000],
154
+ ["A bike inside a car", list_of_games[0], 'ViT-B/32', 'Majority', 1000],
155
+ ["A bike on a wall", list_of_games[0], 'ViT-B/32', 'Majority', 1000],
156
+ ["A car stuck in a rock", list_of_games[0], 'ViT-B/32', 'Majority', 1000],
157
+ ["A car stuck in a tree", list_of_games[0], 'ViT-B/32', 'Majority', 1000],
158
+ ],
159
+ title=title,
160
+ description=description,
161
+ article=article
162
  )
163
  iface.launch()