diff --git a/scripts/scene_completion.py b/scripts/scene_completion.py index bda2ac053c7052a543b656c45e2c7ab89639d3a4..fdb3fcc0b99b87e3d7cf5ca9f6ef062b89e1c075 100644 --- a/scripts/scene_completion.py +++ b/scripts/scene_completion.py @@ -24,7 +24,7 @@ def send_files(shifted_disparity_path, shifted_t_path): except subprocess.CalledProcessError as e: print(f"Error during SCP: {e}") - return False + return False, False command = [ @@ -37,7 +37,7 @@ def send_files(shifted_disparity_path, shifted_t_path): except subprocess.CalledProcessError as e: print(f"Error during SCP: {e}") - return False + return False, False return True def get_completed_scene(shifted_disparity_path, shifted_t_path): @@ -56,10 +56,10 @@ def get_completed_scene(shifted_disparity_path, shifted_t_path): print("Connection is active.") else: print("Connection is not active.") - exit(1) # Exit the script if the connection is not active + return False, False except Exception as e: print(f"Failed to connect to {hostname}: {e}") - exit(1) + return False, False stdin, stdout, stderr = client.exec_command( "cd mona/MDBNet360_GDP/" + @@ -117,11 +117,22 @@ def get_completed_scene(shifted_disparity_path, shifted_t_path): print("OUTPUT DOWNLOADED") # Close the SSH connection client.close() - return True + return True, local_file_path else: - return False + return False, False # out = get_completed_scene("C:\\Project\\AVVR-Pipeline-GDP4\\edgenet-360\\Data\\Courtyard\\shifted-disparity.png", "C:\\Project\\AVVR-Pipeline-GDP4\\edgenet-360\\Data\\Courtyard\\shifted_t.png") -# print(out) \ No newline at end of file +# print(out) + +if __name__ == "__main__": + if len(sys.argv) != 3: + print("Usage: python shifter.py <shifted_disparity_path> <shifted_t_path>") + sys.exit(1) + + shifted_disparity_path = sys.argv[1] + shifted_t_path = sys.argv[2] + + saved_path = get_completed_scene(shifted_disparity_path, shifted_t_path) + print(f"Shifted image saved as {saved_path}") \ No newline at end of file