| |
- builtins.object
-
- tensorNet
-
- actionNet
- backgroundNet
- depthNet
- detectNet
- imageNet
- poseNet
- segNet
class actionNet(tensorNet) |
|
Action Recognition DNN - classifies an image sequence
Examples (jetson-inference/python/examples)
actionnet.py
__init__(...)
Loads an action classification model.
Parameters:
network (string) -- name of a built-in network to use,
see below for available options.
argv (strings) -- command line arguments passed to actionNet,
see below for available options.
Extended parameters for loading custom models:
model (string) -- path to self-trained ONNX model to load.
labels (string) -- path to labels.txt file (optional)
input_blob (string) -- name of the input layer of the model.
output_blob (string) -- name of the output layer of the model.
actionNet arguments:
--network=NETWORK pre-trained model to load, one of the following:
* resnet-18 (default)
* resnet-34
--model=MODEL path to custom model to load (.onnx)
--labels=LABELS path to text file containing the labels for each class
--input-blob=INPUT name of the input layer (default is 'input')
--output-blob=OUTPUT name of the output layer (default is 'output')
--threshold=CONF minimum confidence threshold for classification (default is 0.01)
--skip-frames=SKIP how many frames to skip between classifications (default is 1)
--profile enable layer profiling in TensorRT |
|
- Method resolution order:
- actionNet
- tensorNet
- builtins.object
Methods defined here:
- Classify(...)
- Append an image to the sequence and classify the action, returning the class and confidence.
Parameters:
image (capsule) -- CUDA memory capsule
width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
Returns:
(int, float) -- tuple containing the action's class index and confidence
- GetClassDesc(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetClassLabel(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetNetworkName(...)
- Return the name of the built-in network used by the model.
Parameters: (none)
Returns:
(string) -- name of the network (e.g. 'googlenet', 'alexnet')
or 'custom' if using a custom-loaded model
- GetNumClasses(...)
- Return the number of object classes that this network model is able to classify.
Parameters: (none)
Returns:
(int) -- number of object classes that the model supports
- GetSkipFrames(...)
- Return the number of frames that are skipped in between classifications.
Parameters: (none)
Returns:
(int) -- the number of frames skipped in between classifications
- GetThreshold(...)
- Return the minimum confidence threshold for classification.
Parameters: (none)
Returns:
(float) -- the confidence threshold for classification
- SetSkipFrames(...)
- Set the number of frames that are skipped in between classifications.
Since actionNet operates on video sequences, it's often helpful to skip frames
to lengthen the window of time the model gets to 'see' an action being performed.
The default setting is 1, where every other frame is skipped.
Setting this to 0 will disable it, and every frame will be processed.
When a frame is skipped, the classification results from the last frame are returned.
Parameters:
(int) -- the number of frames skipped in between classifications
Returns: (none)
- SetThreshold(...)
- Set the minimum confidence threshold for classification.
Parameters:
(float) -- confidence threshold
Returns: (none)
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- Usage(...)
- Return the command line parameters accepted by __init__()
Parameters: (none)
Returns:
(string) -- usage string documenting command-line options
Methods inherited from tensorNet:
- EnableDebug(...)
- Enable TensorRT debug messages and device synchronization
- EnableLayerProfiler(...)
- Enable the profiling of network layer execution times
- GetModelPath(...)
- Return the path to the network model file on disk
- GetModelType(...)
- Return the type of model format (caffe, ONNX, UFF, or custom)
- GetNetworkFPS(...)
- Return the runtime of the network (in frames per second)
- GetNetworkTime(...)
- Return the runtime of the network (in milliseconds)
- GetPrototxtPath(...)
- Return the path to the network prototxt file on disk
- PrintProfilerTimes(...)
- Print out performance timing info
Static methods inherited from tensorNet:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
|
class backgroundNet(tensorNet) |
|
Background removal DNN - performs background subtraction on images.
Examples (jetson-inference/python/examples)
backgroundnet.py
__init__(...)
Loads a background subtraction/removal model.
Parameters:
network (string) -- name of a built-in network to use,
see below for available options.
argv (strings) -- command line arguments passed to backgroundNet,
see below for available options.
Extended parameters for loading custom models:
model (string) -- path to self-trained ONNX model to load.
input_blob (string) -- name of the input layer of the model.
output_blob (string) -- name of the output layer of the model.
backgroundNet arguments:
--network=NETWORK pre-trained model to load, one of the following:
* u2net (default)
--model=MODEL path to custom model to load (caffemodel, uff, or onnx)
--input-blob=INPUT name of the input layer (default is 'input_0')
--output-blob=OUTPUT name of the output layer (default is 'output_0')
--profile enable layer profiling in TensorRT |
|
- Method resolution order:
- backgroundNet
- tensorNet
- builtins.object
Methods defined here:
- GetNetworkName(...)
- Return the name of the built-in network used by the model.
Parameters: (none)
Returns:
(string) -- name of the network (e.g. 'u2net')
or 'custom' if using a custom-loaded model
- Process(...)
- Perform background subtraction/removal on the image.
If only an input image is provided, the operation will be performed in-place.
If an output image is also provided, the results will be written to the output image.
If the images have an alpha channel (uchar4 or float4) and mask_alpha is true (default),
then the background/foreground mask will be written to the output's alpha channel.
Parameters:
input (capsule) -- CUDA memory capsule (input image)
output (capsule) -- CUDA memory capsule (optional output image)
filter (string) -- filtering used in upscaling the mask, 'point' or 'linear' (default is 'linear')
mask_alpha (bool) -- if true (default), the mask will be applied to the alpha channel as well
Returns: (none)
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- Usage(...)
- Return the command line parameters accepted by __init__()
Parameters: (none)
Returns:
(string) -- usage string documenting command-line options
Methods inherited from tensorNet:
- EnableDebug(...)
- Enable TensorRT debug messages and device synchronization
- EnableLayerProfiler(...)
- Enable the profiling of network layer execution times
- GetModelPath(...)
- Return the path to the network model file on disk
- GetModelType(...)
- Return the type of model format (caffe, ONNX, UFF, or custom)
- GetNetworkFPS(...)
- Return the runtime of the network (in frames per second)
- GetNetworkTime(...)
- Return the runtime of the network (in milliseconds)
- GetPrototxtPath(...)
- Return the path to the network prototxt file on disk
- PrintProfilerTimes(...)
- Print out performance timing info
Static methods inherited from tensorNet:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
|
class depthNet(tensorNet) |
|
Mono depth estimation DNN - performs depth mapping on monocular images
Examples (jetson-inference/python/examples)
depthnet.py
__init__(...)
Loads a mono depth estimation model.
Parameters:
network (string) -- name of a built-in network to use,
see below for available options.
argv (strings) -- command line arguments passed to depthNet,
see below for available options.
depthNet arguments:
--network NETWORK pre-trained model to load, one of the following:
* fcn-mobilenet
* fcn-resnet18
* fcn-resnet50
--model MODEL path to custom model to load (onnx)
--input_blob INPUT name of the input layer (default is 'input_0')
--output_blob OUTPUT name of the output layer (default is 'output_0')
--profile enable layer profiling in TensorRT |
|
- Method resolution order:
- depthNet
- tensorNet
- builtins.object
Methods defined here:
- GetDepthField(...)
- Return a cudaImage object of the raw depth field.
This is a single-channel float32 image that contains the depth estimates.
Parameters: (none)
Returns:
(cudaImage) -- single-channel float32 depth field
- GetDepthFieldHeight(...)
- Return the height of the depth field, in pixels.
Parameters: (none)
Returns:
(int) -- height of the depth field, in pixels
- GetDepthFieldWidth(...)
- Return the width of the depth field, in pixels.
Parameters: (none)
Returns:
(int) -- width of the depth field, in pixels
- GetNetworkName(...)
- Return the name of the built-in network used by the model.
Parameters: (none)
Returns:
(string) -- name of the network (e.g. 'MonoDepth-Mobilenet', 'MonoDepth-ResNet18')
or 'custom' if using a custom-loaded model
- Process(...)
- Compute the depth field from a monocular RGB/RGBA image.
The results can also be visualized if output image is provided.
Parameters:
input (capsule) -- CUDA memory capsule (input image)
output (capsule) -- CUDA memory capsule (optional output image)
colormap (string) -- colormap name (optional)
filter (string) -- filtering used in upscaling, 'point' or 'linear' (default is 'linear')
Returns: (none)
- Visualize(...)
- Visualize the raw depth field into a colorized RGB/RGBA depth map.
Parameters:
output (capsule) -- output CUDA memory capsule
colormap (string) -- colormap name (optional)
filter (string) -- filtering used in upscaling, 'point' or 'linear' (default is 'linear')
Returns: (none)
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- Usage(...)
- Return the command line parameters accepted by __init__()
Parameters: (none)
Returns:
(string) -- usage string documenting command-line options
Methods inherited from tensorNet:
- EnableDebug(...)
- Enable TensorRT debug messages and device synchronization
- EnableLayerProfiler(...)
- Enable the profiling of network layer execution times
- GetModelPath(...)
- Return the path to the network model file on disk
- GetModelType(...)
- Return the type of model format (caffe, ONNX, UFF, or custom)
- GetNetworkFPS(...)
- Return the runtime of the network (in frames per second)
- GetNetworkTime(...)
- Return the runtime of the network (in milliseconds)
- GetPrototxtPath(...)
- Return the path to the network prototxt file on disk
- PrintProfilerTimes(...)
- Print out performance timing info
Static methods inherited from tensorNet:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
|
class detectNet(tensorNet) |
|
Object Detection DNN - locates objects in an image
Examples (jetson-inference/python/examples)
detectnet.py
__init__(...)
Loads an object detection model.
Parameters:
network (string) -- name of a built-in network to use
see below for available options.
argv (strings) -- command line arguments passed to detectNet,
see below for available options.
threshold (float) -- minimum detection threshold.
default value is 0.5
Extended parameters for loading custom models:
model (string) -- path to self-trained ONNX model to load.
labels (string) -- path to labels.txt file (optional)
colors (string) -- path to colors.txt file (optional)
input_blob (string) -- name of the input layer of the model.
output_cvg (string) -- name of the output coverage/confidence layer.
output_bbox (string) -- name of the output bounding boxes layer.
detectNet arguments:
--network=NETWORK pre-trained model to load, one of the following:
* ssd-mobilenet-v1
* ssd-mobilenet-v2 (default)
* ssd-inception-v2
* peoplenet
* peoplenet-pruned
* dashcamnet
* trafficcamnet
* facedetect
--model=MODEL path to custom model to load (caffemodel, uff, or onnx)
--prototxt=PROTOTXT path to custom prototxt to load (for .caffemodel only)
--labels=LABELS path to text file containing the labels for each class
--input-blob=INPUT name of the input layer (default is 'data')
--output-cvg=COVERAGE name of the coverage/confidence output layer (default is 'coverage')
--output-bbox=BOXES name of the bounding output layer (default is 'bboxes')
--mean-pixel=PIXEL mean pixel value to subtract from input (default is 0.0)
--confidence=CONF minimum confidence threshold for detection (default is 0.5)
--clustering=CLUSTER minimum overlapping area threshold for clustering (default is 0.75)
--alpha=ALPHA overlay alpha blending value, range 0-255 (default: 120)
--overlay=OVERLAY detection overlay flags (e.g. --overlay=box,labels,conf)
valid combinations are: 'box', 'lines', 'labels', 'conf', 'none'
--profile enable layer profiling in TensorRT |
|
- Method resolution order:
- detectNet
- tensorNet
- builtins.object
Methods defined here:
- Detect(...)
- Detect objects in an RGBA image and return a list of detections.
Parameters:
image (capsule) -- CUDA memory capsule
width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
overlay (str) -- combination of box,lines,labels,conf,none flags (default is 'box,labels,conf')
Returns:
[Detections] -- list containing the detected objects (see detectNet.Detection)
- GetClassDesc(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetClassLabel(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetClassSynset(...)
- Return the synset data category string for the given class.
The synset generally maps to the class training data folder.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the synset of the class, typically 9 characters long
- GetClusteringThreshold(...)
- Return the overlapping area % threshold for clustering.
Parameters: (none)
Returns:
(float) -- the overlapping area % threshold for merging bounding boxes
- GetConfidenceThreshold(...)
- Return the minimum detection threshold.
Parameters: (none)
Returns:
(float) -- the threshold for detection
- GetLineWidth(...)
- Return the line width used during overlay when 'lines' mode is used.
Parameters: (none)
Returns:
(float) -- line width in pixels
- GetNumClasses(...)
- Return the number of object classes that this network model is able to detect.
Parameters: (none)
Returns:
(int) -- number of object classes that the model supports
- GetOverlayAlpha(...)
- Return the overlay alpha blending value for classes that don't have it explicitly set.
Parameters: (none)
Returns:
(float) -- alpha blending value between [0,255]
- GetThreshold(...)
- Return the minimum detection threshold.
Parameters: (none)
Returns:
(float) -- the threshold for detection
- GetTrackerType(...)
- Returns the type of tracker being used as a string
Parameters: (none)
Returns:
(string) -- 'IOU', 'KLT', or None if no tracking
- GetTrackingParams(...)
- Returns a dict containing various tracking parameters.
Parameters: (none)
Returns: a dict containing the following keys/values (dependent on the type of tracker):
minFrames (int) -- the number of re-identified frames before before establishing a track (IOU tracker only)
dropFrames (int) -- the number of consecutive lost frames after which a track is removed (IOU tracker only)
overlapThreshold (float) -- how much IOU overlap is required for a bounding box to be matched, between [0,1] (IOU tracker only)
- IsTrackingEnabled(...)
- Returns true if tracking is enabled, otherwise false
Parameters: (none)
Returns:
(bool) -- true if tracking is enabled, otherwise false
- Overlay(...)
- Overlay a list of detections in an RGBA image.
Parameters:
image (capsule) -- CUDA memory capsule
[Detections] -- list containing the detected objects (see detectNet.Detection) width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
overlay (str) -- combination of box,lines,labels,conf,none flags (default is 'box,labels,conf')
Returns:
None
- SetClusteringThreshold(...)
- Set the overlapping area % threshold for clustering.
Parameters:
(float) -- the overlapping area % threshold for merging bounding boxes
Returns: (none)
- SetConfidenceThreshold(...)
- Set the minimum detection threshold.
Parameters:
(float) -- detection threshold
Returns: (none)
- SetLineWidth(...)
- Set the line width used during overlay when 'lines' mode is used
Parameters:
width (float) -- desired line width, in pixels
Returns: (none)
- SetOverlayAlpha(...)
- Set the alpha blending value used during overlay visualization for all classes
Parameters:
alpha (float) -- desired alpha value, between 0.0 and 255.0
Returns: (none)
- SetThreshold(...)
- Set the minimum detection threshold.
Parameters:
(float) -- detection threshold
Returns: (none)
- SetTrackerType(...)
- Sets the type of tracker being used
Parameters:
(string) -- 'IOU' or 'KLT' (other strings will disable tracking)
Returns: (none)
- SetTrackingEnabled(...)
- Sets if tracking is enabled or disabled.
When enabling tracking, if the tracker type wasn't previously
set with detectNet.SetTrackerType(), then 'IOU' will be used.
Parameters:
(bool) -- true to enable tracking, false to disable it
Returns: (none)
- SetTrackingParams(...)
- Sets various tracker parameters using keyword arguments.
Parameters:
minFrames (int) -- the number of re-identified frames before before establishing a track (IOU tracker only)
dropFrames (int) -- the number of consecutive lost frames after which a track is removed (IOU tracker only)
overlapThreshold (float) -- how much IOU overlap is required for a bounding box to be matched, between [0,1] (IOU tracker only)
Returns:
None
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- Usage(...)
- Return the command line parameters accepted by __init__()
Parameters: (none)
Returns:
(string) -- usage string documenting command-line options
Data and other attributes defined here:
- Detection = <class 'jetson.inference.detectNet.Detection'>
- Object Detection Result
----------------------------------------------------------------------
Data descriptors defined here:
Confidence
Confidence value of the detected object
ClassID
Class index of the detected object
TrackID
Unique tracking ID (or -1 if untracked)
TrackStatus
-1 for dropped, 0 for initializing, 1 for active/valid
TrackFrames
The number of frames the object has been re-identified for
TrackLost
The number of consecutive frames tracking has been lost for
Width
Width of bounding box
Height
Height of bounding box
Left
Left bounding box coordinate
Right
Right bounding box coordinate
Top
Top bounding box coordinate
Bottom
Bottom bounding box coordinate
ROI
(Left, Top, Right, Bottom) tuple
Center
Center (x,y) coordinate tuple
Area
Area of bounding box
Methods inherited from tensorNet:
- EnableDebug(...)
- Enable TensorRT debug messages and device synchronization
- EnableLayerProfiler(...)
- Enable the profiling of network layer execution times
- GetModelPath(...)
- Return the path to the network model file on disk
- GetModelType(...)
- Return the type of model format (caffe, ONNX, UFF, or custom)
- GetNetworkFPS(...)
- Return the runtime of the network (in frames per second)
- GetNetworkTime(...)
- Return the runtime of the network (in milliseconds)
- GetPrototxtPath(...)
- Return the path to the network prototxt file on disk
- PrintProfilerTimes(...)
- Print out performance timing info
Static methods inherited from tensorNet:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
|
class imageNet(tensorNet) |
|
Image Recognition DNN - classifies an image
Examples (jetson-inference/python/examples)
imagenet.py
my-recognition.py
__init__(...)
Loads an image recognition model.
Parameters:
network (string) -- name of a built-in network to use,
see below for available options.
argv (strings) -- command line arguments passed to imageNet,
see below for available options.
Extended parameters for loading custom models:
model (string) -- path to self-trained ONNX model to load.
labels (string) -- path to labels.txt file (optional)
input_blob (string) -- name of the input layer of the model.
output_blob (string) -- name of the output layer of the model.
imageNet arguments:
--network=NETWORK pre-trained model to load, one of the following:
* alexnet
* googlenet (default)
* googlenet-12
* resnet-18
* resnet-50
* resnet-101
* resnet-152
* vgg-16
* vgg-19
* inception-v4
--model=MODEL path to custom model to load (caffemodel, uff, or onnx)
--prototxt=PROTOTXT path to custom prototxt to load (for .caffemodel only)
--labels=LABELS path to text file containing the labels for each class
--input-blob=INPUT name of the input layer (default is 'data')
--output-blob=OUTPUT name of the output layer (default is 'prob')
--threshold=CONF minimum confidence threshold for classification (default is 0.01)
--smoothing=WEIGHT weight between [0,1] or number of frames (disabled by default)
--profile enable layer profiling in TensorRT |
|
- Method resolution order:
- imageNet
- tensorNet
- builtins.object
Methods defined here:
- Classify(...)
- Classify an image and return the object's class and confidence.
Parameters:
image (capsule) -- CUDA memory capsule
width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
topK (int) -- the number of predictions to return (sorted by confidence)
if topK is 0, then all valid predictions will be returned
Returns:
(int, float) -- tuple containing the object's class index and confidence
if topK is set, then a list of these tuples will be returned
- GetClassDesc(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetClassLabel(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetClassSynset(...)
- Return the synset data category string for the given class.
The synset generally maps to the class training data folder.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the synset of the class, typically 9 characters long
- GetNetworkName(...)
- Return the name of the built-in network used by the model.
Parameters: (none)
Returns:
(string) -- name of the network (e.g. 'googlenet', 'alexnet')
or 'custom' if using a custom-loaded model
- GetNumClasses(...)
- Return the number of object classes that this network model is able to classify.
Parameters: (none)
Returns:
(int) -- number of object classes that the model supports
- GetSmoothing(...)
- Return the temporal smoothing factor applied to the results.
Parameters: (none)
Returns:
(float) -- the weight between [0,1] or the number of frames in the smoothing window
- GetThreshold(...)
- Return the minimum confidence threshold for classification.
Parameters: (none)
Returns:
(float) -- the confidence threshold for classification
- SetSmoothing(...)
- Set the temporal smoothing factor applied to the results.
Parameters:
(float) -- A weight between [0,1] that's placed on the latest confidence values,
or the smoothing window as a number of frames (where the weight will be 1/N)
Setting this to 0 or 1 will disable smoothing and use the unfiltered outputs
Returns: (none)
- SetThreshold(...)
- Set the minimum confidence threshold for classification.
Parameters:
(float) -- confidence threshold
Returns: (none)
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- Usage(...)
- Return the command line parameters accepted by __init__()
Parameters: (none)
Returns:
(string) -- usage string documenting command-line options
Methods inherited from tensorNet:
- EnableDebug(...)
- Enable TensorRT debug messages and device synchronization
- EnableLayerProfiler(...)
- Enable the profiling of network layer execution times
- GetModelPath(...)
- Return the path to the network model file on disk
- GetModelType(...)
- Return the type of model format (caffe, ONNX, UFF, or custom)
- GetNetworkFPS(...)
- Return the runtime of the network (in frames per second)
- GetNetworkTime(...)
- Return the runtime of the network (in milliseconds)
- GetPrototxtPath(...)
- Return the path to the network prototxt file on disk
- PrintProfilerTimes(...)
- Print out performance timing info
Static methods inherited from tensorNet:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
|
class poseNet(tensorNet) |
|
Pose Estimation DNN - detects the poses of objects in an image
Examples (jetson-inference/python/examples)
posenet.py
__init__(...)
Loads an pose estimation model.
Parameters:
network (string) -- name of a built-in network to use
see below for available options.
argv (strings) -- command line arguments passed to poseNet,
see below for available options.
threshold (float) -- minimum detection threshold.
default value is 0.15
poseNet arguments:
--network=NETWORK pre-trained model to load, one of the following:
* resnet18-body (default)
* resnet18-hand
* densenet121-body
--model=MODEL path to custom model to load (caffemodel, uff, or onnx)
--prototxt=PROTOTXT path to custom prototxt to load (for .caffemodel only)
--labels=LABELS path to text file containing the labels for each class
--input-blob=INPUT name of the input layer (default is 'input')
--output-cvg=COVERAGE name of the coverge output layer (default is 'cmap')
--output-bbox=BOXES name of the bounding output layer (default is 'paf')
--mean-pixel=PIXEL mean pixel value to subtract from input (default is 0.0)
--threshold=THRESHOLD minimum threshold for detection (default is 0.5)
--overlay=OVERLAY detection overlay flags (e.g. --overlay=links,keypoints)
valid combinations are: 'box', 'links', 'keypoints', 'none'
--keypoint-scale=X radius scale for keypoints, relative to image (default: 0.0052)
--link-scale=X line width scale for links, relative to image (default: 0.0013)
--profile enable layer profiling in TensorRT |
|
- Method resolution order:
- poseNet
- tensorNet
- builtins.object
Methods defined here:
- FindKeypointID(...)
- Return the keypoint ID for the given keypoint name.
Parameters:
(str) -- name of the keypoint
Returns:
(int) -- the ID of the keypoint
- GetKeypointName(...)
- Return the keypoint name for the given keypoint ID.
Parameters:
(int) -- index of the keypoint, between [0, GetNumKeypoints()]
Returns:
(string) -- the text description of the keypoint
- GetKeypointScale(...)
- Get the scale used to calculate the radius of keypoints based on image dimensions.
Parameters: (none)
Returns:
(float) -- the scale used to calculate the radius of keypoints based on image dimensions
- GetLinkScale(...)
- Get the scale used to calculate the width of link lines based on image dimensions.
Parameters: (none)
Returns:
(float) -- the scale used to calculate the width of link lines based on image dimensions
- GetNumKeypoints(...)
- Return the number of keypoints in the model's pose topology.
Parameters: (none)
Returns:
(int) -- number of keypoints in the model's pose topology
- GetThreshold(...)
- Return the minimum detection threshold.
Parameters: (none)
Returns:
(float) -- the threshold for detection
- Overlay(...)
- Overlay a list of object poses onto an image.
Parameters:
input (capsule) -- input image (CUDA memory capsule)
[ObjectPoses] -- list containing the detected object poses (see poseNet.ObjectPose) width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
overlay (str) -- combination of box,labels,none flags (default is 'box')
output (capsule) -- output image (CUDA memory capsule)
Returns:
None
- Process(...)
- Perform pose estimation on the given image, returning object poses, and overlay the results..
Parameters:
image (capsule) -- CUDA memory capsule
width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
overlay (str) -- combination of box,labels,none flags (default is 'box')
Returns:
[ObjectPoses] -- list containing the detected object poses (see poseNet.ObjectPose)
- SetKeypointAlpha(...)
- Set the alpha blending value used during overlay visualization for one or all keypoint types
Parameters:
alpha (float) -- desired alpha value, between 0.0 and 255.0
keypoint (int) -- optional index of the keypoint to set the alpha (otherwise will apply to all keypoints)
Returns: (none)
- SetKeypointScale(...)
- Set the scale used to calculate the radius of keypoint circles.
This scale will be multiplied by the largest image dimension.
Parameters:
scale (float) -- desired scaling factor
Returns: (none)
- SetLinkScale(...)
- Set the scale used to calculate the width of link lines.
This scale will be multiplied by the largest image dimension.
Parameters:
scale (float) -- desired scaling factor
Returns: (none)
- SetThreshold(...)
- Return the minimum detection threshold.
Parameters:
(float) -- detection threshold
Returns: (none)
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- Usage(...)
- Return the command line parameters accepted by __init__()
Parameters: (none)
Returns:
(string) -- usage string documenting command-line options
Data and other attributes defined here:
- ObjectPose = <class 'jetson.inference.poseNet.ObjectPose'>
- Object Pose Estimation Result
----------------------------------------------------------------------
Data descriptors defined here:
Keypoints
List of poseNet.ObjectPose.Keypoint objects
Links
List of (a,b) tuples, where a & b are indexes into the Keypoints list
ID
Object ID from the image frame, starting at 0
Left
Left bounding box coordinate
Right
Right bounding box coordinate
Top
Top bounding box coordinate
Bottom
Bottom bounding box coordinate
Methods inherited from tensorNet:
- EnableDebug(...)
- Enable TensorRT debug messages and device synchronization
- EnableLayerProfiler(...)
- Enable the profiling of network layer execution times
- GetModelPath(...)
- Return the path to the network model file on disk
- GetModelType(...)
- Return the type of model format (caffe, ONNX, UFF, or custom)
- GetNetworkFPS(...)
- Return the runtime of the network (in frames per second)
- GetNetworkTime(...)
- Return the runtime of the network (in milliseconds)
- GetPrototxtPath(...)
- Return the path to the network prototxt file on disk
- PrintProfilerTimes(...)
- Print out performance timing info
Static methods inherited from tensorNet:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
|
class segNet(tensorNet) |
|
Semantic Segmentation DNN - segments an image with per-pixel classification
Examples (jetson-inference/python/examples)
segnet-console.py
segnet-camera.py
__init__(...)
Loads an semantic segmentation model.
Parameters:
network (string) -- name of a built-in network to use,
see below for available options.
argv (strings) -- command line arguments passed to segNet,
see below for available options.
Extended parameters for loading custom models:
model (string) -- path to self-trained ONNX model to load.
labels (string) -- path to labels.txt file (optional)
colors (string) -- path to colors.txt file (optional)
input_blob (string) -- name of the input layer of the model.
output_blob (string) -- name of the output layer of the model.
segNet arguments:
--network=NETWORK pre-trained model to load, one of the following:
* fcn-resnet18-cityscapes-512x256
* fcn-resnet18-cityscapes-1024x512
* fcn-resnet18-cityscapes-2048x1024
* fcn-resnet18-deepscene-576x320
* fcn-resnet18-deepscene-864x480
* fcn-resnet18-mhp-512x320
* fcn-resnet18-mhp-640x360
* fcn-resnet18-voc-320x320 (default)
* fcn-resnet18-voc-512x320
* fcn-resnet18-sun-512x400
* fcn-resnet18-sun-640x512
--model=MODEL path to custom model to load (caffemodel, uff, or onnx)
--prototxt=PROTOTXT path to custom prototxt to load (for .caffemodel only)
--labels=LABELS path to text file containing the labels for each class
--colors=COLORS path to text file containing the colors for each class
--input-blob=INPUT name of the input layer (default: 'input_0')
--output-blob=OUTPUT name of the output layer (default: 'output_0')
--alpha=ALPHA overlay alpha blending value, range 0-255 (default: 150)
--visualize=VISUAL visualization flags (e.g. --visualize=overlay,mask)
valid combinations are: 'overlay', 'mask'
--profile enable layer profiling in TensorRT |
|
- Method resolution order:
- segNet
- tensorNet
- builtins.object
Methods defined here:
- GetClassColor(...)
- Return the class color for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(r,g,b,a) tuple -- tuple containing the RGBA color of the object class
- GetClassDesc(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetClassLabel(...)
- Return the class description for the given object class.
Parameters:
(int) -- index of the class, between [0, GetNumClasses()]
Returns:
(string) -- the text description of the object class
- GetGridHeight(...)
- Return the number of rows in the segmentation mask classification grid.
These are the raw dimensions, they are typically smaller than the image size.
In segNet.Mask() the classification grid gets upscaled to match the image size,
but this function returns the original unscaled size of the grid.
Parameters: (none)
Returns:
(int) -- height of the segmentation mask's classification grid
- GetGridSize(...)
- Return a (width, height) tuple with the dimensions of the segmentation mask classification grid.
These are the raw dimensions, they are typically smaller than the image size.
In segNet.Mask() the classification grid gets upscaled to match the image size,
but this function returns the original unscaled size of the grid.
Parameters: (none)
Returns:
(int, int) -- tuple containing the width and height of the segmentation mask's classification grid
- GetGridWidth(...)
- Return the number of columns in the segmentation mask classification grid.
These are the raw dimensions, they are typically smaller than the image size.
In segNet.Mask() the classification grid gets upscaled to match the image size,
but this function returns the original unscaled size of the grid.
Parameters: (none)
Returns:
(int) -- width of the segmentation mask's classification grid
- GetNetworkName(...)
- Return the name of the built-in network used by the model.
Parameters: (none)
Returns:
(string) -- name of the network (e.g. 'FCN_ResNet18', 'FCN_Alexnet')
or 'custom' if using a custom-loaded model
- GetNumClasses(...)
- Return the number of object classes that this network model is able to classify.
Parameters: (none)
Returns:
(int) -- number of object classes that the model supports
- GetOverlayAlpha(...)
- Return the overlay alpha blending value for classes that don't have it explicitly set.
Parameters: (none)
Returns:
(float) -- alpha blending value between [0,255]
- Mask(...)
- Produce a colorized RGBA segmentation mask of the output.
Parameters:
image (capsule) -- output CUDA memory capsule
width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
filter_mode (string) -- optional string indicating the filter mode, 'point' or 'linear' (default: 'linear')
Returns: (none)
- Overlay(...)
- Produce the segmentation overlay alpha blended on top of the original image.
Parameters:
image (capsule) -- output CUDA memory capsule
width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
filter_mode (string) -- optional string indicating the filter mode, 'point' or 'linear' (default: 'linear')
Returns: (none)
- Process(...)
- Perform the initial inferencing processing of the segmentation.
The results can then be visualized using the Overlay() and Mask() functions.
Parameters:
image (capsule) -- CUDA memory capsule
width (int) -- width of the image (in pixels)
height (int) -- height of the image (in pixels)
ignore_class (string) -- optional label name of class to ignore in the classification (default: 'void')
Returns: (none)
- SetOverlayAlpha(...)
- Set the alpha blending value used during overlay visualization for all classes
Parameters:
alpha (float) -- desired alpha value, between 0.0 and 255.0
explicit_exempt (optional, bool) -- if True, the global alpha doesn't apply to classes that have an alpha value explicitly set in the colors file (default: True)
Returns: (none)
- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
Static methods defined here:
- Usage(...)
- Return the command line parameters accepted by __init__()
Parameters: (none)
Returns:
(string) -- usage string documenting command-line options
Methods inherited from tensorNet:
- EnableDebug(...)
- Enable TensorRT debug messages and device synchronization
- EnableLayerProfiler(...)
- Enable the profiling of network layer execution times
- GetModelPath(...)
- Return the path to the network model file on disk
- GetModelType(...)
- Return the type of model format (caffe, ONNX, UFF, or custom)
- GetNetworkFPS(...)
- Return the runtime of the network (in frames per second)
- GetNetworkTime(...)
- Return the runtime of the network (in milliseconds)
- GetPrototxtPath(...)
- Return the path to the network prototxt file on disk
- PrintProfilerTimes(...)
- Print out performance timing info
Static methods inherited from tensorNet:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
|
|