anhng8 commited on
Commit
3c2feeb
1 Parent(s): 7aa0950

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -387,12 +387,16 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="PEEB") as demo:
387
  gt_class = gr.State("")
388
 
389
  with gr.Column():
390
- title_text = gr.Markdown("# PEEB - demo")
391
  gr.Markdown(
392
  """
393
- - In this demo a demo for PEEB paper (NAACL finding 2024).
394
- - paper: https://arxiv.org/abs/2403.05297
395
- - code: https://github.com/anguyen8/peeb/tree/inspect_ddp
 
 
 
 
396
  """
397
  )
398
 
@@ -401,7 +405,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="PEEB") as demo:
401
 
402
  gr.Markdown("## Select an image to start!")
403
  image_gallery = gr.Gallery(value=IMAGE_GALLERY, label=None, preview=False, allow_preview=False, columns=10, height=250)
404
- gr.Markdown("### Custom descritions: \n The first row should be **class name: {some name};**, where you can name your descriptions. \n For the remianing descriptions, please use **;** to separate the descriptions for each part, and use the format **{part name}: {descriptions}**. \n Note that you can delete a part completely, in such cases, all descriptions will remove the corresponding part.")
405
 
406
  with gr.Row():
407
  with gr.Column():
 
387
  gt_class = gr.State("")
388
 
389
  with gr.Column():
390
+ title_text = gr.Markdown("# A classifier with Part-based Explainable and Editable Bottleneck (PEEB) | Demo")
391
  gr.Markdown(
392
  """
393
+ Here is a PEEB classifier pre-trained on Bird-11K and finetuned on CUB-200 (see our [NAACL 2024 paper](https://arxiv.org/abs/2403.05297) and [code](https://github.com/anguyen8/peeb/tree/inspect_ddp)).\n The demo shows how one runs PEEB on an existing image and edit descriptors to modify the classifier (without any re-training).
394
+
395
+ Steps:
396
+ 1. **Select an image**. Then, PEEB will show its grounded explanations and the top-1 predicted label with associated softmax confidence score.
397
+ 2. **Hover mouse over text descriptors** to see the corresponding region used to match to each text descriptor.
398
+ 3. **Edit the text under [Custom Descriptions]()** which correspond to one extra, new class (i.e. 200+1 = 201). Further editing will overwrite this class' descriptors.
399
+ 4. **Click on Predict** to see the grounded explanations and the top-1 label for the newly modified CUB-201 classifier.
400
  """
401
  )
402
 
 
405
 
406
  gr.Markdown("## Select an image to start!")
407
  image_gallery = gr.Gallery(value=IMAGE_GALLERY, label=None, preview=False, allow_preview=False, columns=10, height=250)
408
+ gr.Markdown("### Custom descriptions: \n The first row should be **class name: {some name};**, the name of your 201th class. \n For the 12 part descriptors, please use **;** to separate the descriptions for each part, and use the format **{part name}: {descriptions}**. \n Note: you can delete a row for some part (e.g. *nape*) completely and that part will be removed from all 201 classes in the classifier.")
409
 
410
  with gr.Row():
411
  with gr.Column():