feat(frontend/mri): expose target_shape as 3 number inputs (was hardcoded 64³)
Browse files- src/frontend/app.py +15 -1
src/frontend/app.py
CHANGED
|
@@ -1329,11 +1329,25 @@ def _render_mri_tab() -> None:
|
|
| 1329 |
"control,abnormal",
|
| 1330 |
key="mri_predict_labels",
|
| 1331 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1332 |
if st.button("Predict MRI image", key="mri_predict"):
|
| 1333 |
labels = [x.strip() for x in mri_labels.split(",") if x.strip()]
|
| 1334 |
payload: dict = {
|
| 1335 |
"input_path": mri_image,
|
| 1336 |
-
"target_shape": [
|
| 1337 |
}
|
| 1338 |
if labels:
|
| 1339 |
payload["label_names"] = labels
|
|
|
|
| 1329 |
"control,abnormal",
|
| 1330 |
key="mri_predict_labels",
|
| 1331 |
)
|
| 1332 |
+
shape_cols = st.columns(3)
|
| 1333 |
+
target_d = shape_cols[0].number_input(
|
| 1334 |
+
"Resize D", min_value=1, max_value=256, value=64, step=1, key="mri_predict_d"
|
| 1335 |
+
)
|
| 1336 |
+
target_h = shape_cols[1].number_input(
|
| 1337 |
+
"Resize H", min_value=1, max_value=256, value=64, step=1, key="mri_predict_h"
|
| 1338 |
+
)
|
| 1339 |
+
target_w = shape_cols[2].number_input(
|
| 1340 |
+
"Resize W", min_value=1, max_value=256, value=64, step=1, key="mri_predict_w"
|
| 1341 |
+
)
|
| 1342 |
+
st.caption(
|
| 1343 |
+
"Defaults to 64³ for production exports. Use 8³ when testing with the "
|
| 1344 |
+
"dummy ONNX fixture from `tests/fixtures/build_dummy_mri_onnx.py`."
|
| 1345 |
+
)
|
| 1346 |
if st.button("Predict MRI image", key="mri_predict"):
|
| 1347 |
labels = [x.strip() for x in mri_labels.split(",") if x.strip()]
|
| 1348 |
payload: dict = {
|
| 1349 |
"input_path": mri_image,
|
| 1350 |
+
"target_shape": [int(target_d), int(target_h), int(target_w)],
|
| 1351 |
}
|
| 1352 |
if labels:
|
| 1353 |
payload["label_names"] = labels
|