Fix Dataset Info
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ HYBRID_MODEL = [
|
|
| 23 |
("TRANSFORMER", "XGBOOST", "Transformer + XGBoost", "models/TRANSFORMER/xgboost_transformer_optuna_10122025_050346.joblib", "models/XGBOOST/xgboost_transformer_optuna_10122025_044957.joblib"),
|
| 24 |
]
|
| 25 |
|
| 26 |
-
#
|
| 27 |
SINGLE_MODELS = [
|
| 28 |
("Single LSTM", "models/LSTM/single_LSTM_default_10122025_135523.joblib"),
|
| 29 |
("Single Transformer", "models/TRANSFORMER/single_transformer_grid_10122025_115452.joblib"),
|
|
@@ -132,11 +132,19 @@ input, select, textarea, .gr-button, .gr-input, .gr-textbox, .gr-dropdown, .gr-f
|
|
| 132 |
border-color: #444 !important;
|
| 133 |
}
|
| 134 |
.gr-button {border-radius: 6px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
"""
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
-
with gr.Blocks(
|
| 140 |
gr.HTML('<div id="title">Atrial Fibrillation Detect</div>')
|
| 141 |
gr.HTML('<div id="subtitle">Menganalisis data EKG mengenai adanya Atrial Fibration</div>')
|
| 142 |
file_upload = gr.File(label="Upload Dataset/Sinyal (CSV)")
|
|
@@ -148,45 +156,49 @@ with gr.Blocks(css=css) as demo:
|
|
| 148 |
file_upload.change(store_file, inputs=file_upload, outputs=shared_file_path)
|
| 149 |
|
| 150 |
with gr.Tab("Dataset Info"):
|
| 151 |
-
gr.Markdown(
|
| 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 |
with gr.Tab("Analyze Dataset"):
|
| 189 |
-
info_ds = gr.Textbox(label="Info Dataset", interactive=False)
|
| 190 |
preview_ds = gr.Dataframe(label="Preview Data", interactive=False)
|
| 191 |
plot_ds = gr.Plot(label="Plot Sinyal (ECG)")
|
| 192 |
btn_ds = gr.Button("Analyze Dataset")
|
|
@@ -234,4 +246,4 @@ This annotation information is reproduced under the terms of the CC BY 4.0 licen
|
|
| 234 |
|
| 235 |
tombol.click(lambda s, m: analisis_sinyal(get_file_for_model(s), m), inputs=[shared_file_path, pilih_model], outputs=[hasil, visual])
|
| 236 |
|
| 237 |
-
demo.launch()
|
|
|
|
| 23 |
("TRANSFORMER", "XGBOOST", "Transformer + XGBoost", "models/TRANSFORMER/xgboost_transformer_optuna_10122025_050346.joblib", "models/XGBOOST/xgboost_transformer_optuna_10122025_044957.joblib"),
|
| 24 |
]
|
| 25 |
|
| 26 |
+
# single learning LSTM dan Transformer
|
| 27 |
SINGLE_MODELS = [
|
| 28 |
("Single LSTM", "models/LSTM/single_LSTM_default_10122025_135523.joblib"),
|
| 29 |
("Single Transformer", "models/TRANSFORMER/single_transformer_grid_10122025_115452.joblib"),
|
|
|
|
| 132 |
border-color: #444 !important;
|
| 133 |
}
|
| 134 |
.gr-button {border-radius: 6px;}
|
| 135 |
+
.license-box {
|
| 136 |
+
border: 2px solid #fff;
|
| 137 |
+
border-radius: 10px;
|
| 138 |
+
padding: 18px;
|
| 139 |
+
margin-top: 18px;
|
| 140 |
+
background: #111;
|
| 141 |
+
color: #fff;
|
| 142 |
+
}
|
| 143 |
"""
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
+
with gr.Blocks() as demo:
|
| 148 |
gr.HTML('<div id="title">Atrial Fibrillation Detect</div>')
|
| 149 |
gr.HTML('<div id="subtitle">Menganalisis data EKG mengenai adanya Atrial Fibration</div>')
|
| 150 |
file_upload = gr.File(label="Upload Dataset/Sinyal (CSV)")
|
|
|
|
| 156 |
file_upload.change(store_file, inputs=file_upload, outputs=shared_file_path)
|
| 157 |
|
| 158 |
with gr.Tab("Dataset Info"):
|
| 159 |
+
gr.Markdown(
|
| 160 |
+
"""
|
| 161 |
+
## Daftar File Dataset
|
| 162 |
+
Gunakan tombol download di bawah untuk mengunduh file dataset:
|
| 163 |
+
"""
|
| 164 |
+
)
|
| 165 |
+
gr.Markdown(f"""
|
| 166 |
+
**Download Dataset:**
|
| 167 |
+
- [Download mimic_perform_af_001_data.csv](file/Data/mimic_perform_af_001_data.csv) (Atrial Fibrillation)
|
| 168 |
+
- [Download mimic_perform_non_af_001_data.csv](file/Data/mimic_perform_non_af_001_data.csv) (Non-Atrial Fibrillation)
|
| 169 |
+
|
| 170 |
+
<span style='color:#ffb300'><b>Catatan:</b></span> Jika link tidak bisa di-klik atau file tidak terunduh, silakan akses manual di folder berikut:<br>
|
| 171 |
+
<code>{os.path.abspath('Data')}</code>
|
| 172 |
+
"""
|
| 173 |
+
)
|
| 174 |
+
gr.Markdown(
|
| 175 |
+
"""
|
| 176 |
+
**Catatan:**
|
| 177 |
+
|
| 178 |
+
Dataset ini merupakan subset dari MIMIC III Waveform Database yang telah dianotasi untuk mendeteksi Atrial Fibrillation (AF) dan Non-AF. Dataset dapat digunakan untuk riset deteksi AF berbasis sinyal EKG.
|
| 179 |
+
"""
|
| 180 |
+
)
|
| 181 |
+
gr.Markdown(
|
| 182 |
+
"""
|
| 183 |
+
<div class="license-box">
|
| 184 |
+
<b>Lisensi Dataset</b>
|
| 185 |
+
<br>This dataset is licensed under the Open Data Commons Open Database License v1.0 (ODbL 1.0 license).<br>
|
| 186 |
+
Further details: <a href="https://opendatacommons.org/licenses/odbl/summary/" target="_blank">ODbL 1.0</a><br><br>
|
| 187 |
+
This dataset is derived from the MIMIC III Waveform Database:<br>
|
| 188 |
+
Moody, B., Moody, G., Villarroel, M., Clifford, G. D., & Silva, I. (2020). MIMIC-III Waveform Database (version 1.0). PhysioNet. <a href="https://doi.org/10.13026/c2607m" target="_blank">https://doi.org/10.13026/c2607m</a><br><br>
|
| 189 |
+
The MIMIC III Waveform Database is licensed under the ODbL 1.0 license.<br><br>
|
| 190 |
+
The MIMIC-III database is described in:<br>
|
| 191 |
+
Johnson, A. E. W., Pollard, T. J., Shen, L., Lehman, L. H., Feng, M., Ghassemi, M., Moody, B., Szolovits, P., Celi, L. A., & Mark, R. G. (2016). MIMIC-III, a freely accessible critical care database. Scientific Data, 3, 160035. <a href="https://doi.org/10.1038/sdata.2016.35" target="_blank">https://doi.org/10.1038/sdata.2016.35</a><br><br>
|
| 192 |
+
It is available on PhysioNet: <a href="https://physionet.org/" target="_blank">https://physionet.org/</a><br>
|
| 193 |
+
Goldberger, A., Amaral, L., Glass, L., Hausdorff, J., Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation [Online]. 101 (23), pp. e215–e220.<br><br>
|
| 194 |
+
The following annotations of AF and non-AF were used to create the dataset:<br>
|
| 195 |
+
Bashar, Syed Khairul (2020): Atrial Fibrillation annotations of electrocardiogram from MIMIC III matched subset. figshare. Dataset. <a href="https://doi.org/10.6084/m9.figshare.12149091.v1" target="_blank">https://doi.org/10.6084/m9.figshare.12149091.v1</a><br><br>
|
| 196 |
+
Bashar, S.K., Ding, E., Walkey, A.J., McManus, D.D. and Chon, K.H., 2019. Noise Detection in Electrocardiogram Signals for Intensive Care Unit Patients. IEEE Access, 7, pp.88357-88368. <a href="https://doi.org/10.1109/ACCESS.2019.2926199" target="_blank">https://doi.org/10.1109/ACCESS.2019.2926199</a><br><br>
|
| 197 |
+
This annotation information is reproduced under the terms of the <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">CC BY 4.0 licence</a>
|
| 198 |
+
</div> """,elem_id=None)
|
| 199 |
|
| 200 |
with gr.Tab("Analyze Dataset"):
|
| 201 |
+
info_ds = gr.Textbox(label="Info Dataset", interactive=False, lines=8)
|
| 202 |
preview_ds = gr.Dataframe(label="Preview Data", interactive=False)
|
| 203 |
plot_ds = gr.Plot(label="Plot Sinyal (ECG)")
|
| 204 |
btn_ds = gr.Button("Analyze Dataset")
|
|
|
|
| 246 |
|
| 247 |
tombol.click(lambda s, m: analisis_sinyal(get_file_for_model(s), m), inputs=[shared_file_path, pilih_model], outputs=[hasil, visual])
|
| 248 |
|
| 249 |
+
demo.launch(css=css)
|