Spaces:
Running
Running
Niki Zhang
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -397,7 +397,7 @@ def infer(crop_image_path,full_image_path,state,language,task_type=None):
|
|
397 |
|
398 |
elif task_type=="task 3":
|
399 |
item_gallery_output.append("recomendation_pic/3.8.png")
|
400 |
-
item_gallery_output.append("recomendation_pic/
|
401 |
input_image = Image.open(full_image_path).convert("RGB")
|
402 |
input_features = extract_features_siglip(input_image.convert("RGB"))
|
403 |
input_features = input_features.detach().cpu().numpy()
|
@@ -1866,7 +1866,7 @@ def create_ui():
|
|
1866 |
)
|
1867 |
with gr.Row():
|
1868 |
with gr.Column(scale=1,min_width=50,visible=False) as instruct:
|
1869 |
-
task_instuction=gr.Image(type="pil", interactive=
|
1870 |
with gr.Column(scale=6):
|
1871 |
with gr.Column(visible=False) as modules_not_need_gpt:
|
1872 |
|
@@ -2757,14 +2757,14 @@ def create_ui():
|
|
2757 |
show_progress=False
|
2758 |
|
2759 |
)
|
2760 |
-
def
|
2761 |
instruction=Image.open('test_images/task4.jpg')
|
2762 |
-
return None, [], [], [[], [], []], "", None, [],[],instruction,"task 4"
|
2763 |
|
2764 |
session_type.change(
|
2765 |
-
|
2766 |
[],
|
2767 |
-
[image_input, chatbot, state, click_state, paragraph, origin_image,history_log,log_state,task_instuction,task_type]
|
2768 |
)
|
2769 |
|
2770 |
# upvote_btn.click(
|
|
|
397 |
|
398 |
elif task_type=="task 3":
|
399 |
item_gallery_output.append("recomendation_pic/3.8.png")
|
400 |
+
item_gallery_output.append("recomendation_pic/basket-2.png")
|
401 |
input_image = Image.open(full_image_path).convert("RGB")
|
402 |
input_features = extract_features_siglip(input_image.convert("RGB"))
|
403 |
input_features = input_features.detach().cpu().numpy()
|
|
|
1866 |
)
|
1867 |
with gr.Row():
|
1868 |
with gr.Column(scale=1,min_width=50,visible=False) as instruct:
|
1869 |
+
task_instuction=gr.Image(type="pil", interactive=False, elem_classes="task_instruct",height=650,label=None)
|
1870 |
with gr.Column(scale=6):
|
1871 |
with gr.Column(visible=False) as modules_not_need_gpt:
|
1872 |
|
|
|
2757 |
show_progress=False
|
2758 |
|
2759 |
)
|
2760 |
+
def change_session():
|
2761 |
instruction=Image.open('test_images/task4.jpg')
|
2762 |
+
return None, [], [], [[], [], []], "", None, [],[],instruction,"task 4",[],[],[]
|
2763 |
|
2764 |
session_type.change(
|
2765 |
+
change_session,
|
2766 |
[],
|
2767 |
+
[image_input, chatbot, state, click_state, paragraph, origin_image,history_log,log_state,task_instuction,task_type,gallery_result,style_gallery_result,recommend_bot]
|
2768 |
)
|
2769 |
|
2770 |
# upvote_btn.click(
|