Anusha806 commited on
Commit
f7c80a7
·
1 Parent(s): 9d73989
Files changed (1) hide show
  1. app.py +487 -150
app.py CHANGED
@@ -769,6 +769,396 @@ def search_by_image(uploaded_image, alpha=0.5, start=0, end=12):
769
 
770
  return imgs_with_captions
771
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  import gradio as gr
773
  import whisper
774
 
@@ -786,147 +1176,147 @@ def handle_voice_search(vf_path, a, offset, gender_ui):
786
  return results, 12, transcription, None, gender_override, results, seen_ids
787
 
788
  custom_css = """
789
- /* === Global Styling === */
790
- /* === Override Gradio default background === */
791
-
792
-
793
-
794
- /* Add soft card-like containers */
795
- .gr-box, .gr-block, .gr-column, .gr-row {
796
- background-color: #ffffff !important;
797
- border-radius: 12px;
798
- padding: 16px !important;
799
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
800
  }
801
 
802
  #app-bg {
803
  min-height: 100vh;
804
- padding: 0;
805
- margin: 0;
806
- # background: radial-gradient(circle at center, #0b1f36 0%, #033e3e 100%);
807
  display: flex;
808
  justify-content: center;
809
  align-items: flex-start;
 
810
  background-attachment: fixed;
811
  position: relative;
812
- overflow: hidden;
813
- }
814
-
815
- #app-bg::before {
816
- content: "";
817
- position: absolute;
818
- top: 0; left: 0;
819
- width: 100%; height: 100%;
820
- background: radial-gradient(circle at center, rgba(0, 255, 255, 0.08), transparent);
821
- z-index: 0;
822
  }
823
 
 
824
  #main-container {
825
- z-index: 1;
 
 
 
 
 
 
 
 
826
  position: relative;
 
 
827
  }
828
 
 
 
 
 
 
 
 
 
829
 
830
-
831
-
832
- /* === Heading Style === */
833
  h1, .gr-markdown h1 {
834
  font-size: 2.2rem !important;
835
  font-weight: bold;
836
- color: #000000;
837
  text-align: center;
838
  margin-bottom: 1rem;
839
  }
840
 
841
- /* === Tabs === */
842
- .gr-tab {
843
- border-radius: 12px !important;
844
- background-color: #ffffff !important;
845
- box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
846
- padding: 16px !important;
847
- margin-top: 12px;
848
- }
849
-
850
- /* === Textbox, Dropdown, Slider === */
851
- input[type="text"], .gr-textbox textarea, .gr-dropdown, .gr-slider {
852
- border-radius: 8px !important;
853
- border: 1px solid #ccc !important;
854
  padding: 10px !important;
855
  font-size: 16px;
856
- box-shadow: 0 1px 3px rgba(0,0,0,0.05);
857
- }
858
-
859
- /* === Image Upload === */
860
- .gr-image {
861
- width: 100% !important;
862
- max-width: 100% !important;
863
- border-radius: 12px;
864
- box-shadow: 0 2px 10px rgba(0,0,0,0.1);
865
- }
866
-
867
- /* === Buttons (custom style .button-36) === */
868
- .gr-button {
869
- background-color: #DBDBDB !important;
870
- background-image: linear-gradient(92.88deg, #455EB5 9.16%, #5643CC 43.89%, #673FD7 64.72%);
871
- border-radius: 8px !important;
872
- border-style: none !important;
873
- box-sizing: border-box;
874
- color: #FFFFFF !important;
875
- cursor: pointer;
876
- flex-shrink: 0;
877
- font-family: "Inter UI","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;
878
- font-size: 16px;
879
- font-weight: 500;
880
- height: 4rem;
881
- padding: 0 1.6rem;
882
- text-align: center;
883
- text-shadow: rgba(0, 0, 0, 0.25) 0 3px 8px;
884
- transition: all .5s;
885
- user-select: none;
886
- -webkit-user-select: none;
887
- touch-action: manipulation;
888
- }
889
-
890
- .gr-button:hover {
891
- box-shadow: rgba(80, 63, 205, 0.5) 0 1px 30px;
892
- transition-duration: .1s;
893
- }
894
-
895
- /* === Responsive padding === */
896
- @media (min-width: 768px) {
897
- .gr-button {
898
- padding: 0 2.6rem;
899
- }
900
  }
901
 
902
  /* === Gallery Grid === */
903
  .gr-gallery {
904
  padding-top: 12px;
 
905
  }
906
  .gr-gallery-item {
907
  width: 128px !important;
908
  height: 128px !important;
909
- transition: transform 0.3s ease-in-out;
910
  border-radius: 8px;
911
  overflow: hidden;
 
 
 
912
  }
913
  .gr-gallery-item:hover {
914
  transform: scale(1.06);
915
- box-shadow: 0 3px 12px rgba(0,0,0,0.15);
916
  }
917
  .gr-gallery-item img {
918
- object-fit: cover !important;
919
- width: 100% !important;
920
- height: 100% !important;
921
  border-radius: 8px;
922
  }
923
 
924
- /* === Audio Upload === */
925
- .gr-audio {
926
  width: 100% !important;
 
 
927
  border-radius: 12px;
928
- background-color: #fff !important;
929
- box-shadow: 0 1px 5px rgba(0,0,0,0.1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
930
  }
931
 
932
  /* === Footer === */
@@ -937,29 +1327,12 @@ input[type="text"], .gr-textbox textarea, .gr-dropdown, .gr-slider {
937
  padding-top: 1rem;
938
  }
939
 
940
-
941
-
942
- #main-container {
943
- width: 95%;
944
- max-width: 1100px;
945
- margin: 20px auto !important;
946
- padding: 16px;
947
- background: #ffffff;
948
- border-radius: 18px;
949
- box-shadow: 0 10px 30px rgba(0,0,0,0.08);
950
- border: 3px solid orange;
951
- # overflow-y: auto;
952
- # max-height: 90vh;
953
- }
954
-
955
- /* For phones and smaller devices */
956
  @media (max-width: 768px) {
957
  #main-container {
958
  width: 100%;
959
  margin: 8px;
960
  padding: 12px;
961
- border-radius: 12px;
962
- max-height: none;
963
  }
964
 
965
  .gr-button {
@@ -986,42 +1359,6 @@ input[type="text"], .gr-textbox textarea, .gr-dropdown, .gr-slider {
986
  }
987
  }
988
 
989
-
990
-
991
- /* === Tab Label Styling === */
992
- button[role="tab"] {
993
- color: #000000 !important; /* Default tab text color: black */
994
- font-weight: 500;
995
- transition: color 0.3s ease-in-out;
996
- font-size: 16px;
997
- }
998
-
999
- /* Active tab title */
1000
- button[role="tab"][aria-selected="true"] {
1001
- color: #f57c00 !important; /* Active tab text color: orange */
1002
- font-weight: bold !important;
1003
- }
1004
-
1005
- /* Hover effect on tab titles */
1006
- button[role="tab"]:hover {
1007
- color: #f57c00 !important; /* Orange on hover */
1008
- font-weight: 600;
1009
- cursor: pointer;
1010
- }
1011
- /* === Uniform Input Sizes for Text, Audio, Image === */
1012
- .gr-textbox, .gr-audio, .gr-image {
1013
- max-width: 100% !important;
1014
- width: 100% !important;
1015
- }
1016
-
1017
- .gr-audio, .gr-image {
1018
- max-width: 500px !important;
1019
- margin: 0 auto;
1020
- }
1021
-
1022
- .gr-image {
1023
- height: 256px !important;
1024
- }
1025
  """
