Spaces:
Paused
Paused
improvments to prompts
Browse files
app.py
CHANGED
@@ -46,46 +46,45 @@ modality = st.selectbox('Modality', modalities, index=None)
|
|
46 |
style = st.selectbox('Style', artists, index=None)
|
47 |
|
48 |
image_descriptions = {
|
49 |
-
"COMPUTED TOMOGRAPHY (CT)": "
|
50 |
-
"DIGITAL BREAST TOMOSYNTHESIS": "
|
51 |
-
"DIGITAL MAMMOGRAPHY": "
|
52 |
-
"MAGNETIC RESONANCE IMAGING (MRI)": "
|
53 |
-
"MICRO-CT": "
|
54 |
-
"PET-CT": "
|
55 |
-
"POSITRON EMISSION TOMOGRAPHY (PET)": "
|
56 |
-
"RADIOGRAPHY": "
|
57 |
-
"ULTRASONOGRAPHY": "
|
58 |
}
|
59 |
|
60 |
-
# Descriptions for each organ
|
61 |
organ_descriptions = {
|
62 |
-
"ANUS": "
|
63 |
-
"AORTA": "
|
64 |
-
"BLADDER": "
|
65 |
-
"BONE": "
|
66 |
-
"BRAIN": "
|
67 |
-
"BREAST": "
|
68 |
-
"CERVIX": "
|
69 |
-
"CHEST": "
|
70 |
-
"COLON": "
|
71 |
-
"CORONARY HEART": "
|
72 |
-
"EAR": "
|
73 |
-
"ENDOMETRIUM": "
|
74 |
-
"ESOPHAGUS": "
|
75 |
-
"HEAD AND NECK": "
|
76 |
-
"KIDNEY": "
|
77 |
-
"LIVER": "
|
78 |
-
"LUNG": "
|
79 |
-
"LYMPH NODE": "
|
80 |
-
"OVARY": "
|
81 |
-
"PANCREAS": "
|
82 |
-
"PELVIS": "
|
83 |
-
"PERIPHERAL ARTERIAL": "
|
84 |
-
"PHANTOM": "
|
85 |
-
"PROSTATE": "
|
86 |
-
"RECTUM": "
|
87 |
-
"SOFT TISSUES": "
|
88 |
-
"UTERUS": "
|
89 |
}
|
90 |
|
91 |
if organ != None:
|
@@ -95,41 +94,43 @@ if modality != None:
|
|
95 |
|
96 |
|
97 |
artist_prompts = {
|
98 |
-
"Leonardo da Vinci":
|
99 |
-
"Vincent van Gogh":
|
100 |
-
"Pablo Picasso":
|
101 |
-
"Claude Monet":
|
102 |
-
"Rembrandt":
|
103 |
-
"Michelangelo":
|
104 |
-
"Raphael":
|
105 |
-
"Henri Matisse":
|
106 |
-
"Paul Cezanne":
|
107 |
-
"Gustav Klimt":
|
108 |
-
"Jackson Pollock":
|
109 |
-
"Edgar Degas":
|
110 |
-
"Francisco Goya":
|
111 |
-
"Edouard Manet":
|
112 |
-
"Andy Warhol":
|
113 |
-
"Salvador Dal铆":
|
114 |
-
"Wassily Kandinsky":
|
115 |
-
"Paul Gauguin":
|
116 |
-
"Joan Mir贸":
|
117 |
-
"Georges Seurat":
|
118 |
-
"脡douard Vuillard":
|
119 |
-
"Marc Chagall":
|
120 |
-
"Kazimir Malevich":
|
121 |
-
"Piet Mondrian":
|
122 |
-
"Jean-Michel Basquiat":
|
123 |
-
"Frida Kahlo":
|
124 |
-
"Artemisia Gentileschi":
|
125 |
-
"Caravaggio":
|
126 |
-
"El Greco":
|
127 |
-
"Eug猫ne Delacroix":
|
128 |
-
"J.M.W. Turner":
|
129 |
}
|
130 |
|
131 |
|
132 |
-
|
|
|
|
|
133 |
for artist, prompt in artist_prompts.items()}
|
134 |
|
135 |
|
|
|
46 |
style = st.selectbox('Style', artists, index=None)
|
47 |
|
48 |
image_descriptions = {
|
49 |
+
"COMPUTED TOMOGRAPHY (CT) scan": "CT scan",
|
50 |
+
"DIGITAL BREAST TOMOSYNTHESIS image": "3D breast tomosynthesis image",
|
51 |
+
"DIGITAL MAMMOGRAPHY image": "digital mammography image",
|
52 |
+
"MAGNETIC RESONANCE IMAGING (MRI) scan": "MRI scan",
|
53 |
+
"MICRO-CT scan": "micro-CT scan",
|
54 |
+
"PET-CT scan": "PET-CT scan",
|
55 |
+
"POSITRON EMISSION TOMOGRAPHY (PET) scan": "PET scan",
|
56 |
+
"RADIOGRAPHY image": "radiography image",
|
57 |
+
"ULTRASONOGRAPHY image": "ultrasonography image"
|
58 |
}
|
59 |
|
|
|
60 |
organ_descriptions = {
|
61 |
+
"ANUS": "of the anus, focusing on musculature and surrounding tissues",
|
62 |
+
"AORTA": "of the aorta, capturing the main artery and branches",
|
63 |
+
"BLADDER": "of the bladder, emphasizing its structure",
|
64 |
+
"BONE": "of the bone, showcasing its structure",
|
65 |
+
"BRAIN": "of the brain, highlighting its structures",
|
66 |
+
"BREAST": "of the breast, focusing on its anatomy",
|
67 |
+
"CERVIX": "of the cervix, capturing its features",
|
68 |
+
"CHEST": "of the chest, showcasing thoracic cavity",
|
69 |
+
"COLON": "of the colon, emphasizing its structure",
|
70 |
+
"CORONARY HEART": "of the coronary heart, highlighting coronary arteries",
|
71 |
+
"EAR": "of the ear, focusing on outer, middle, and inner ear",
|
72 |
+
"ENDOMETRIUM": "of the endometrium, highlighting uterine lining",
|
73 |
+
"ESOPHAGUS": "of the esophagus, emphasizing its structure",
|
74 |
+
"HEAD AND NECK": "of the head and neck, showcasing anatomical structures",
|
75 |
+
"KIDNEY": "of the kidney, focusing on internal structure",
|
76 |
+
"LIVER": "of the liver, highlighting its lobes",
|
77 |
+
"LUNG": "of the lung, showcasing respiratory anatomy",
|
78 |
+
"LYMPH NODE": "of the lymph node, emphasizing anatomical features",
|
79 |
+
"OVARY": "of the ovary, highlighting internal structures",
|
80 |
+
"PANCREAS": "of the pancreas, showcasing its structure",
|
81 |
+
"PELVIS": "of the pelvis, focusing on bone structure",
|
82 |
+
"PERIPHERAL ARTERIAL": "of the peripheral arterial system, highlighting vascular structures",
|
83 |
+
"PHANTOM": "of a phantom, focusing on simulated features",
|
84 |
+
"PROSTATE": "of the prostate, emphasizing its structure",
|
85 |
+
"RECTUM": "of the rectum, highlighting its anatomy",
|
86 |
+
"SOFT TISSUES": "of the soft tissues, showcasing detailed anatomy",
|
87 |
+
"UTERUS": "of the uterus, emphasizing its structure"
|
88 |
}
|
89 |
|
90 |
if organ != None:
|
|
|
94 |
|
95 |
|
96 |
artist_prompts = {
|
97 |
+
"Leonardo da Vinci": "Generate a detailed {image_description} {organ_description} in the style of Leonardo da Vinci. Emphasize anatomical precision with Renaissance aesthetics.",
|
98 |
+
"Vincent van Gogh": "Create a {image_description} {organ_description} in the style of Vincent van Gogh. Use bold brushstrokes and vibrant colors.",
|
99 |
+
"Pablo Picasso": "Produce a {image_description} {organ_description} in the style of Pablo Picasso. Use cubist elements and abstract shapes.",
|
100 |
+
"Claude Monet": "Generate a {image_description} {organ_description} in the style of Claude Monet. Use soft colors and diffused light.",
|
101 |
+
"Rembrandt": "Create a {image_description} {organ_description} in the style of Rembrandt. Emphasize dramatic lighting and contrasts.",
|
102 |
+
"Michelangelo": "Produce a {image_description} {organ_description} in the style of Michelangelo. Emphasize anatomical detail and sculptural quality.",
|
103 |
+
"Raphael": "Generate an accurate {image_description} {organ_description} in the style of Raphael. Use harmonious compositions and delicate lines.",
|
104 |
+
"Henri Matisse": "Create a {image_description} {organ_description} in the style of Henri Matisse. Use bold colors and simplified forms.",
|
105 |
+
"Paul Cezanne": "Produce a {image_description} {organ_description} in the style of Paul Cezanne. Use geometric simplification and structured forms.",
|
106 |
+
"Gustav Klimt": "Generate a {image_description} {organ_description} in the style of Gustav Klimt. Incorporate intricate patterns and a decorative quality.",
|
107 |
+
"Jackson Pollock": "Create a {image_description} {organ_description} in the style of Jackson Pollock. Use energetic splatters and abstract layers.",
|
108 |
+
"Edgar Degas": "Produce a {image_description} {organ_description} in the style of Edgar Degas. Use soft pastels and delicate lines.",
|
109 |
+
"Francisco Goya": "Generate a {image_description} {organ_description} in the style of Francisco Goya. Emphasize strong contrasts and a somber tone.",
|
110 |
+
"Edouard Manet": "Create a {image_description} {organ_description} in the style of Edouard Manet. Use loose brushstrokes and focus on light and shadow.",
|
111 |
+
"Andy Warhol": "Produce a {image_description} {organ_description} in the style of Andy Warhol. Use bright colors and a graphic aesthetic.",
|
112 |
+
"Salvador Dal铆": "Generate a {image_description} {organ_description} in the style of Salvador Dal铆. Incorporate surreal elements and distorted forms.",
|
113 |
+
"Wassily Kandinsky": "Create a {image_description} {organ_description} in the style of Wassily Kandinsky. Use vibrant colors and geometric shapes.",
|
114 |
+
"Paul Gauguin": "Produce a {image_description} {organ_description} in the style of Paul Gauguin. Use bold colors and strong outlines.",
|
115 |
+
"Joan Mir贸": "Generate a {image_description} {organ_description} in the style of Joan Mir贸. Use playful shapes and bright colors.",
|
116 |
+
"Georges Seurat": "Create an accurate {image_description} {organ_description} in the style of Georges Seurat. Use pointillism with tiny dots of color.",
|
117 |
+
"脡douard Vuillard": "Produce a {image_description} {organ_description} in the style of 脡douard Vuillard. Use soft colors and intricate patterns.",
|
118 |
+
"Marc Chagall": "Generate a {image_description} {organ_description} in the style of Marc Chagall. Use rich colors and fantastical elements.",
|
119 |
+
"Kazimir Malevich": "Create an accurate {image_description} {organ_description} in the style of Kazimir Malevich. Use geometric shapes and minimalism.",
|
120 |
+
"Piet Mondrian": "Produce a {image_description} {organ_description} in the style of Piet Mondrian. Use clean lines and primary colors.",
|
121 |
+
"Jean-Michel Basquiat": "Generate a {image_description} {organ_description} in the style of Jean-Michel Basquiat. Use bold lines and graffiti elements.",
|
122 |
+
"Frida Kahlo": "Create an accurate {image_description} {organ_description} in the style of Frida Kahlo. Use rich colors and symbolic elements.",
|
123 |
+
"Artemisia Gentileschi": "Produce a {image_description} {organ_description} in the style of Artemisia Gentileschi. Use strong contrasts and rich colors.",
|
124 |
+
"Caravaggio": "Generate a {image_description} {organ_description} in the style of Caravaggio. Use dramatic lighting and meticulous detail.",
|
125 |
+
"El Greco": "Create a {image_description} {organ_description} in the style of El Greco. Use elongated forms and dramatic color.",
|
126 |
+
"Eug猫ne Delacroix": "Produce a {image_description} {organ_description} in the style of Eug猫ne Delacroix. Use vivid colors and energetic brushstrokes.",
|
127 |
+
"J.M.W. Turner": "Generate a {image_description} {organ_description} in the style of J.M.W. Turner. Use soft light and swirling colors."
|
128 |
}
|
129 |
|
130 |
|
131 |
+
|
132 |
+
|
133 |
+
combined_prompts = {artist: prompt.replace("{image_description}", "{image_description}").replace("{organ_description}", "{organ_description}")
|
134 |
for artist, prompt in artist_prompts.items()}
|
135 |
|
136 |
|