AdrianHR commited on
Commit
de714f5
·
1 Parent(s): 036cb73

feat: Add new introtext to the HF demo

Browse files
Files changed (2) hide show
  1. app.py +8 -2
  2. introtext.txt +1 -0
app.py CHANGED
@@ -11,6 +11,10 @@ from utils import GeM, neighbor_info, from_path_to_image, string_row_to_array
11
 
12
  from tensorflow_similarity.visualization import viz_neigbors_imgs
13
 
 
 
 
 
14
 
15
  def clone_git_repo():
16
  local_path = './ID2223_Project'
@@ -149,8 +153,10 @@ def inference(given_index):
149
 
150
 
151
  with gr.Blocks() as demo:
152
- gr.Markdown("Click the button to see the Retrieval Geolocalization.")
153
- slider = gr.Slider(value=-1, maximum=3131,label='Choosen query index', info='(random if left at -1)')
 
 
154
 
155
  gr.Examples(
156
  examples = [
 
11
 
12
  from tensorflow_similarity.visualization import viz_neigbors_imgs
13
 
14
+ def get_intro_text():
15
+ with open('introtext.txt','r') as file:
16
+ intro = file.read()
17
+ return intro
18
 
19
  def clone_git_repo():
20
  local_path = './ID2223_Project'
 
153
 
154
 
155
  with gr.Blocks() as demo:
156
+ intro = get_intro_text()
157
+ gr.Markdown(intro)
158
+
159
+ slider = gr.Slider(value=-1, maximum=3131,label='Choosen query image index', info='(random if left at -1)')
160
 
161
  gr.Examples(
162
  examples = [
introtext.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ This is a demo of what Geolocalization can look like. It is the task of predicting where an image was taken using only its pixels. A database or "gallery" has been put together with images from all over Stockholm. At the same time a set of query images have also been put together, these images where taken from the same location as the images in the database, but at a different time, often years apart. When you click the button you will see for a random or specified query image out of 3000 possible, what the model deems to be the most similar images. \n The plot of images shows the query image as the leftmost image, and then the 5 most similar images according to the model. The map shows the locations of the 5 most similar images as blue dots and the red circle is the ground truth of the query. Have fun!