pivot-iterative-visual-optimization commited on
Commit
c7757d0
·
verified ·
1 Parent(s): 2a9234c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -101,8 +101,6 @@ To get started, you can use the provided example image and query pairs, or
101
  upload your own images.
102
  This demo uses GPT-4V, so it requires an OpenAI API key.
103
 
104
- To use the provided example images, you can right click on the image -> copy image, then click the clipboard icon in the Input Image box.
105
-
106
  Hyperparameters to set:
107
  * N Samples for Initialization - how many initial points are sampled for the first PIVOT iteration.
108
  * N Samples for Optimiazation - how many points are sampled for subsequent iterations.
@@ -114,6 +112,8 @@ Note that each iteration takes about ~10s, and each additional ensemble adds a m
114
  After PIVOT finishes, the image gallery below will visualize PIVOT results throughout all the iterations.
115
  There are two images for each iteration - the first one shows all the sampled points, and the second one shows which one PIVOT picked.
116
  The Info textbox will show the final selected pixel coordinate that PIVOT converged to.
 
 
117
  """.strip())
118
 
119
  gr.Markdown(
@@ -126,8 +126,17 @@ The Info textbox will show the final selected pixel coordinate that PIVOT conver
126
  gr.Markdown('## New Query')
127
  with gr.Row():
128
  with gr.Column():
129
- inp_im = gr.Image(label='Input Image', type='numpy', show_label=True)
130
- inp_query = gr.Textbox(label='Description', lines=1)
 
 
 
 
 
 
 
 
 
131
 
132
  with gr.Column():
133
  inp_openai_api_key = gr.Textbox(
 
101
  upload your own images.
102
  This demo uses GPT-4V, so it requires an OpenAI API key.
103
 
 
 
104
  Hyperparameters to set:
105
  * N Samples for Initialization - how many initial points are sampled for the first PIVOT iteration.
106
  * N Samples for Optimiazation - how many points are sampled for subsequent iterations.
 
112
  After PIVOT finishes, the image gallery below will visualize PIVOT results throughout all the iterations.
113
  There are two images for each iteration - the first one shows all the sampled points, and the second one shows which one PIVOT picked.
114
  The Info textbox will show the final selected pixel coordinate that PIVOT converged to.
115
+
116
+ **To use the example images, right click on the image -> copy image, then click the clipboard icon in the Input Image box.**
117
  """.strip())
118
 
119
  gr.Markdown(
 
126
  gr.Markdown('## New Query')
127
  with gr.Row():
128
  with gr.Column():
129
+ inp_im = gr.Image(
130
+ label='Input Image',
131
+ type='numpy',
132
+ show_label=True,
133
+ value=examples[0]['im_path'],
134
+ )
135
+ inp_query = gr.Textbox(
136
+ label='Description',
137
+ lines=1,
138
+ placeholder=examples[0]['desc'],
139
+ )
140
 
141
  with gr.Column():
142
  inp_openai_api_key = gr.Textbox(