tensordecoders: add property label-file to exemple
This commit is contained in:
parent
01a504c310
commit
df08833e27
@ -43,10 +43,10 @@
|
|||||||
* ! videoconvertscale add-borders=1 ! onnxinference execution-provider=cpu
|
* ! videoconvertscale add-borders=1 ! onnxinference execution-provider=cpu
|
||||||
* model-file=segmentation.onnx input-image-format=chw input-tensor-offset=0 \
|
* model-file=segmentation.onnx input-image-format=chw input-tensor-offset=0 \
|
||||||
* input-tensor-scale=255.0 ! yolotensordecoder \
|
* input-tensor-scale=255.0 ! yolotensordecoder \
|
||||||
* class-confidence-threshold=0.8 iou-threshold=0.7 max-detections=100
|
* class-confidence-threshold=0.8 iou-threshold=0.7 max-detections=100 \
|
||||||
* ! objectdetectionoverlay object-detection-outline-color=0xFF0000FF
|
* label-file=coco_labels.txt ! objectdetectionoverlay \
|
||||||
* draw-labels=true ! segmentationoverlay hint-maximum-segment-type=50 \
|
* object-detection-outline-color=0xFF0000FF draw-labels=true ! \
|
||||||
* ! videoconvert ! ximagesink
|
* segmentationoverlay hint-maximum-segment-type=50 ! videoconvert ! ximagesink
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -175,6 +175,15 @@ gst_yolo_tensor_decoder_class_init (GstYoloTensorDecoderClass * klass)
|
|||||||
|
|
||||||
/* Define GstYoloTensorDecoder properties using GObject properties
|
/* Define GstYoloTensorDecoder properties using GObject properties
|
||||||
* interface.*/
|
* interface.*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstYoloTensorDecoder:box-confidence-threshold
|
||||||
|
*
|
||||||
|
* Threshold on boxes location confidence level
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
||||||
PROP_BOX_CONFI_THRESH,
|
PROP_BOX_CONFI_THRESH,
|
||||||
g_param_spec_float ("box-confidence-threshold",
|
g_param_spec_float ("box-confidence-threshold",
|
||||||
@ -184,6 +193,13 @@ gst_yolo_tensor_decoder_class_init (GstYoloTensorDecoderClass * klass)
|
|||||||
0.0, 1.0, DEFAULT_BOX_CONFI_THRESH,
|
0.0, 1.0, DEFAULT_BOX_CONFI_THRESH,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstYoloTensorDecoder:class-confidence-threshold
|
||||||
|
*
|
||||||
|
* Threshold on object class confidence level
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
||||||
PROP_CLS_CONFI_THRESH,
|
PROP_CLS_CONFI_THRESH,
|
||||||
g_param_spec_float ("class-confidence-threshold",
|
g_param_spec_float ("class-confidence-threshold",
|
||||||
@ -193,6 +209,14 @@ gst_yolo_tensor_decoder_class_init (GstYoloTensorDecoderClass * klass)
|
|||||||
0.0, 1.0, DEFAULT_CLS_CONFI_THRESH,
|
0.0, 1.0, DEFAULT_CLS_CONFI_THRESH,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstYoloTensorDecoder:class-confidence-threshold
|
||||||
|
*
|
||||||
|
* Threshold on maximum intersection-over-union between bounding boxes to
|
||||||
|
* consider them distinct.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
||||||
PROP_IOU_THRESH,
|
PROP_IOU_THRESH,
|
||||||
g_param_spec_float ("iou-threshold",
|
g_param_spec_float ("iou-threshold",
|
||||||
@ -202,6 +226,13 @@ gst_yolo_tensor_decoder_class_init (GstYoloTensorDecoderClass * klass)
|
|||||||
0.0, 1.0, DEFAULT_IOU_THRESH,
|
0.0, 1.0, DEFAULT_IOU_THRESH,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstYoloTensorDecoder:max-detections
|
||||||
|
*
|
||||||
|
* Threshold on maximum object/masks detections
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
||||||
PROP_MAX_DETECTION,
|
PROP_MAX_DETECTION,
|
||||||
g_param_spec_uint ("max-detections",
|
g_param_spec_uint ("max-detections",
|
||||||
@ -210,6 +241,13 @@ gst_yolo_tensor_decoder_class_init (GstYoloTensorDecoderClass * klass)
|
|||||||
0, G_MAXUINT, DEFAULT_MAX_DETECTION,
|
0, G_MAXUINT, DEFAULT_MAX_DETECTION,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstYoloTensorDecoder:tensors-name-masks
|
||||||
|
*
|
||||||
|
* Overwrite mask tensors name
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
||||||
PROP_MASK_TENSOR_NAME,
|
PROP_MASK_TENSOR_NAME,
|
||||||
g_param_spec_string ("tensors-name-masks",
|
g_param_spec_string ("tensors-name-masks",
|
||||||
@ -219,6 +257,13 @@ gst_yolo_tensor_decoder_class_init (GstYoloTensorDecoderClass * klass)
|
|||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_STATIC_STRINGS)));
|
G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstYoloTensorDecoder:tensors-name-logits
|
||||||
|
*
|
||||||
|
* Overwrite logits tensors name
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
||||||
PROP_LOGITS_TENSOR_NAME,
|
PROP_LOGITS_TENSOR_NAME,
|
||||||
g_param_spec_string ("tensors-name-logits",
|
g_param_spec_string ("tensors-name-logits",
|
||||||
@ -441,6 +486,7 @@ gst_yolo_tensor_decoder_set_property (GObject * object, guint prop_id,
|
|||||||
} else {
|
} else {
|
||||||
GST_WARNING_OBJECT (self, "Label file '%s' not found!", filename);
|
GST_WARNING_OBJECT (self, "Label file '%s' not found!", filename);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user