Spaces:
Runtime error
Runtime error
adding explanatory text
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ def show_cluster(cl_id, num_clusters):
|
|
| 44 |
|
| 45 |
with gr.Blocks(title=TITLE) as demo:
|
| 46 |
gr.Markdown(f"# {TITLE}")
|
| 47 |
-
gr.Markdown("## This Space lets you explore the data generated from [DiffusionBiasExplorer](https://huggingface.co/spaces/society-ethics/DiffusionBiasExplorer).")
|
| 48 |
gr.HTML("""<span style="color:red" font-size:smaller>⚠️ DISCLAIMER: the images displayed by this tool were generated by text-to-image models and may depict offensive stereotypes or contain explicit content.</span>""")
|
| 49 |
num_clusters = gr.Radio([12,24,48], value=12, label="How many clusters do you want to make from the data?")
|
| 50 |
|
|
@@ -61,6 +61,9 @@ with gr.Blocks(title=TITLE) as demo:
|
|
| 61 |
b = gr.Plot(label="Gender label makeup of cluster")
|
| 62 |
with gr.Column(scale=2):
|
| 63 |
d = gr.Plot(label="Ethnicity label makeup of cluster")
|
|
|
|
|
|
|
|
|
|
| 64 |
demo.load(fn=show_cluster, inputs=[cluster_id, num_clusters], outputs=[a,b,c,d, gallery])
|
| 65 |
num_clusters.change(fn=show_cluster, inputs=[cluster_id, num_clusters], outputs=[a,b,c,d, gallery])
|
| 66 |
cluster_id.change(fn=show_cluster, inputs=[cluster_id, num_clusters], outputs=[a,b,c,d, gallery])
|
|
|
|
| 44 |
|
| 45 |
with gr.Blocks(title=TITLE) as demo:
|
| 46 |
gr.Markdown(f"# {TITLE}")
|
| 47 |
+
gr.Markdown("## This Space lets you explore the clusters based on the data generated from [DiffusionBiasExplorer](https://huggingface.co/spaces/society-ethics/DiffusionBiasExplorer).")
|
| 48 |
gr.HTML("""<span style="color:red" font-size:smaller>⚠️ DISCLAIMER: the images displayed by this tool were generated by text-to-image models and may depict offensive stereotypes or contain explicit content.</span>""")
|
| 49 |
num_clusters = gr.Radio([12,24,48], value=12, label="How many clusters do you want to make from the data?")
|
| 50 |
|
|
|
|
| 61 |
b = gr.Plot(label="Gender label makeup of cluster")
|
| 62 |
with gr.Column(scale=2):
|
| 63 |
d = gr.Plot(label="Ethnicity label makeup of cluster")
|
| 64 |
+
gr.Markdown(f"The 'Model makeup' plot corresponds to the number of images from the cluster that come from each of the TTI systems that we are comparing: Dall-E 2, Stable Diffusion v.1.4. and Stable Diffusion v.2.")
|
| 65 |
+
gr.Markdown(f"The 'Gender label makeup' plot corresponds to the number of images from each of the genders used in the prompts: male, female, non-binary and unmarked ('person')")
|
| 66 |
+
gr.Markdown(f"The 'Ethnicity label makeup' plot corresponds to the number of images from each of the 18 ethnicities used in the prompts. A blank value means unmarked ethnicity")
|
| 67 |
demo.load(fn=show_cluster, inputs=[cluster_id, num_clusters], outputs=[a,b,c,d, gallery])
|
| 68 |
num_clusters.change(fn=show_cluster, inputs=[cluster_id, num_clusters], outputs=[a,b,c,d, gallery])
|
| 69 |
cluster_id.change(fn=show_cluster, inputs=[cluster_id, num_clusters], outputs=[a,b,c,d, gallery])
|