|
- # -*- coding: utf-8 -*-
- import subprocess
- print('1111111111111111111111111111111111111111')
- p = subprocess.run("cp -r /code/* /workspace", shell=True, capture_output=True)
- # p = subprocess.run("pip install opencv-python", shell=True, capture_output=True)
- # p = subprocess.run("apt update", shell=True, capture_output=True)
- # p = subprocess.run("apt install libgl1-mesa-glx", shell=True, capture_output=True)
- # # p = subprocess.run("apt-get install libglib2.0-dev", shell=True, capture_output=True)
- # p = subprocess.run("pip install -r /workspace/requirement.txt", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
- print('2222222222222222222222222222222222222')
- p = subprocess.run("bash /workspace/make.sh", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
- print(f'获取返回数据:{p.stdout}')
- if p.returncode !=0:
- print(f'命令执行失败:{p.stderr}')
- print('3333333333333333333333333333333333')
-
- print('*********************')
- # p = subprocess.run("mkdir -p /workspace/datasets/training/calib", shell=True, capture_output=True)
- # p = subprocess.run("mkdir -p /workspace/datasets/testing/calib", shell=True, capture_output=True)
- # p = subprocess.run("mkdir -p /workspace/datasets/training/image_2", shell=True, capture_output=True)
- # p = subprocess.run("mkdir -p /workspace/datasets/testing/image_2", shell=True, capture_output=True)
- # p = subprocess.run("mkdir -p /workspace/datasets/training/label_2", shell=True, capture_output=True)
- # p = subprocess.run("mkdir -p /workspace/datasets/training/velodyne", shell=True, capture_output=True)
- p = subprocess.run("mkdir -p /workspace/datasets/training", shell=True, capture_output=True)
- p = subprocess.run("mkdir -p /workspace/datasets/testing", shell=True, capture_output=True)
- p = subprocess.run("ln -s /model /workspace/workdirs", shell=True, capture_output=True)
-
- p = subprocess.run("ln -s /dataset/data_object_calib/training/calib /workspace/datasets/training/calib", shell=True, capture_output=True)
- p = subprocess.run("ln -s /dataset/data_object_calib/testing/calib /workspace/datasets/testing/calib", shell=True, capture_output=True)
- p = subprocess.run("ln -s /dataset/data_object_image_2/training/image_2 /workspace/datasets/training/image_2", shell=True, capture_output=True)
- p = subprocess.run("ln -s /dataset/data_object_image_2/testing/image_2 /workspace/datasets/testing/image_2", shell=True, capture_output=True)
- p = subprocess.run("ln -s /dataset/data_object_label_2/training/label_2 /workspace/datasets/training/label_2", shell=True, capture_output=True)
- p = subprocess.run("ln -s /dataset/data_object_velodyne/training/velodyne /workspace/datasets/training/velodyne", shell=True, capture_output=True)
- print('####################')
-
- # p = subprocess.run("ls", shell=True, capture_output=True)
- # print("-----------------")
- # p = subprocess.run("cwd", shell=True, capture_output=True)
- print('444444444444444444444444444444444444')
- p = subprocess.run("bash /workspace/launchers/det_precompute.sh /workspace/config/config.py train", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
- p = subprocess.run("python /workspace/scripts/depth_gt_compute.py --config=/workspace/config/config.py", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
- print(f'获取返回数据:{p.stdout}')
- if p.returncode !=0:
- print(f'命令执行失败:{p.stderr}')
-
- print('5555555555555555555555555555555555')
- p = subprocess.run("pip install easydict", shell=True, capture_output=True)
- p = subprocess.run("bash /workspace/launchers/train.sh /workspace/config/config.py 0 test", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
- print(f'获取返回数据:{p.stdout}')
- if p.returncode !=0:
- print(f'命令执行失败:{p.stderr}')
- print('******ending******')
|