Skip to content

Commit ffe7fd6

Browse files
authored
Merge pull request #701 from luxonis/update_app_args
Updated app arguments
2 parents 82428db + 2505298 commit ffe7fd6

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $ depthai_demo.py --help
6666
usage: depthai_demo.py [-h] [-cam {left,right,color}] [-vid VIDEO] [-dd] [-dnn] [-cnnp CNNPATH] [-cnn CNNMODEL] [-sh SHAVES] [-cnnsize CNNINPUTSIZE] [-rgbr {1080,2160,3040}] [-rgbf RGBFPS] [-dct DISPARITYCONFIDENCETHRESHOLD] [-lrct LRCTHRESHOLD] [-sig SIGMA] [-med {0,3,5,7}] [-lrc] [-ext] [-sub] [-dff]
6767
[-scale SCALE [SCALE ...]] [-cm {AUTUMN,BONE,CIVIDIS,COOL,DEEPGREEN,HOT,HSV,INFERNO,JET,MAGMA,OCEAN,PARULA,PINK,PLASMA,RAINBOW,SPRING,SUMMER,TURBO,TWILIGHT,TWILIGHT_SHIFTED,VIRIDIS,WINTER}] [-maxd MAXDEPTH] [-mind MINDEPTH] [-sbb] [-sbbsf SBBSCALEFACTOR]
6868
[-s {nnInput,color,left,right,depth,depthRaw,disparity,disparityColor,rectifiedLeft,rectifiedRight} [{nnInput,color,left,right,depth,depthRaw,disparity,disparityColor,rectifiedLeft,rectifiedRight} ...]] [--report {temp,cpu,memory} [{temp,cpu,memory} ...]] [--reportFile REPORTFILE]
69-
[-monor {400,720,800}] [-monof MONOFPS] [-cb CALLBACK] [--openvinoVersion {2020_3,2020_4,2021_1,2021_2,2021_3,2021_4}] [--app APP] [--count COUNTLABEL] [-dev DEVICEID] [-bandw {auto,low,high}] [-gt {auto,qt,cv}] [-usbs {usb2,usb3}] [-enc ENCODE [ENCODE ...]] [-encout ENCODEOUTPUT]
69+
[-monor {400,720,800}] [-monof MONOFPS] [-cb CALLBACK] [--openvinoVersion {2020_3,2020_4,2021_1,2021_2,2021_3,2021_4}] [-app APP] [--count COUNTLABEL] [-dev DEVICEID] [-bandw {auto,low,high}] [-gt {auto,qt,cv}] [-usbs {usb2,usb3}] [-enc ENCODE [ENCODE ...]] [-encout ENCODEOUTPUT]
7070
[-xls XLINKCHUNKSIZE] [-poeq POEQUALITY] [-camo CAMERAORIENTATION [CAMERAORIENTATION ...]] [--cameraControlls] [--cameraExposure CAMERAEXPOSURE [CAMERAEXPOSURE ...]] [--cameraSensitivity CAMERASENSITIVITY [CAMERASENSITIVITY ...]]
7171
[--cameraSaturation CAMERASATURATION [CAMERASATURATION ...]] [--cameraContrast CAMERACONTRAST [CAMERACONTRAST ...]] [--cameraBrightness CAMERABRIGHTNESS [CAMERABRIGHTNESS ...]] [--cameraSharpness CAMERASHARPNESS [CAMERASHARPNESS ...]] [--skipVersionCheck] [--noSupervisor] [--sync] [--debug]
7272
@@ -135,7 +135,7 @@ optional arguments:
135135
Path to callbacks file to be used. Default: <project_root>/callbacks.py
136136
--openvinoVersion {2020_3,2020_4,2021_1,2021_2,2021_3,2021_4}
137137
Specify which OpenVINO version to use in the pipeline
138-
--app APP Specify which app to run instead of the demo
138+
-app APP, --app APP Specify which app to run instead of the demo
139139
--count COUNTLABEL Count and display the number of specified objects on the frame. You can enter either the name of the object or its label id (number).
140140
-dev DEVICEID, --deviceId DEVICEID
141141
DepthAI MX id of the device to connect to. Use the word 'list' to show all devices and exit.

depthai_demo.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
sys.path.append(str((Path(__file__).parent / "depthai_sdk" / "src").absolute()))
2323

2424
from depthai_helpers.app_manager import App
25+
from depthai_helpers.arg_manager import parseArgs
26+
args = parseArgs()
2527
if __name__ == "__main__":
26-
if '--app' in sys.argv:
28+
# Instead of the depthai_demo, run the specified App
29+
if args.app is not None:
2730
try:
28-
app = App(appName=sys.argv[sys.argv.index('--app') + 1])
31+
app = App(appName=args.app)
2932
app.createVenv()
3033
app.runApp()
3134
sys.exit(0)
@@ -43,7 +46,6 @@
4346

4447
from log_system_information import make_sys_report
4548
from depthai_helpers.supervisor import Supervisor
46-
from depthai_helpers.arg_manager import parseArgs
4749
from depthai_helpers.config_manager import ConfigManager, DEPTHAI_ZOO, DEPTHAI_VIDEOS
4850
from depthai_helpers.metrics import MetricManager
4951
from depthai_helpers.version_check import checkRequirementsVersion
@@ -54,9 +56,6 @@
5456
class OverheatError(RuntimeError):
5557
pass
5658

57-
58-
args = parseArgs()
59-
6059
if args.noSupervisor and args.guiType == "qt":
6160
if "QT_QPA_PLATFORM_PLUGIN_PATH" in os.environ:
6261
os.environ.pop("QT_QPA_PLATFORM_PLUGIN_PATH")

depthai_helpers/arg_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def parseArgs():
110110
help="Mono cam fps: max 60.0 for H:720 or H:800, max 120.0 for H:400. Default: %(default)s")
111111
parser.add_argument('-cb', '--callback', type=Path, default=projectRoot / 'callbacks.py', help="Path to callbacks file to be used. Default: %(default)s")
112112
parser.add_argument("--openvinoVersion", type=str, choices=openvinoVersions, help="Specify which OpenVINO version to use in the pipeline")
113-
parser.add_argument("--app", type=str, help="Specify which app to run instead of the demo")
113+
parser.add_argument("-app","--app", type=str, choices=["uvc"], help="Specify which app to run instead of the demo")
114114
parser.add_argument("--count", type=str, dest='countLabel',
115115
help="Count and display the number of specified objects on the frame. You can enter either the name of the object or its label id (number).")
116116
parser.add_argument("-dev", "--deviceId", type=str,

0 commit comments

Comments
 (0)