From 561efec1c88ecfbd79e9e4c77b74477d5b3dff9c Mon Sep 17 00:00:00 2001
From: tee1g21 <92794120+tee1g21@users.noreply.github.com>
Date: Wed, 6 Nov 2024 17:41:47 +0000
Subject: [PATCH] Added upload check

---
 scripts/GUI.py | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/GUI.py b/scripts/GUI.py
index 458da5c..a78a2c9 100644
--- a/scripts/GUI.py
+++ b/scripts/GUI.py
@@ -41,7 +41,13 @@ def select_Image(event):
     label.configure(text="Image is selected. Press run to create scene.")
 
 def depthmap_creation():
-    print("Upload Depth Map: ", check.get())
+    print("Manually upload depth map: ", uploadDepthCheck.get())
+    
+    if uploadDepthCheck == 0:
+        check.set(1)
+    else:
+        check.set(0) #temporary. TODO implement Mona's monodepth upload    
+    
 
 def stanfordRoom_selection():
     if checkStanford.get() == 1:
@@ -87,6 +93,11 @@ def runProcess():
             print(f"Attempting to run: {combined_bat}")
             print(f"With arguments: {file_path}, {str(check.get())}, {include_top_option}, {shift_image_option}")
             
+            if check == 1: 
+                print("Autodepth map")
+            else: 
+                print("Manual depth map")
+            
             p = subprocess.Popen(
                 [combined_bat, file_path, str(check.get()), include_top_option, shift_image_option],
                 stdout=sys.stdout)
@@ -125,7 +136,13 @@ def threading():
 
 window = tk.Tk()
 window.title("Immersive VR scene creator")
+
 check = tk.IntVar()
+check.set(1) #automatically generate depth map as default
+# changed check vaiable: 0 = automatically upload depth map, 1 = manually upload depth map
+# this behaviour is oppositte to previous check variable
+uploadDepthCheck = tk.IntVar()
+
 checkStanford = tk.IntVar()
 include_top = tk.IntVar()
 shift_image = tk.IntVar()
@@ -152,7 +169,7 @@ run_button = tk.Button(
     bg="green",
     fg="white",
 )
-depth_check = tk.Checkbutton(window, text='Upload a depth map(360 MonoDepth)',variable=check, onvalue=1, offvalue=0, command=depthmap_creation)
+depth_check = tk.Checkbutton(window, text='Upload a depth map(360 MonoDepth)',variable=uploadDepthCheck, onvalue=1, offvalue=0, command=depthmap_creation)
 stanford_check = tk.Checkbutton(window, text='Run for stanford2D3D dataset',variable=checkStanford, onvalue=1, offvalue=0,command=stanfordRoom_selection )
 include_top_check = tk.Checkbutton(window, text='Include Top in Mesh', variable=include_top, onvalue=1, offvalue=0)
 shift_image_check = tk.Checkbutton(window, text='Shift input image', variable=shift_image, onvalue=1, offvalue=0, command=shift_image_selection)
-- 
GitLab