cdancette commited on
Commit
05c5aa5
·
1 Parent(s): 17d00ca

disable upload for 3D heads

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -71,6 +71,12 @@ HEADS_REQUIRING_MASK: set[str] = {
71
  "subarticular_stenosis",
72
  }
73
 
 
 
 
 
 
 
74
 
75
  DATASET_OPTIONS: Dict[str, str] = {
76
  "anatomy-ct": "Anatomy CT (test)",
@@ -295,6 +301,13 @@ def update_upload_component_state(head: str) -> Tuple[Dict[str, Any], Dict[str,
295
  )
296
  upload_update = gr.update(interactive=False)
297
  return info_update, upload_update
 
 
 
 
 
 
 
298
 
299
  info_update = gr.update(visible=False)
300
  upload_update = gr.update(interactive=True)
 
71
  "subarticular_stenosis",
72
  }
73
 
74
+ HEADS_3D = {
75
+ "oasis",
76
+ "luna16-3D",
77
+ "kneeMRI",
78
+ }
79
+
80
 
81
  DATASET_OPTIONS: Dict[str, str] = {
82
  "anatomy-ct": "Anatomy CT (test)",
 
301
  )
302
  upload_update = gr.update(interactive=False)
303
  return info_update, upload_update
304
+ elif head in HEADS_3D:
305
+ info_update = gr.update(
306
+ value="⚠️ Custom image upload is disabled for this task because it requires a 3D image.",
307
+ visible=True,
308
+ )
309
+ upload_update = gr.update(interactive=False)
310
+ return info_update, upload_update
311
 
312
  info_update = gr.update(visible=False)
313
  upload_update = gr.update(interactive=True)