Skip to content
Snippets Groups Projects
Commit a031d6f5 authored by Tom Evans's avatar Tom Evans
Browse files

Merge branch '4.2.2-depth_chbox' into 'master'

4.2.2 depth chbox

See merge request !5
parents 380d397f 2c9ecd50
No related branches found
No related tags found
1 merge request!54.2.2 depth chbox
......@@ -41,8 +41,24 @@ def select_Image(event):
label.configure(text="Image is selected. Press run to create scene.")
def depthmap_creation():
print("Checked ", check.get())
print("Manually upload depth map: ", uploadDepthCheck.get())
if uploadDepthCheck.get() == 1: # if manually upload checked
check.set(0) # disable auto generation of depth map
upload_depth_path = tkinter.filedialog.askopenfilename(title="Select a depth map", filetypes=[("PNG files", "*.png")]) #dialog box to upload depth map
if upload_depth_path:
print(f"Uploaded depth map: {upload_depth_path}")
#TODO implement Mona's monodepth upload
else:
print("No depth map selected")
check.set(1) # if no depth map selected, enable auto generation of depth map
depth_check.deselect() # uncheck the depth map check box
else:
check.set(1) # if manually upload unchecked, enable auto generation of depth map
upload_depth_path = None
print("Removed uploaded depth map")
def stanfordRoom_selection():
if checkStanford.get() == 1:
global stanford_frame
......@@ -87,6 +103,12 @@ def runProcess():
print(f"Attempting to run: {combined_bat}")
print(f"With arguments: {file_path}, {str(check.get())}, {include_top_option}, {shift_image_option}")
# depth map check
if check.get() == 1:
print("Auto depth 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 +147,11 @@ def threading():
window = tk.Tk()
window.title("Immersive VR scene creator")
check = tk.IntVar()
check.set(1) #automatically generate depth map as default
uploadDepthCheck = tk.IntVar() # added uploadDepthCheck vaiable: 0 = automatically upload depth map, 1 = manually upload depth map
checkStanford = tk.IntVar()
include_top = tk.IntVar()
shift_image = tk.IntVar()
......@@ -152,7 +178,7 @@ run_button = tk.Button(
bg="green",
fg="white",
)
depth_check = tk.Checkbutton(window, text='Create 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment