Skip to content
Open
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
12 changes: 7 additions & 5 deletions Controller/extract_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def set_display_images(self):
if platform == "win32":
self.view.ids.left_im.source = "assets\\images\\extraction\\FT01_IMG_20230309_103936_LEFT.jpg"
self.view.ids.right_im.source = "assets\\images\\extraction\\FT01_IMG_20230309_103936_RIGHT.jpg"
elif platform in ["linux", "linux2"]:
elif platform in ["linux", "linux2", "darwin"]:
self.view.ids.left_im.source = "assets/images/extraction/FT01_IMG_20230309_103936_LEFT.jpg"
self.view.ids.right_im.source = "assets/images/extraction/FT01_IMG_20230309_103936_RIGHT.jpg"

Expand Down Expand Up @@ -697,7 +697,7 @@ def compute_and_save_disparity(self):
# change to left_img_path.split('\\') for Windows
if platform == "win32":
dmap_filename = left_img_path.split('\\')[-1].split('.')[0] + '_disparity.jpg'
elif platform == "linux" or platform == "linux2":
elif platform == "linux" or platform == "linux2" or platform == "darwin":
dmap_filename = left_img_path.split('/')[-1].split('.')[0] + '_disparity.jpg'

dmap_path = os.path.join(self.DISPARITY_MAPS_DIR, dmap_filename)
Expand Down Expand Up @@ -975,7 +975,7 @@ def on_extract(self):

if platform == 'win32':
annotated_image_name = left_filename.split('\\')[-1].split('.')[0] + '_annotated.jpg'
elif platform in ['linux', 'linux2']:
elif platform in ['linux', 'linux2', 'darwin']:
annotated_image_name = left_filename.split('/')[-1].split('.')[0] + '_annotated.jpg'

annotated_image_path = os.path.join(self.ANNOTATED_IMAGES_DIR, annotated_image_name)
Expand Down Expand Up @@ -1032,7 +1032,7 @@ def on_batch_extract(self, dt):
left_filename = os.path.basename(self.view.left_im.source)
if platform == 'win32':
annotated_image_name = left_filename.split('\\')[-1].split('.')[0] + '_annotated.jpg'
elif platform in ['linux', 'linux2']:
elif platform in ['linux', 'linux2', 'darwin']:
annotated_image_name = left_filename.split('/')[-1].split('.')[0] + '_annotated.jpg'

annotated_image_path = os.path.join(self.ANNOTATED_IMAGES_DIR, annotated_image_name)
Expand Down Expand Up @@ -1347,6 +1347,8 @@ def open_user_guide(self):
os.startfile(path)
elif platform in ['linux', 'linux2']:
subprocess.run(['xdg-open', path])
elif platform == 'darwin':
subprocess.run(['open', path])
except FileNotFoundError:
toast('User guide not found!')
self.LOG_TEXT = "[color=ff0000]Couldn't find the user guide.[/color]"
Expand Down Expand Up @@ -1411,4 +1413,4 @@ def create_log_widget(self):


class IconListItem(OneLineIconListItem):
icon = StringProperty()
icon = StringProperty()