Spaces:
Sleeping
Sleeping
File size: 19,630 Bytes
191195c 9167246 191195c 9167246 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 9167246 191195c 1dd67b4 9167246 1dd67b4 9167246 191195c 1dd67b4 191195c 1dd67b4 191195c 1dd67b4 9167246 1dd67b4 191195c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
import streamlit as st
import streamlit.components.v1 as components
import os
# import cv2
ROOT_FIG_DIR = f'{os.getcwd()}/figures/'
def get_product_dev_page_layout():
row4_1, row4_2, row4_3 = st.tabs(["Data Source Information", "Exploratory Data Stats", "Data Onboarding"])
with row4_1:
# st.write("**Data Source Info**")
st.subheader('Data Source and Version Information')
# new_title = '<h4 style="color:Green;">Data set infor:</h4>'
# st.markdown(new_title, unsafe_allow_html=True)
# where the data comes and how it is collected, what the data includes, what are the details of the data, how the data is used.
# answers four different questions
st.write("The data set consists of OCT images from CNV, DME, DRUSEN and NORMAL cases(from 4686 adult patients in total).")
st.warning('Source')
st.write("[Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification](https://data.mendeley.com/datasets/rscbjbr9sj/3)")
st.caption("Version: 3")
with st.expander('Data Collection Details(Click for more info)'):
st.write("""OCT images are collected from the Shiley Eye Institute of the University of California San Diego,
the California Retinal Research Foundation,
Medical Center Ophthalmology Associates, the Shanghai First People’s Hospital, and Beijing Tongren Eye Center between
July 1, 2013 and March 1, 2017.""")
st.subheader('Case Samples')
# st.caption('VisuCase Samples')
# https://www.aao.org/eye-health/ask-ophthalmologist-q/choroidal-neovascularization-definition-treatment
st.image('./figures/oct_details.png')
list_test = """<ul>Case explanations:
<li><strong>Choroidal Neovascularization (CNV)</strong> is a type of retinal disease that involves the growth of abnormal blood vessels in the choroid layer of the eye. These new blood vessels can lead to fluid accumulation beneath and within the layers of tissue, causing vision loss.
</li>
<li> <strong>Diabetic Macular Edema (DME)</strong> is a common complication of diabetes that affects the retina responsible for central vision. This condition occurs when fluid accumulates in and around the macula, leading to retinal thickening and swelling, which can result in impaired vision or blindness.
</li>
<li><strong>DRUSEN</strong> is a condition associated with early Age-Related Macular Degeneration (AMD) in the retina. It involves the accumulation of small deposits of waste material in the retina, which can lead to vision problems.
</li>
<li><strong>NORMAL </strong> represents healthy retinalconditions and is a baseline for comparison with the aforementioned anomalies</li>
</ul>"""
st.markdown(list_test, unsafe_allow_html=True)
st.subheader('License Infomation')
with st.expander('License: CC BY 4.0 license'):
st.write("""
The files associated with this dataset are licensed under a Creative Commons Attribution 4.0 International license. What does this mean?
You can share, copy and modify this dataset so long as you give appropriate credit,
provide a link to the CC BY license, and indicate if changes were made, but you may not do
so in a way that suggests the rights holder has endorsed you or your use of the dataset.
Note that further permission may be required for any content within the dataset
that is identified as belonging to a third party. More details about the licences can be found
[here](https://creativecommons.org/about/cclicenses/).
""")
# st.write("Open to be used for researh.")
with row4_2:
st.subheader('Exploratory Data Stats')
st.write("""
The details regarding the train and test data are presented here. The details cover the following variables: number of samples per each category(label), image width and height, image aspect ratio.
""")
with st.expander('Click to Explore Training Data'):
st.info("While exploring, select a column name under Variable to see further details.")
HtmlFile = open(f'{ROOT_FIG_DIR}/train_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
with st.expander('Click to Explore Test Data'):
st.info("While exploring, select a column name under Variable to see further details.")
HtmlFile = open(f'{ROOT_FIG_DIR}/test_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
with st.expander('Click to Explore Sample Visualization'):
clss = st.selectbox('Select a category(class)', ["CNV","DME", "NORMAL", "DRUSEN"])
img_path = f'{ROOT_FIG_DIR}/{clss}_samples.png'
st.image(img_path)
# HtmlFile = open(f'{ROOT_FIG_DIR}/test_set_report.html', 'r', encoding='utf-8')
# source_code = HtmlFile.read()
# components.html(source_code,scrolling=True, height=500)
with row4_3:
st.write("Data post-processing and augmentations are given in this section")
st.subheader('Post-Processing Details')
st.write(
"""
Due to the presence of class imbalance in the data, a representative sampling strategy has been employed for the training set, utilizing hierarchical clustering to address this issue.The following algorthm describes the steps carried out to solve the issue.""")
# st.caption('')
# new_title = '<h5 style="color:Black;">Post Processing Steps:</h5>'
# st.markdown(new_title, unsafe_allow_html=True)
algo_path = f'{ROOT_FIG_DIR}/classimbalance.png'
st.image(algo_path)
# code = '''def representative_sampling():
# for each_class in category_list:
# embeddings = get_resnet50_embeddings(each_class)
# n_cluster = run_hierarchical_clustering(embeddings)
# samples = get_representative_n_samples_within_each_cluster(n_cluster)'''
# st.code(code, language='python')
with st.expander('Click to Explore Post-processed Training Data by Representative Sampling'):
HtmlFile = open(f'{ROOT_FIG_DIR}/filtered_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
st.subheader('Applied Data Augmentations')
st.write("Model Input Size Resizing: 180x180x3")
# st.caption('Post Processing Steps:')
# code = '''def representative_sampling():
# ... for class_i in category_list:
# ... print("Hello, Streamlit!")'''
# st.code(code, language='python')
# st.code('for class_i in category_list: hiearhical_cluster(class_i)')
def get_product_manager_page_layout():
row4_1, row4_2 = st.tabs(["Data Source Information", "Exploratory Data Stats"])
with row4_1:
# st.write("**Data Source Info**")
st.subheader('Data Source and Version Information')
# new_title = '<h4 style="color:Green;">Data set infor:</h4>'
# st.markdown(new_title, unsafe_allow_html=True)
# where the data comes and how it is collected, what the data includes, what are the details of the data, how the data is used.
# answers four different questions
st.write(" The data set consists of OCT images from CNV, DME, DRUSEN and NORMAL cases(from 4686 adult patients in total).")
st.warning('Source')
st.write("[Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification](https://data.mendeley.com/datasets/rscbjbr9sj/3)")
st.caption("Version: 3")
with st.expander('Data Collection Details(Click for more info)'):
st.write("""OCT images are collected from the Shiley Eye Institute of the University of California San Diego,
the California Retinal Research Foundation,
Medical Center Ophthalmology Associates, the Shanghai First People’s Hospital, and Beijing Tongren Eye Center between
July 1, 2013 and March 1, 2017.""")
st.subheader('Case Samples')
# st.caption('VisuCase Samples')
# https://www.aao.org/eye-health/ask-ophthalmologist-q/choroidal-neovascularization-definition-treatment
st.image('./figures/oct_details.png')
list_test = """<ul>Case explanations:
<li><strong>Choroidal Neovascularization (CNV)</strong> is a type of retinal disease that involves the growth of abnormal blood vessels in the choroid layer of the eye. These new blood vessels can lead to fluid accumulation beneath and within the layers of tissue, causing vision loss.
</li>
<li> <strong>Diabetic Macular Edema (DME)</strong> is a common complication of diabetes that affects the retina responsible for central vision. This condition occurs when fluid accumulates in and around the macula, leading to retinal thickening and swelling, which can result in impaired vision or blindness.
</li>
<li><strong>DRUSEN</strong> is a condition associated with early Age-Related Macular Degeneration (AMD) in the retina. It involves the accumulation of small deposits of waste material in the retina, which can lead to vision problems.
</li>
<li><strong>NORMAL </strong> represents healthy retinalconditions and is a baseline for comparison with the aforementioned anomalies</li>
</ul>"""
st.markdown(list_test, unsafe_allow_html=True)
st.subheader('License Infomation')
with st.expander('License: CC BY 4.0 license'):
st.write("""
The files associated with this dataset are licensed under a Creative Commons Attribution 4.0 International license. What does this mean?
You can share, copy and modify this dataset so long as you give appropriate credit,
provide a link to the CC BY license, and indicate if changes were made, but you may not do
so in a way that suggests the rights holder has endorsed you or your use of the dataset.
Note that further permission may be required for any content within the dataset
that is identified as belonging to a third party. More details about the licences can be found
[here](https://creativecommons.org/about/cclicenses/).
""")
# st.write("Open to be used for researh.")
with row4_2:
st.subheader('Exploratory Data Stats')
st.write("""
The details regarding the train and test data are presented here. The details cover the following variables: number of samples per each category(label), image width and height, image aspect ratio.
""")
with st.expander('Click to Explore Training Data'):
st.info("While exploring, select a column name under Variable to see further details.")
HtmlFile = open(f'{ROOT_FIG_DIR}/train_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
with st.expander('Click to Explore Test Data'):
st.info("While exploring, select a column name under Variable to see further details.")
HtmlFile = open(f'{ROOT_FIG_DIR}/test_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
with st.expander('Click to Explore Sample Visualization'):
clss = st.selectbox('Select a category(class)', ["CNV","DME", "NORMAL", "DRUSEN"])
img_path = f'{ROOT_FIG_DIR}/{clss}_samples.png'
st.image(img_path)
# HtmlFile = open(f'{ROOT_FIG_DIR}/test_set_report.html', 'r', encoding='utf-8')
# source_code = HtmlFile.read()
# components.html(source_code,scrolling=True, height=500)
def get_product_practitioner_page_layout():
row4_1, row4_2, row4_3 = st.tabs(["Data Source Information", "Exploratory Data Stats", "Data Onboarding"])
with row4_1:
# st.write("**Data Source Info**")
st.subheader('Data Source and Version Information')
# new_title = '<h4 style="color:Green;">Data set infor:</h4>'
# st.markdown(new_title, unsafe_allow_html=True)
# where the data comes and how it is collected, what the data includes, what are the details of the data, how the data is used.
# answers four different questions
st.write(" The data set consists of OCT images from CNV, DME, DRUSEN and NORMAL cases(from 4686 adult patients in total).")
st.warning('Source')
st.write("[Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification](https://data.mendeley.com/datasets/rscbjbr9sj/3)")
st.caption("Version: 3")
with st.expander('Data Collection Details(Click for more info)'):
st.write("""OCT images are collected from the Shiley Eye Institute of the University of California San Diego,
the California Retinal Research Foundation,
Medical Center Ophthalmology Associates, the Shanghai First People’s Hospital, and Beijing Tongren Eye Center between
July 1, 2013 and March 1, 2017.""")
st.subheader('Case Samples')
# st.caption('VisuCase Samples')
# https://www.aao.org/eye-health/ask-ophthalmologist-q/choroidal-neovascularization-definition-treatment
st.image('./figures/oct_details.png')
list_test = """<ul>Case explanations:
<li><strong>Choroidal Neovascularization (CNV)</strong> is a type of retinal disease that involves the growth of abnormal blood vessels in the choroid layer of the eye. These new blood vessels can lead to fluid accumulation beneath and within the layers of tissue, causing vision loss.
</li>
<li> <strong>Diabetic Macular Edema (DME)</strong> is a common complication of diabetes that affects the retina responsible for central vision. This condition occurs when fluid accumulates in and around the macula, leading to retinal thickening and swelling, which can result in impaired vision or blindness.
</li>
<li><strong>DRUSEN</strong> is a condition associated with early Age-Related Macular Degeneration (AMD) in the retina. It involves the accumulation of small deposits of waste material in the retina, which can lead to vision problems.
</li>
<li><strong>NORMAL </strong> represents healthy retinalconditions and is a baseline for comparison with the aforementioned anomalies</li>
</ul>"""
st.markdown(list_test, unsafe_allow_html=True)
st.subheader('License Infomation')
with st.expander('License: CC BY 4.0 license'):
st.write("""
The files associated with this dataset are licensed under a Creative Commons Attribution 4.0 International license. What does this mean?
You can share, copy and modify this dataset so long as you give appropriate credit,
provide a link to the CC BY license, and indicate if changes were made, but you may not do
so in a way that suggests the rights holder has endorsed you or your use of the dataset.
Note that further permission may be required for any content within the dataset
that is identified as belonging to a third party. More details about the licences can be found
[here](https://creativecommons.org/about/cclicenses/).
""")
# st.write("Open to be used for researh.")
with row4_2:
st.subheader('Exploratory Data Stats')
st.write("""
The details regarding the train and test data are presented here. The details cover the following variables: number of samples per each category(label), image width and height, image aspect ratio.
""")
with st.expander('Click to Explore Training Data'):
st.info("While exploring, select a column name under Variable to see further details.")
HtmlFile = open(f'{ROOT_FIG_DIR}/train_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
with st.expander('Click to Explore Test Data'):
st.info("While exploring, select a column name under Variable to see further details.")
HtmlFile = open(f'{ROOT_FIG_DIR}/test_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
with st.expander('Click to Explore Sample Visualization'):
clss = st.selectbox('Select a category(class)', ["CNV","DME", "NORMAL", "DRUSEN"])
img_path = f'{ROOT_FIG_DIR}/{clss}_samples.png'
st.image(img_path)
# HtmlFile = open(f'{ROOT_FIG_DIR}/test_set_report.html', 'r', encoding='utf-8')
# source_code = HtmlFile.read()
# components.html(source_code,scrolling=True, height=500)
with row4_3:
st.write("Data post-processing and augmentations are given in this section")
st.subheader('Post-Processing Details')
st.write(
"""
Due to the presence of class imbalance in the data, a representative sampling strategy has been employed for the training set, utilizing hierarchical clustering to address this issue.The following algorthm describes the steps carried out to solve the issue.""")
# st.caption('')
# new_title = '<h5 style="color:Black;">Post Processing Steps:</h5>'
# st.markdown(new_title, unsafe_allow_html=True)
algo_path = f'{ROOT_FIG_DIR}/classimbalance.png'
st.image(algo_path)
# code = '''def representative_sampling():
# for each_class in category_list:
# embeddings = get_resnet50_embeddings(each_class)
# n_cluster = run_hierarchical_clustering(embeddings)
# samples = get_representative_n_samples_within_each_cluster(n_cluster)'''
# st.code(code, language='python')
with st.expander('Click to Explore Post-processed Training Data by Representative Sampling'):
HtmlFile = open(f'{ROOT_FIG_DIR}/filtered_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
st.subheader('Applied Data Augmentations')
st.write("Model Input Size Resizing: 180x180x3")
# st.caption('Post Processing Steps:')
# code = '''def representative_sampling():
# ... for class_i in category_list:
# ... print("Hello, Streamlit!")'''
# st.code(code, language='python')
# st.code('for class_i in category_list: hiearhical_cluster(class_i)')
|