Ok - I can at least partially answer my own question
so I will include what I have learned is case anybody else is in this boat and is too scared to ask.
And to reiterate why I am here - a) I want my windows and images to be similarly sized from input to output
b) you really have to turn down the logging in jetson.inference.imageNet Classify or it just swamps the output (who chose ‘verbose’ as the default?)
c) I need to flip the camera image (otherwise my bald head is classified as ‘punching bag’!)
So, there are two ‘things’ involved and they come from different factories.
these are jetson.utils and jetson.inference
For jetson.inference there are series of example programs installed if you built the modules - including python programs
look for … /jetson-inference/build/aarch64/bin
These are command line programs (not python classes or functions or anything) but they seem to respond to a -h parameter
eg ./imagenet.py -h
this will show the valid parameters especially their names and any defaults ie is it ‘–width’ or ‘–input-width’
Then looking in the program you will see the call to the relevant jetson.inference module and the parameters eg for imagenet.py this is
net = jetson.inference.imageNet(opt.network, sys.argv)
By looking at and printing sys.argv I see it is nothing more than a list[str] eg from one test case
sys.argv=['./imagenet.py', '--network=alexnet', '--width=1280', '--height=720', '--input-flip=vertical', '--log-level=success']
so for these if we can form our parameters in the same style it should work.
The results of some test for calls to imageNet
net = jetson.inference.imageNet() # OK - take all defaults
net = jetson.inference.imageNet(networkToUse) # OK - specify only the network
net = jetson.inference.imageNet('', ['--network=inception-v4', '--width=1280', '--height=720', '--log-level=info']) # OK - anything else use the list and 1st parm is ignored
net = jetson.inference.imageNet('', ['--network=inception-v4', '--width=' + str(width), '--height='+str(height), '--log-level=info']) # OK - anything else use the list and 1st parm is ignored
net = jetson.inference.imageNet(networkToUse, param_imageNet) # using a prepared list, again 1st param is ignored so list must include "--network="
net = jetson.inference.imageNet(networkToUse, ['--network=' + networkToUse, '--width=' + str(width), '--height=' + str(height), '--log-level=info']) # OK
net = jetson.inference.imageNet(networkToUse, ['--width=1280', '--height=720', '--log-level=info']) # invalid - 1st parm ignored just uses googlenet
net = jetson.inference.imageNet('', [--network=inception-v4, --width=1280, '--height=720', '--log-level=info']) # fail the list has to be strings
the prepared-in-advance list is created by…
param_imageNet = []
param_imageNet.append("--network=" + networkToUse)
param_imageNet.append(f"--width=" + str(width))
param_imageNet.append(f"--height=" + str(height))
param_imageNet.append(f"--log-level=info")
By gross generalisation I am hoping the other jetson.inference modules behave similarly
After a bit more experimentation it seems you can specify argv= in front of any of these list formats
Jetson.utils
This is not so pretty. I have not found any similar example programs that might list the parameters
You can interpolate a bit from the header files eg videoSource.h and videoOutput.h
Again results of tests
param_videoSource = []
param_videoSource.append("--input-width=" + str(width))
param_videoSource.append(f"--input-height=" + str(height))
param_videoSource.append(f"--input-flip=vertical")
param_videoSource.append(f"--input-rate=" +str(framerate))
cam = jetson.utils.videoSource('csi://0') # OK
cam = jetson.utils.videoSource('csi://0 --input-width=1640 --input-height=1232') # fails no complaints just ignored and defaults to 1280x720
cam = jetson.utils.videoSource('csi://0', argv=["--input-width=" + str(width), "--input-height=" + str(height), "--input-flip=vertical", "--input-rate=" +str(framerate) ] ) # OK
cam = jetson.utils.videoSource('csi://0', ["--input-width=" + str(width), "--input-height=" + str(height), "--input-flip=vertical", "--input-rate=" +str(framerate) ] ) # ok you dont have to say argv=
cam = jetson.utils.videoSource('csi://0', param_videoSource ) # OK
cam = jetson.utils.videoSource('csi://0', argv=param_videoSource ) # OK
param_videoOutput = []
param_videoOutput.append("--width=" + str(width))
param_videoOutput.append(f"--height=" + str(height))
disp = jetson.utils.videoOutput() # take all defaults # ok but 1920x1080 ie full screen
disp = jetson.utils.videoOutput(argv=["--width=" + str(width), "--height=" + str(height)) # OK
disp = jetson.utils.videoOutput(param_videoOutput) # fail - jetson.utils -- videoOutput.__init()__ failed to parse args tuple
disp = jetson.utils.videoOutput(argv=param_videoOutput) # OK so for this one you have to say argv=
disp = jetson.utils.videoOutput(width=1640, height=1232) # Exception: jetson.utils -- videoOutput.__init()__ failed to parse args tuple
again generalising, seems best to use argv= format for these, either in line of prepared list
In fact use argv= for all lists
Also note that parameters are rarely validated it seems to just select something it likes which is probably not what you expected
so if it goes off the rails check the spelling of the parameters and things like you remembered the ‘=’ sign
Regards
JC