import subprocess import os def setup_and_run(): try: # Run the setup script subprocess.run(['bash', 'setup.sh'], check=True) # Change the working directory to V-Express os.chdir('V-Express') # Run the extract_kps_sequence_and_audio.py script from within the V-Express directory result = subprocess.run(['python', 'extract_kps_sequence_and_audio.py'], capture_output=True, text=True) # Change back to the original working directory os.chdir('..') return result.stdout + "\n" + result.stderr except subprocess.CalledProcessError as e: return f"An error occurred: {e}\n{e.output}" if __name__ == "__main__": output = setup_and_run() print(output)