Spaces:
Sleeping
Sleeping
@PrajwalDange Claude Sonnet 4.6 commited on
Commit Β·
2d7c190
1
Parent(s): 30f954b
Remove email field from feedback form and Google Sheets; update classifiers
Browse files- Removed email Textbox from 'Your Information' accordion in app.py
- Removed email parameter from submit_feedback_handler() and submit_feedback()
- Removed 'email' column from HEADER list and row data in feedback.py
- Updated HEADER docstring to reflect new column order
- Classifiers (nerve_clf_10x.pkl, pni_clf_10x.pkl) updated to latest local version
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- app.py +1 -7
- classifiers/nerve_clf_10x.pkl +1 -1
- classifiers/pni_clf_10x.pkl +1 -1
- feedback.py +4 -6
app.py
CHANGED
|
@@ -131,7 +131,6 @@ def analyze_image(
|
|
| 131 |
|
| 132 |
def submit_feedback_handler(
|
| 133 |
name,
|
| 134 |
-
email,
|
| 135 |
photo_type,
|
| 136 |
magnification,
|
| 137 |
verdict_raw, # from result_state
|
|
@@ -147,7 +146,6 @@ def submit_feedback_handler(
|
|
| 147 |
|
| 148 |
return submit_feedback(
|
| 149 |
name=name,
|
| 150 |
-
email=email,
|
| 151 |
photo_type=photo_type,
|
| 152 |
magnification=magnification,
|
| 153 |
verdict=verdict_raw,
|
|
@@ -228,10 +226,6 @@ with gr.Blocks(title=TITLE) as demo:
|
|
| 228 |
label="Name",
|
| 229 |
placeholder="Dr. Jane Smith",
|
| 230 |
)
|
| 231 |
-
user_email = gr.Textbox(
|
| 232 |
-
label="Email",
|
| 233 |
-
placeholder="name@hospital.org",
|
| 234 |
-
)
|
| 235 |
photo_type = gr.Dropdown(
|
| 236 |
choices=[
|
| 237 |
"Phone Camera",
|
|
@@ -388,7 +382,7 @@ with gr.Blocks(title=TITLE) as demo:
|
|
| 388 |
submit_btn.click(
|
| 389 |
fn=submit_feedback_handler,
|
| 390 |
inputs=[
|
| 391 |
-
user_name,
|
| 392 |
result_state, analyzed_state, analysis_time_state,
|
| 393 |
path_nerve_count, path_pni_count, path_comments,
|
| 394 |
],
|
|
|
|
| 131 |
|
| 132 |
def submit_feedback_handler(
|
| 133 |
name,
|
|
|
|
| 134 |
photo_type,
|
| 135 |
magnification,
|
| 136 |
verdict_raw, # from result_state
|
|
|
|
| 146 |
|
| 147 |
return submit_feedback(
|
| 148 |
name=name,
|
|
|
|
| 149 |
photo_type=photo_type,
|
| 150 |
magnification=magnification,
|
| 151 |
verdict=verdict_raw,
|
|
|
|
| 226 |
label="Name",
|
| 227 |
placeholder="Dr. Jane Smith",
|
| 228 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
photo_type = gr.Dropdown(
|
| 230 |
choices=[
|
| 231 |
"Phone Camera",
|
|
|
|
| 382 |
submit_btn.click(
|
| 383 |
fn=submit_feedback_handler,
|
| 384 |
inputs=[
|
| 385 |
+
user_name, photo_type, magnification,
|
| 386 |
result_state, analyzed_state, analysis_time_state,
|
| 387 |
path_nerve_count, path_pni_count, path_comments,
|
| 388 |
],
|
classifiers/nerve_clf_10x.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 34097
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4e19add9f80087fd41c3da409ac3d7a48ba9912bd73ea63e44b73591b8e2b65
|
| 3 |
size 34097
|
classifiers/pni_clf_10x.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 34097
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d72fd80f21c31768220ccca522b441ae9c9f906a38e38077f4653b108459678
|
| 3 |
size 34097
|
feedback.py
CHANGED
|
@@ -10,7 +10,7 @@ submit_feedback() calls return a polite warning without crashing. The inference
|
|
| 10 |
pipeline is completely unaffected.
|
| 11 |
|
| 12 |
Google Sheet columns (one row per submission):
|
| 13 |
-
timestamp | analysis_timestamp | name |
|
| 14 |
ai_nerve_count | ai_pni_count | ai_verdict |
|
| 15 |
path_nerve_count | path_pni_count | comments |
|
| 16 |
nerve_agreement | pni_agreement
|
|
@@ -29,7 +29,7 @@ SHEETS_ENABLED: bool = False
|
|
| 29 |
_sheet = None # gspread Worksheet object, set by _init_sheets()
|
| 30 |
|
| 31 |
HEADER = [
|
| 32 |
-
"timestamp", "analysis_timestamp", "name", "
|
| 33 |
"ai_nerve_count", "ai_pni_count", "ai_verdict",
|
| 34 |
"path_nerve_count", "path_pni_count", "comments",
|
| 35 |
"nerve_agreement", "pni_agreement",
|
|
@@ -137,7 +137,6 @@ def _agreement(ai_val: int, path_val: int, has_result: bool) -> str:
|
|
| 137 |
|
| 138 |
def submit_feedback(
|
| 139 |
name: str,
|
| 140 |
-
email: str,
|
| 141 |
photo_type: str,
|
| 142 |
magnification: str,
|
| 143 |
verdict: str,
|
|
@@ -155,7 +154,6 @@ def submit_feedback(
|
|
| 155 |
"""
|
| 156 |
# ββ Sanitise inputs βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 157 |
name = (name or "").strip()
|
| 158 |
-
email = (email or "").strip()
|
| 159 |
photo_type = (photo_type or "").strip()
|
| 160 |
magnification = (magnification or "").strip()
|
| 161 |
verdict = (verdict or "").strip()
|
|
@@ -185,7 +183,7 @@ def submit_feedback(
|
|
| 185 |
analysis_ts = (analysis_timestamp or "").strip()
|
| 186 |
|
| 187 |
row = [
|
| 188 |
-
timestamp, analysis_ts, name,
|
| 189 |
ai_nerve_count, ai_pni_count, verdict,
|
| 190 |
path_nerve_count, path_pni_count, comments,
|
| 191 |
nerve_agr, pni_agr,
|
|
@@ -201,7 +199,7 @@ def submit_feedback(
|
|
| 201 |
|
| 202 |
try:
|
| 203 |
_sheet.append_row(row, value_input_option="USER_ENTERED")
|
| 204 |
-
logger.info(f"Feedback saved β ts={timestamp},
|
| 205 |
return "β
Feedback submitted β thank you! Your assessment has been recorded."
|
| 206 |
except Exception as exc:
|
| 207 |
logger.error(f"Failed to append feedback row: {exc}")
|
|
|
|
| 10 |
pipeline is completely unaffected.
|
| 11 |
|
| 12 |
Google Sheet columns (one row per submission):
|
| 13 |
+
timestamp | analysis_timestamp | name | photo_type | magnification |
|
| 14 |
ai_nerve_count | ai_pni_count | ai_verdict |
|
| 15 |
path_nerve_count | path_pni_count | comments |
|
| 16 |
nerve_agreement | pni_agreement
|
|
|
|
| 29 |
_sheet = None # gspread Worksheet object, set by _init_sheets()
|
| 30 |
|
| 31 |
HEADER = [
|
| 32 |
+
"timestamp", "analysis_timestamp", "name", "photo_type", "magnification",
|
| 33 |
"ai_nerve_count", "ai_pni_count", "ai_verdict",
|
| 34 |
"path_nerve_count", "path_pni_count", "comments",
|
| 35 |
"nerve_agreement", "pni_agreement",
|
|
|
|
| 137 |
|
| 138 |
def submit_feedback(
|
| 139 |
name: str,
|
|
|
|
| 140 |
photo_type: str,
|
| 141 |
magnification: str,
|
| 142 |
verdict: str,
|
|
|
|
| 154 |
"""
|
| 155 |
# ββ Sanitise inputs βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 156 |
name = (name or "").strip()
|
|
|
|
| 157 |
photo_type = (photo_type or "").strip()
|
| 158 |
magnification = (magnification or "").strip()
|
| 159 |
verdict = (verdict or "").strip()
|
|
|
|
| 183 |
analysis_ts = (analysis_timestamp or "").strip()
|
| 184 |
|
| 185 |
row = [
|
| 186 |
+
timestamp, analysis_ts, name, photo_type, magnification,
|
| 187 |
ai_nerve_count, ai_pni_count, verdict,
|
| 188 |
path_nerve_count, path_pni_count, comments,
|
| 189 |
nerve_agr, pni_agr,
|
|
|
|
| 199 |
|
| 200 |
try:
|
| 201 |
_sheet.append_row(row, value_input_option="USER_ENTERED")
|
| 202 |
+
logger.info(f"Feedback saved β ts={timestamp}, name={name or '(anon)'}")
|
| 203 |
return "β
Feedback submitted β thank you! Your assessment has been recorded."
|
| 204 |
except Exception as exc:
|
| 205 |
logger.error(f"Failed to append feedback row: {exc}")
|