forouzanfallah commited on
Commit
2a1cb72
Β·
verified Β·
1 Parent(s): aa17c5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -4
app.py CHANGED
@@ -837,7 +837,25 @@ if __name__ == "__main__":
837
  print(f"Low resolution folder: {LOW_RES_FOLDER} [{'βœ“' if os.path.isdir(LOW_RES_FOLDER) else 'βœ—'}]")
838
  print("=" * 60)
839
 
840
- with gr.Blocks(title=STUDY_TITLE, theme=gr.themes.Soft()) as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
841
 
842
  # Hidden state - Added user_assigned_images
843
  state_uid = gr.State("")
@@ -897,7 +915,8 @@ if __name__ == "__main__":
897
  show_download_button=False,
898
  type="pil",
899
  image_mode="RGB",
900
- height=CANDIDATE_IMAGE_HEIGHT_STEP_A
 
901
  )
902
  a_imgs.append(img)
903
 
@@ -915,7 +934,8 @@ if __name__ == "__main__":
915
  show_download_button=False,
916
  type="pil",
917
  image_mode="RGB",
918
- height=REFERENCE_IMAGE_HEIGHT
 
919
  )
920
 
921
  # Create image components dynamically in rows
@@ -931,7 +951,8 @@ if __name__ == "__main__":
931
  show_download_button=False,
932
  type="pil",
933
  image_mode="RGB",
934
- height=CANDIDATE_IMAGE_HEIGHT_STEP_B
 
935
  )
936
  b_imgs.append(img)
937
 
 
837
  print(f"Low resolution folder: {LOW_RES_FOLDER} [{'βœ“' if os.path.isdir(LOW_RES_FOLDER) else 'βœ—'}]")
838
  print("=" * 60)
839
 
840
+ custom_css = f"""
841
+ .cand-a img {{
842
+ height: {CANDIDATE_IMAGE_HEIGHT_STEP_A}px !important;
843
+ width: auto !important;
844
+ object-fit: contain;
845
+ }}
846
+ .cand-b img {{
847
+ height: {CANDIDATE_IMAGE_HEIGHT_STEP_B}px !important;
848
+ width: auto !important;
849
+ object-fit: contain;
850
+ }}
851
+ .ref-a img {{
852
+ height: {REFERENCE_IMAGE_HEIGHT}px !important;
853
+ width: auto !important;
854
+ object-fit: contain;
855
+ }}
856
+ """
857
+
858
+ with gr.Blocks(title=STUDY_TITLE, theme=gr.themes.Soft(), css=custom_css) as demo:
859
 
860
  # Hidden state - Added user_assigned_images
861
  state_uid = gr.State("")
 
915
  show_download_button=False,
916
  type="pil",
917
  image_mode="RGB",
918
+ height= None, #CANDIDATE_IMAGE_HEIGHT_STEP_A,
919
+ elem_classes=["cand-a"],
920
  )
921
  a_imgs.append(img)
922
 
 
934
  show_download_button=False,
935
  type="pil",
936
  image_mode="RGB",
937
+ height= None, #REFERENCE_IMAGE_HEIGHT,
938
+ elem_classes=["ref-a"]
939
  )
940
 
941
  # Create image components dynamically in rows
 
951
  show_download_button=False,
952
  type="pil",
953
  image_mode="RGB",
954
+ height= None, #CANDIDATE_IMAGE_HEIGHT_STEP_B
955
+ elem_classes=["cand-b"]
956
  )
957
  b_imgs.append(img)
958