7 Star 1 Fork 1

Luxonis-Brian / depthai

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
calibrate_and_test.py 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env python3
# Calibration script is not yet migrated to Gen2
raise NotImplementedError("Calibration is not yet available in Gen2 demo. To calibrate your device, switch to \"gen1_main\" branch and try again")
import os
import signal
import subprocess
import atexit
import sys
import time
global p
global return_code
p=None
def cleanup():
if(p is not None):
print('Stopping subprocess with pid: ', str(p.pid))
os.killpg(os.getpgid(p.pid), signal.SIGTERM)
print('Stopped!')
args=""
for arg in sys.argv[1:]:
args+="'"+arg+"' "
calibrate_cmd = "python3 calibrate.py " + args
test_cmd = """python3 depthai_demo.py -co '{"streams": [{"name": "depth", "max_fps": 12.0}]}'"""
atexit.register(cleanup)
p = subprocess.Popen(calibrate_cmd, shell=True, preexec_fn=os.setsid)
p.wait()
return_code = p.returncode
p=None
print("Return code:"+str(return_code))
time.sleep(3)
if(return_code == 0):
p = subprocess.Popen(test_cmd, shell=True, preexec_fn=os.setsid)
p.wait()
return_code = p.returncode
p=None
print("Return code:"+str(return_code))
exit(return_code)
Python
1
https://gitee.com/Luxonis-Brian/depthai.git
git@gitee.com:Luxonis-Brian/depthai.git
Luxonis-Brian
depthai
depthai
main

搜索帮助