boomcheng commited on
Commit
e59aef1
·
verified ·
1 Parent(s): 9756dd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -18,8 +18,8 @@ pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
18
  MAX_SEED = np.iinfo(np.int32).max
19
 
20
  # Store objects
21
- object_classes_list = []
22
- object_bboxes_list = []
23
 
24
  # Function to add or update the prompt in the list
25
  def submit_prompt(prompt):
@@ -106,19 +106,19 @@ with gr.Blocks() as demo:
106
  max_lines=1,
107
  placeholder="Enter your prompt here",
108
  container=False,
109
- value = "A photograph of a young woman wrapped in a towel wearing a pair of sunglasses"
110
  )
111
  submit_button = gr.Button("Submit Prompt", scale=0)
112
 
113
  # Always visible DataFrame
114
  objects_display = gr.Dataframe(
115
  headers=["Object Class", "Bounding Box"],
116
- value=[]
117
  )
118
 
119
  with gr.Row():
120
- object_class_input = gr.Textbox(label="Sub-caption", placeholder="Enter Sub-caption (e.g., apple)",value = "a towel")
121
- bbox_input = gr.Textbox(label="Bounding Box (x1,y1,x2,y2)", placeholder="Enter bounding box coordinates(>=0 and <=512)",value = "17,77,144,155")
122
 
123
  add_button = gr.Button("Add")
124
 
 
18
  MAX_SEED = np.iinfo(np.int32).max
19
 
20
  # Store objects
21
+ object_classes_list = ["A photograph of a young woman wrapped in a towel wearing a pair of sunglasses", "a towel", "a young woman wrapped in a towel wearing a pair of sunglasses", "a pair of sunglasses"]
22
+ object_bboxes_list = ["0,0,512,512", "17,77,144,155", "16,28,157,155", "82,44,129,63"]
23
 
24
  # Function to add or update the prompt in the list
25
  def submit_prompt(prompt):
 
106
  max_lines=1,
107
  placeholder="Enter your prompt here",
108
  container=False,
109
+
110
  )
111
  submit_button = gr.Button("Submit Prompt", scale=0)
112
 
113
  # Always visible DataFrame
114
  objects_display = gr.Dataframe(
115
  headers=["Object Class", "Bounding Box"],
116
+ value=[[cls, bbox] for cls, bbox in zip(object_classes_list, object_bboxes_list)]
117
  )
118
 
119
  with gr.Row():
120
+ object_class_input = gr.Textbox(label="Sub-caption", placeholder="Enter Sub-caption (e.g., apple)")
121
+ bbox_input = gr.Textbox(label="Bounding Box (x1,y1,x2,y2 and >=0 and <=512)", placeholder="Enter bounding box coordinates")
122
 
123
  add_button = gr.Button("Add")
124