1026
 
1027
 
@@ -1156,4 +1493,4 @@ with gr.Blocks(css=custom_css) as demo:
1156
 
1157
  # gr.Markdown("🧠 Powered by OpenAI + Hybrid AI Fashion Search")
1158
 
1159
- demo.launch()
 
769
 
770
  return imgs_with_captions
771
 
772
+ # import gradio as gr
773
+ # import whisper
774
+
775
+ # asr_model = whisper.load_model("base")
776
+
777
+ # def handle_voice_search(vf_path, a, offset, gender_ui):
778
+ # try:
779
+ # transcription = asr_model.transcribe(vf_path)["text"].strip()
780
+ # except:
781
+ # transcription = ""
782
+ # filters = extract_intent_from_openai(transcription) if transcription else {}
783
+ # gender_override = gender_ui if gender_ui else filters.get("gender")
784
+ # results = search_fashion(transcription, a, 0, 12, gender_override)
785
+ # seen_ids = {r[1] for r in results}
786
+ # return results, 12, transcription, None, gender_override, results, seen_ids
787
+
788
+ # custom_css = """
789
+ # /* === Global Styling === */
790
+ # /* === Override Gradio default background === */
791
+
792
+
793
+
794
+ # /* Add soft card-like containers */
795
+ # .gr-box, .gr-block, .gr-column, .gr-row {
796
+ # background-color: #ffffff !important;
797
+ # border-radius: 12px;
798
+ # padding: 16px !important;
799
+ # box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
800
+ # }
801
+
802
+ # #app-bg {
803
+ # min-height: 100vh;
804
+ # padding: 0;
805
+ # margin: 0;
806
+ # # background: radial-gradient(circle at center, #0b1f36 0%, #033e3e 100%);
807
+ # display: flex;
808
+ # justify-content: center;
809
+ # align-items: flex-start;
810
+ # background-attachment: fixed;
811
+ # position: relative;
812
+ # overflow: hidden;
813
+ # }
814
+
815
+ # #app-bg::before {
816
+ # content: "";
817
+ # position: absolute;
818
+ # top: 0; left: 0;
819
+ # width: 100%; height: 100%;
820
+ # background: radial-gradient(circle at center, rgba(0, 255, 255, 0.08), transparent);
821
+ # z-index: 0;
822
+ # }
823
+
824
+ # #main-container {
825
+ # z-index: 1;
826
+ # position: relative;
827
+ # }
828
+
829
+
830
+
831
+
832
+ # /* === Heading Style === */
833
+ # h1, .gr-markdown h1 {
834
+ # font-size: 2.2rem !important;
835
+ # font-weight: bold;
836
+ # color: #000000;
837
+ # text-align: center;
838
+ # margin-bottom: 1rem;
839
+ # }
840
+
841
+ # /* === Tabs === */
842
+ # .gr-tab {
843
+ # border-radius: 12px !important;
844
+ # background-color: #ffffff !important;
845
+ # box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
846
+ # padding: 16px !important;
847
+ # margin-top: 12px;
848
+ # }
849
+
850
+ # /* === Textbox, Dropdown, Slider === */
851
+ # input[type="text"], .gr-textbox textarea, .gr-dropdown, .gr-slider {
852
+ # border-radius: 8px !important;
853
+ # border: 1px solid #ccc !important;
854
+ # padding: 10px !important;
855
+ # font-size: 16px;
856
+ # box-shadow: 0 1px 3px rgba(0,0,0,0.05);
857
+ # }
858
+
859
+ # /* === Image Upload === */
860
+ # .gr-image {
861
+ # width: 100% !important;
862
+ # max-width: 100% !important;
863
+ # border-radius: 12px;
864
+ # box-shadow: 0 2px 10px rgba(0,0,0,0.1);
865
+ # }
866
+
867
+ # /* === Buttons (custom style .button-36) === */
868
+ # .gr-button {
869
+ # background-color: #DBDBDB !important;
870
+ # background-image: linear-gradient(92.88deg, #455EB5 9.16%, #5643CC 43.89%, #673FD7 64.72%);
871
+ # border-radius: 8px !important;
872
+ # border-style: none !important;
873
+ # box-sizing: border-box;
874
+ # color: #FFFFFF !important;
875
+ # cursor: pointer;
876
+ # flex-shrink: 0;
877
+ # font-family: "Inter UI","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;
878
+ # font-size: 16px;
879
+ # font-weight: 500;
880
+ # height: 4rem;
881
+ # padding: 0 1.6rem;
882
+ # text-align: center;
883
+ # text-shadow: rgba(0, 0, 0, 0.25) 0 3px 8px;
884
+ # transition: all .5s;
885
+ # user-select: none;
886
+ # -webkit-user-select: none;
887
+ # touch-action: manipulation;
888
+ # }
889
+
890
+ # .gr-button:hover {
891
+ # box-shadow: rgba(80, 63, 205, 0.5) 0 1px 30px;
892
+ # transition-duration: .1s;
893
+ # }
894
+
895
+ # /* === Responsive padding === */
896
+ # @media (min-width: 768px) {
897
+ # .gr-button {
898
+ # padding: 0 2.6rem;
899
+ # }
900
+ # }
901
+
902
+ # /* === Gallery Grid === */
903
+ # .gr-gallery {
904
+ # padding-top: 12px;
905
+ # }
906
+ # .gr-gallery-item {
907
+ # width: 128px !important;
908
+ # height: 128px !important;
909
+ # transition: transform 0.3s ease-in-out;
910
+ # border-radius: 8px;
911
+ # overflow: hidden;
912
+ # }
913
+ # .gr-gallery-item:hover {
914
+ # transform: scale(1.06);
915
+ # box-shadow: 0 3px 12px rgba(0,0,0,0.15);
916
+ # }
917
+ # .gr-gallery-item img {
918
+ # object-fit: cover !important;
919
+ # width: 100% !important;
920
+ # height: 100% !important;
921
+ # border-radius: 8px;
922
+ # }
923
+
924
+ # /* === Audio Upload === */
925
+ # .gr-audio {
926
+ # width: 100% !important;
927
+ # border-radius: 12px;
928
+ # background-color: #fff !important;
929
+ # box-shadow: 0 1px 5px rgba(0,0,0,0.1);
930
+ # }
931
+
932
+ # /* === Footer === */
933
+ # .gr-markdown:last-child {
934
+ # text-align: center;
935
+ # font-size: 14px;
936
+ # color: #666;
937
+ # padding-top: 1rem;
938
+ # }
939
+
940
+
941
+
942
+ # #main-container {
943
+ # width: 95%;
944
+ # max-width: 1100px;
945
+ # margin: 20px auto !important;
946
+ # padding: 16px;
947
+ # background: #ffffff;
948
+ # border-radius: 18px;
949
+ # box-shadow: 0 10px 30px rgba(0,0,0,0.08);
950
+ # border: 3px solid orange;
951
+ # # overflow-y: auto;
952
+ # # max-height: 90vh;
953
+ # }
954
+
955
+ # /* For phones and smaller devices */
956
+ # @media (max-width: 768px) {
957
+ # #main-container {
958
+ # width: 100%;
959
+ # margin: 8px;
960
+ # padding: 12px;
961
+ # border-radius: 12px;
962
+ # max-height: none;
963
+ # }
964
+
965
+ # .gr-button {
966
+ # font-size: 14px;
967
+ # height: 3.2rem;
968
+ # }
969
+
970
+ # input[type="text"], .gr-textbox textarea, .gr-dropdown, .gr-slider {
971
+ # font-size: 14px;
972
+ # padding: 8px !important;
973
+ # }
974
+
975
+ # h1, .gr-markdown h1 {
976
+ # font-size: 1.6rem !important;
977
+ # }
978
+
979
+ # .gr-gallery-item {
980
+ # width: 100px !important;
981
+ # height: 100px !important;
982
+ # }
983
+
984
+ # .gr-image {
985
+ # height: auto !important;
986
+ # }
987
+ # }
988
+
989
+
990
+
991
+ # /* === Tab Label Styling === */
992
+ # button[role="tab"] {
993
+ # color: #000000 !important; /* Default tab text color: black */
994
+ # font-weight: 500;
995
+ # transition: color 0.3s ease-in-out;
996
+ # font-size: 16px;
997
+ # }
998
+
999
+ # /* Active tab title */
1000
+ # button[role="tab"][aria-selected="true"] {
1001
+ # color: #f57c00 !important; /* Active tab text color: orange */
1002
+ # font-weight: bold !important;
1003
+ # }
1004
+
1005
+ # /* Hover effect on tab titles */
1006
+ # button[role="tab"]:hover {
1007
+ # color: #f57c00 !important; /* Orange on hover */
1008
+ # font-weight: 600;
1009
+ # cursor: pointer;
1010
+ # }
1011
+ # /* === Uniform Input Sizes for Text, Audio, Image === */
1012
+ # .gr-textbox, .gr-audio, .gr-image {
1013
+ # max-width: 100% !important;
1014
+ # width: 100% !important;
1015
+ # }
1016
+
1017
+ # .gr-audio, .gr-image {
1018
+ # max-width: 500px !important;
1019
+ # margin: 0 auto;
1020
+ # }
1021
+
1022
+ # .gr-image {
1023
+ # height: 256px !important;
1024
+ # }
1025
+ # """
1026
+
1027
+
1028
+
1029
+ # with gr.Blocks(css=custom_css) as demo:
1030
+ # with gr.Column(elem_id="app-bg"):
1031
+ # with gr.Column(elem_id="main-container"):
1032
+ # gr.Markdown("# 🛍️ Fashion Product Hybrid Search")
1033
+
1034
+ # alpha = gr.Slider(0, 1, value=0.5, label="Hybrid Weight (alpha: 0=sparse, 1=dense)")
1035
+
1036
+ # with gr.Tabs():
1037
+ # with gr.Tab("Text Search"):
1038
+ # query = gr.Textbox(
1039
+ # label="Text Query",
1040
+ # placeholder="e.g., floral summer dress for women"
1041
+ # )
1042
+ # gender_dropdown = gr.Dropdown(
1043
+ # ["", "Men", "Women", "Boys", "Girls", "Kids", "Unisex"],
1044
+ # label="Gender Filter (optional)"
1045
+ # )
1046
+ # text_search_btn = gr.Button("Search by Text", elem_classes="search-btn")
1047
+ # with gr.Tab("🎙️ Voice Search"):
1048
+ # voice_input = gr.Audio(label="Speak Your Query", type="filepath")
1049
+ # voice_gender_dropdown = gr.Dropdown(["", "Men", "Women", "Boys", "Girls", "Kids", "Unisex"], label="Gender")
1050
+ # voice_search_btn = gr.Button("Search by Voice")
1051
+
1052
+
1053
+ # with gr.Tab("Image Search"):
1054
+ # # image_input = gr.Image(
1055
+ # # type="pil",
1056
+ # # label="Upload an image",
1057
+ # # sources=["upload", "clipboard"],
1058
+ # # height=256,
1059
+ # # width=356
1060
+ # # )
1061
+ # image_input = gr.Image(
1062
+ # type="pil",
1063
+ # label="Upload an image",
1064
+ # sources=["upload", "clipboard"],
1065
+ # # tool=None,
1066
+ # height=400
1067
+ # )
1068
+
1069
+ # image_gender_dropdown = gr.Dropdown(
1070
+ # ["", "Men", "Women", "Boys", "Girls", "Kids", "Unisex"],
1071
+ # label="Gender Filter (optional)"
1072
+ # )
1073
+ # image_search_btn = gr.Button("Search by Image", elem_classes="search-btn")
1074
+
1075
+ # gallery = gr.Gallery(label="Search Results", columns=6, height=None)
1076
+ # load_more_btn = gr.Button("Load More")
1077
+
1078
+ # # --- UI State Holders ---
1079
+ # search_offset = gr.State(0)
1080
+ # current_query = gr.State("")
1081
+ # current_image = gr.State(None)
1082
+ # current_gender = gr.State("")
1083
+ # shown_results = gr.State([])
1084
+ # shown_ids = gr.State(set())
1085
+
1086
+ # # --- Unified Search Function ---
1087
+ # def unified_search(q, uploaded_image, a, offset, gender_ui):
1088
+ # start = 0
1089
+ # end = 12
1090
+
1091
+ # filters = extract_intent_from_openai(q) if q.strip() else {}
1092
+ # gender_override = gender_ui if gender_ui else filters.get("gender")
1093
+
1094
+ # if uploaded_image is not None:
1095
+ # results = search_by_image(uploaded_image, a, start, end)
1096
+ # elif q.strip():
1097
+ # results = search_fashion(q, a, start, end, gender_override)
1098
+ # else:
1099
+ # results = []
1100
+
1101
+ # seen_ids = {r[1] for r in results}
1102
+ # return results, end, q, uploaded_image, gender_override, results, seen_ids
1103
+
1104
+ # # Text Search
1105
+ # # Text Search
1106
+ # text_search_btn.click(
1107
+ # unified_search,
1108
+ # inputs=[query, gr.State(None), alpha, search_offset, gender_dropdown],
1109
+ # outputs=[gallery, search_offset, current_query, current_image, current_gender, shown_results, shown_ids]
1110
+ # )
1111
+
1112
+ # voice_search_btn.click(
1113
+ # handle_voice_search,
1114
+ # inputs=[voice_input, alpha, search_offset, voice_gender_dropdown],
1115
+ # outputs=[gallery, search_offset, current_query, current_image, current_gender, shown_results, shown_ids]
1116
+ # )
1117
+
1118
+ # # Image Search
1119
+ # image_search_btn.click(
1120
+ # unified_search,
1121
+ # inputs=[gr.State(""), image_input, alpha, search_offset, image_gender_dropdown],
1122
+ # outputs=[gallery, search_offset, current_query, current_image, current_gender, shown_results, shown_ids]
1123
+ # )
1124
+
1125
+ # # --- Load More Button ---
1126
+ # def load_more_fn(a, offset, q, img, gender_ui, prev_results, prev_ids):
1127
+ # start = offset
1128
+ # end = offset + 12
1129
+ # gender_override = gender_ui
1130
+
1131
+ # if img is not None:
1132
+ # new_results = search_by_image(img, a, start, end)
1133
+ # elif q.strip():
1134
+ # new_results = search_fashion(q, a, start, end, gender_override)
1135
+ # else:
1136
+ # new_results = []
1137
+
1138
+ # filtered_new = []
1139
+ # new_ids = set()
1140
+ # for item in new_results:
1141
+ # img_obj, caption = item
1142
+ # if caption not in prev_ids:
1143
+ # filtered_new.append(item)
1144
+ # new_ids.add(caption)
1145
+
1146
+ # combined = prev_results + filtered_new
1147
+ # updated_ids = prev_ids.union(new_ids)
1148
+
1149
+ # return combined, end, combined, updated_ids
1150
+
1151
+ # load_more_btn.click(
1152
+ # load_more_fn,
1153
+ # inputs=[alpha, search_offset, current_query, current_image, current_gender, shown_results, shown_ids],
1154
+ # outputs=[gallery, search_offset, shown_results, shown_ids]
1155
+ # )
1156
+
1157
+ # # gr.Markdown("🧠 Powered by OpenAI + Hybrid AI Fashion Search")
1158
+
1159
+ # demo.launch()
1160
+
1161
+
1162
  import gradio as gr
