Hou commited on
Commit
2b61dd5
·
1 Parent(s): 23f26e1

update app

Browse files
Files changed (1) hide show
  1. app.py +106 -1
app.py CHANGED
@@ -32,6 +32,110 @@ LABELS = {
32
  }
33
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  class AlbumentationsTransform:
36
  def __init__(self, transform):
37
  self.transform = transform
@@ -386,7 +490,8 @@ def make_app(args):
386
  # f"Pigment weights: `{pigment_weights}`"
387
  )
388
 
389
- with gr.Blocks(title="AMD Risk Prediction") as demo:
 
390
  gr.Markdown(model_info)
391
 
392
  with gr.Row():
 
32
  }
33
 
34
 
35
+ APP_CSS = """
36
+ #terms-overlay {
37
+ position: fixed;
38
+ inset: 0;
39
+ z-index: 9999;
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ padding: 32px;
44
+ background: rgba(255, 255, 255, 0.72);
45
+ backdrop-filter: blur(3px);
46
+ -webkit-backdrop-filter: blur(3px);
47
+ }
48
+
49
+ #terms-card {
50
+ width: min(800px, calc(100vw - 64px));
51
+ max-height: 86vh;
52
+ overflow-y: auto;
53
+ padding: 24px 28px;
54
+ border: 1px solid #d9d9df;
55
+ border-radius: 8px;
56
+ background: #f3f3f5;
57
+ box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
58
+ color: #1f2933;
59
+ }
60
+
61
+ #terms-card h1 {
62
+ margin-top: 0;
63
+ font-size: 1.55rem;
64
+ }
65
+
66
+ #terms-card h2 {
67
+ margin-top: 1.35rem;
68
+ font-size: 1.15rem;
69
+ }
70
+
71
+ #terms-card p,
72
+ #terms-card ul {
73
+ font-size: 0.95rem;
74
+ line-height: 1.55;
75
+ margin-left: 1.1rem;
76
+ }
77
+
78
+ #terms-card li {
79
+ margin-bottom: 0.35rem;
80
+ }
81
+
82
+ #acknowledge-btn {
83
+ width: 100%;
84
+ margin-top: 16px;
85
+ padding: 10px 14px;
86
+ border: none;
87
+ border-radius: 6px;
88
+ background: #2563eb;
89
+ color: white;
90
+ font-weight: 600;
91
+ cursor: pointer;
92
+ }
93
+
94
+ #acknowledge-btn:hover {
95
+ background: #1d4ed8;
96
+ }
97
+ """
98
+
99
+ ACKNOWLEDGEMENT_TEXT = "I acknowledge and continue"
100
+
101
+ TERMS_OVERLAY_HTML = f"""
102
+ <div id="terms-overlay">
103
+ <div id="terms-card">
104
+ <h1>AMD Risk Prediction Demo — Research Use Only</h1>
105
+
106
+ <p>This demo is a modernized research implementation based on the original AMD risk prediction work. It is provided solely for research, educational, and reproducibility purposes.</p>
107
+
108
+ <h2>Not for Clinical Use</h2>
109
+ <p>This Gradio demo and its associated model outputs are provided for research, educational, and reproducibility purposes only, and are not intended for clinical diagnosis, treatment, screening, triage, patient management, or any other medical decision-making purpose.</p>
110
+ <p>This demo implementation has not been clinically validated for routine patient care and has not been reviewed, cleared, or approved by any regulatory authority, including the U.S. Food and Drug Administration.</p>
111
+
112
+ <h2>Data Privacy</h2>
113
+ <p>Do not upload protected health information, personally identifiable information, or patient data unless you have the necessary rights, permissions, and safeguards to do so.</p>
114
+
115
+ <h2>User Responsibility</h2>
116
+ <p>By using this demo, you acknowledge that:</p>
117
+ <ul>
118
+ <li>You understand this demo is for research and educational purposes only.</li>
119
+ <li>You will not use the outputs for diagnosis, treatment, screening, triage, or clinical decision-making.</li>
120
+ <li>You are responsible for how you interpret and use any results generated by the demo.</li>
121
+ <li>You will not upload protected health information or identifiable patient data unless you are authorized to do so.</li>
122
+ </ul>
123
+
124
+ <h2>Attribution</h2>
125
+ <p>This project is a modernized reimplementation of the DeepSeeNet AMD risk prediction work. Please cite the original publication when using this project:</p>
126
+ <p>Peng Y, Keenan TD, Chen Q, Agrón E, Allot A, Wong WT, Chew EY, Lu Z. Predicting risk of late age-related macular degeneration using deep learning. NPJ Digital Medicine. 2020 Aug 27;3(1):111.</p>
127
+
128
+ <h2>License and Warranty Disclaimer</h2>
129
+ <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
130
+ <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
131
+ <p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
132
+
133
+ <button id="acknowledge-btn" onclick="document.getElementById('terms-overlay').remove();">{ACKNOWLEDGEMENT_TEXT}</button>
134
+ </div>
135
+ </div>
136
+ """
137
+
138
+
139
  class AlbumentationsTransform:
140
  def __init__(self, transform):
141
  self.transform = transform
 
490
  # f"Pigment weights: `{pigment_weights}`"
491
  )
492
 
493
+ with gr.Blocks(title="AMD Risk Prediction", css=APP_CSS) as demo:
494
+ gr.HTML(TERMS_OVERLAY_HTML)
495
  gr.Markdown(model_info)
496
 
497
  with gr.Row():