jeffaudi commited on
Commit
dcd8a6a
1 Parent(s): f13b6ca

Added examples

Browse files
Files changed (2) hide show
  1. .gitignore +3 -0
  2. app.py +7 -7
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ .python-version
2
+ __pycache__/
3
+ gradio_cached_examples/
app.py CHANGED
@@ -64,7 +64,7 @@ def predict_image(image, text_prompt, box_threshold, text_threshold):
64
  # Check the response status
65
  if response.status_code != 200:
66
  raise Exception(
67
- f"Received status code={response.status_code} in inference API"
68
  )
69
 
70
  json_data = json.loads(response.content)
@@ -91,12 +91,12 @@ def predict_image(image, text_prompt, box_threshold, text_threshold):
91
  example_data = [
92
  ["./demo/Pleiades_Neo_Tucson_USA.jpg", 'plane', 0.24, 0.24],
93
  ["./demo/Pleiades_Neo_Tucson_USA.jpg", 'building', 0.24, 0.24],
94
- ["./demo/Pleiades_Neo_Tucson_USA.jpg", 'tree', 0.24, 0.24],
95
- ["./demo/two-dogs-with-a-stick.jpg", "dog", 0.25, 0.25],
96
- ["./demo/airport01.jpg", "aircraft", 0.25, 0.25],
97
- ["./demo/SPOT_Storage.jpg", "storage", 0.25, 0.25],
98
- ["./demo/Satellite_Image_Marina_New_Zealand.jpg", "ship", 0.25, 0.25],
99
- ["./demo/Pleiades_HD15_Miami_Marina.jpg", "ship", 0.25, 0.25],
100
  ]
101
 
102
  # Define CSS for some elements
 
64
  # Check the response status
65
  if response.status_code != 200:
66
  raise Exception(
67
+ f"Received status code={response.status_code} in inference API: {response.text}"
68
  )
69
 
70
  json_data = json.loads(response.content)
 
91
  example_data = [
92
  ["./demo/Pleiades_Neo_Tucson_USA.jpg", 'plane', 0.24, 0.24],
93
  ["./demo/Pleiades_Neo_Tucson_USA.jpg", 'building', 0.24, 0.24],
94
+ #["./demo/Pleiades_Neo_Tucson_USA.jpg", 'tree', 0.24, 0.24],
95
+ #["./demo/two-dogs-with-a-stick.jpg", "dog", 0.25, 0.25],
96
+ #["./demo/airport01.jpg", "aircraft", 0.25, 0.25],
97
+ #["./demo/SPOT_Storage.jpg", "storage", 0.25, 0.25],
98
+ #["./demo/Satellite_Image_Marina_New_Zealand.jpg", "ship", 0.25, 0.25],
99
+ #["./demo/Pleiades_HD15_Miami_Marina.jpg", "ship", 0.25, 0.25],
100
  ]
101
 
102
  # Define CSS for some elements