Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix download; edge case handling #62

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion demo/src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def __init__(
self.cwd = cwd
self.share = share

self.filename = None
self.extension = None

self.class_name = "airways" # default
self.class_names = {
"airways": "CT_Airways",
Expand Down Expand Up @@ -102,10 +105,11 @@ def process(self, mesh_file_name):
return "./prediction.obj"

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

def get_img_pred_pair(self, k):
Expand Down
Loading