JVice commited on
Commit
91319d4
β€’
1 Parent(s): c2a772a

Update tab_manager.py

Browse files
Files changed (1) hide show
  1. tab_manager.py +8 -4
tab_manager.py CHANGED
@@ -328,20 +328,24 @@ def initiate_task_oriented_bias_evaluation(tab, modelID, specs, target, imagesTa
328
  TASKImages = []
329
  TASKCaptions = []
330
  with tab:
 
331
  st.write("Initiating Task-Oriented Bias Evaluation Experiments with the following setup:")
332
  st.write(" ***Model*** = ", modelID)
333
  infoColumn1, infoColumn2 = st.columns(2)
 
334
  st.write(" ***No. Images per prompt*** = ", specs["TO Values"][0])
335
  st.write(" ***No. Steps*** = ", specs["TO Values"][1])
336
  st.write(" ***Image Size*** = ", specs["TO Values"][2], "$\\times$", specs["TO Values"][3])
337
  st.write(" ***Target*** = ", target.lower())
338
  st.markdown("___")
339
 
340
- captionsToExtract = 50
341
- if (captionsToExtract * int(specs['TO Values'][0])) < 30:
342
- st.error('There should be at least 30 images generated, You are attempting to generate:\t'
343
- + str(captionsToExtract * int(specs['TO Values'][0]))+'.\nPlease readjust your No. Images per prompt',
344
  icon="🚨")
 
 
 
345
  else:
346
  COCOLoadingBar = st.progress(0, text="Scanning through COCO Dataset for relevant prompts. Please wait")
347
  prompts, cocoIDs = get_COCO_captions('data/COCO_captions.json', target.lower(), COCOLoadingBar, captionsToExtract)
 
328
  TASKImages = []
329
  TASKCaptions = []
330
  with tab:
331
+ captionsToExtract = 50
332
  st.write("Initiating Task-Oriented Bias Evaluation Experiments with the following setup:")
333
  st.write(" ***Model*** = ", modelID)
334
  infoColumn1, infoColumn2 = st.columns(2)
335
+ st.write(" ***No. prompts (pre-defined)*** = ", captionsToExtract)
336
  st.write(" ***No. Images per prompt*** = ", specs["TO Values"][0])
337
  st.write(" ***No. Steps*** = ", specs["TO Values"][1])
338
  st.write(" ***Image Size*** = ", specs["TO Values"][2], "$\\times$", specs["TO Values"][3])
339
  st.write(" ***Target*** = ", target.lower())
340
  st.markdown("___")
341
 
342
+
343
+ if int(specs['TO Values'][0]) < 1:
344
+ st.error('Please readjust your No. Images per prompt to be a valid number (1 or greater)',
 
345
  icon="🚨")
346
+ # st.error('There should be at least 30 images generated, You are attempting to generate:\t'
347
+ # + str(captionsToExtract * int(specs['TO Values'][0]))+'.\nPlease readjust your No. Images per prompt',
348
+ # icon="🚨")
349
  else:
350
  COCOLoadingBar = st.progress(0, text="Scanning through COCO Dataset for relevant prompts. Please wait")
351
  prompts, cocoIDs = get_COCO_captions('data/COCO_captions.json', target.lower(), COCOLoadingBar, captionsToExtract)