1163
  import whisper
1164
 
 
1176
  return results, 12, transcription, None, gender_override, results, seen_ids
1177
 
1178
  custom_css = """
1179
+ /* === Background Styling === */
1180
+ html, body {
1181
+ margin: 0;
1182
+ padding: 0;
1183
+ height: 100%;
1184
+ # overflow: hidden;
1185
+ overflow: auto;
 
 
 
 
1186
  }
1187
 
1188
  #app-bg {
1189
  min-height: 100vh;
 
 
 
1190
  display: flex;
1191
  justify-content: center;
1192
  align-items: flex-start;
1193
+ background: radial-gradient(circle at center, #C2C5EF 0%, #E0E2F5 100%) !important;
1194
  background-attachment: fixed;
1195
  position: relative;
1196
+ overflow-y: auto;
1197
+ padding: 24px;
 
 
 
 
 
 
 
 
1198
  }
1199
 
1200
+ /* === Main Content Container === */
1201
  #main-container {
1202
+ width: 95%;
1203
+ max-width: 1100px;
1204
+ margin: 20px auto;
1205
+ padding: 24px;
1206
+ background: #ffffff;
1207
+ border-radius: 18px;
1208
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
1209
+ # border: 2px solid #C2C5EF;
1210
+ border: 2px solid black;
1211
  position: relative;
1212
+ z-index: 1;
1213
+ overflow: visible;
1214
  }
1215
 
1216
+ /* === Card Containers === */
1217
+ .gr-box, .gr-block, .gr-column, .gr-row, .gr-tab {
1218
+ background-color: #C2C5EF !important;
1219
+ color: #22284F !important;
1220
+ border-radius: 12px;
1221
+ padding: 16px !important;
1222
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
1223
+ }
1224
 
1225
+ /* === Headings === */
 
 
1226
  h1, .gr-markdown h1 {
1227
  font-size: 2.2rem !important;
1228
  font-weight: bold;
1229
+ color: #22284F;
1230
  text-align: center;
1231
  margin-bottom: 1rem;
1232
  }
1233
 
1234
+ /* === Inputs === */
1235
+ input[type="text"],
1236
+ .gr-textbox textarea,
1237
+ .gr-dropdown,
1238
+ .gr-slider {
1239
+ background-color: #C2C5EF !important;
1240
+ color: #22284F !important;
1241
+ border-radius: 8px;
1242
+ border: 1px solid #999 !important;
 
 
 
 
1243
  padding: 10px !important;
1244
  font-size: 16px;
1245
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1246
  }
1247
 
1248
  /* === Gallery Grid === */
1249
  .gr-gallery {
1250
  padding-top: 12px;
1251
+ overflow-y: auto;
1252
  }
1253
  .gr-gallery-item {
1254
  width: 128px !important;
1255
  height: 128px !important;
 
1256
  border-radius: 8px;
1257
  overflow: hidden;
1258
+ background-color: #C2C5EF;
1259
+ color: #22284F;
1260
+ transition: transform 0.3s ease-in-out;
1261
  }
1262
  .gr-gallery-item:hover {
1263
  transform: scale(1.06);
1264
+ box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
1265
  }
1266
  .gr-gallery-item img {
1267
+ object-fit: cover;
1268
+ width: 100%;
1269
+ height: 100%;
1270
  border-radius: 8px;
1271
  }
1272
 
1273
+ /* === Audio & Image === */
1274
+ .gr-audio, .gr-image {
1275
  width: 100% !important;
1276
+ max-width: 500px !important;
1277
+ margin: 0 auto;
1278
  border-radius: 12px;
1279
+ background-color: #C2C5EF !important;
1280
+ color: #22284F !important;
1281
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
1282
+ }
1283
+
1284
+ .gr-image {
1285
+ height: 256px !important;
1286
+ }
1287
+
1288
+ /* === Buttons === */
1289
+ .gr-button {
1290
+ background-image: linear-gradient(92.88deg, #455EB5 9.16%, #5643CC 43.89%, #673FD7 64.72%);
1291
+ color: #ffffff !important;
1292
+ border-radius: 8px;
1293
+ font-size: 16px;
1294
+ font-weight: 500;
1295
+ height: 3.5rem;
1296
+ padding: 0 1.5rem;
1297
+ border: none;
1298
+ box-shadow: rgba(80, 63, 205, 0.5) 0 1px 30px;
1299
+ transition: all 0.3s;
1300
+ }
1301
+ .gr-button:hover {
1302
+ transform: translateY(-2px);
1303
+ box-shadow: rgba(80, 63, 205, 0.8) 0 2px 20px;
1304
+ }
1305
+
1306
+ /* === Tab Labels === */
1307
+ button[role="tab"] {
1308
+ color: #22284F !important;
1309
+ font-weight: 500;
1310
+ font-size: 16px;
1311
+ }
1312
+ button[role="tab"][aria-selected="true"] {
1313
+ color: #f57c00 !important;
1314
+ font-weight: bold;
1315
+ }
1316
+ button[role="tab"]:hover {
1317
+ color: #f57c00 !important;
1318
+ font-weight: 600;
1319
+ cursor: pointer;
1320
  }
1321
 
1322
  /* === Footer === */
 
1327
  padding-top: 1rem;
1328
  }
1329
 
1330
+ /* === Responsive === */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1331
  @media (max-width: 768px) {
1332
  #main-container {
1333
  width: 100%;
1334
  margin: 8px;
1335
  padding: 12px;
 
 
1336
  }
1337
 
1338
  .gr-button {
 
1359
  }
1360
  }
1361
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1362
  """
1363
 
1364
 
 
1493
 
1494
  # gr.Markdown("🧠 Powered by OpenAI + Hybrid AI Fashion Search")
1495
 
1496
+ demo.launch()