Skip to content

Commit 79725b7

Browse files
authored
Merge pull request #62 from raidionics/download-fix
Fix download; edge case handling
2 parents 1a46c84 + ee7e255 commit 79725b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

demo/src/gui.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ def __init__(
3333
self.cwd = cwd
3434
self.share = share
3535

36+
self.filename = None
37+
self.extension = None
38+
3639
self.class_name = "airways" # default
3740
self.class_names = {
3841
"airways": "CT_Airways",
@@ -102,10 +105,11 @@ def process(self, mesh_file_name):
102105
return "./prediction.obj"
103106

104107
def download_prediction(self):
105-
if (not self.filename) or (not self.extension):
108+
if (self.filename is None) or (self.extension is None):
106109
LOGGER.error(
107110
"The prediction is not available or ready to download. Wait until the result is available in the 3D viewer."
108111
)
112+
raise ValueError("Run inference before downloading!")
109113
return self.filename + "." + self.extension
110114

111115
def get_img_pred_pair(self, k):

0 commit comments

Comments
 (0)