CKeypointDetectionTask#
- class ikomia.dataprocess.pydataprocess.CKeypointDetectionTask#
Base class for keypoint detection task in Computer Vision. It defines a task with the following properties:
Inputs:
image (
CImageIO
)graphics (
CGraphicsInput
)
Outputs:
image IO (
CImageIO
): by default source image is forwarded.keypoints detection IO (
CKeypointsIO
)
Derived from
C2dImageTask
.Import
from ikomia.dataprocess import CKeypointDetectionTask
Methods
__init__
(arg1)__init__( (object)self) -> None :
add_object
(self, id, class_index, ...)Add detected object with its associated keypoints.
get_keypoint_links
(self)Get the global connection scheme of detected keypoints.
get_keypoint_names
(self)Get keypoint names.
get_object_names
(self)Get class names.
get_results
(self)Get keypoint detection results as a
CKeypointsIO
instance.get_image_with_graphics
(self)Get visualization image where all extracted information are embedded (graphics items).
read_class_names
(self, path)Populate class names from the given text file (one line per class).
set_keypoint_links
(self, links)Set the global connection scheme of detected keypoints.
set_keypoint_names
(self, names)Set keypoint names.
set_object_colors
(self, colors)Set colors associated with class names.
set_object_names
(self, names)Set class names.
emit_add_sub_progress_steps
(self, count)emit_output_changed
(self)emit_step_progress
(self)See
emit_step_progress()
.Overridden methods
end_task_run
(self)See
end_task_run()
.Inherited methods
add_input
(self, input)Add new input to the task.
add_output
(self, output)Add new output to the task.
apply_graphics_mask
(self, origin, processed, ...)Apply the mask generated from graphics to the result image so that only masked areas seems to be processed.
apply_graphics_mask_to_binary
(self, origin, ...)Apply the mask generated from graphics to the binary source image.
begin_task_run
(self)See
begin_task_run()
.create_input_graphics_mask
(self, index, ...)Generate a binary mask image from the task graphics input at the specified index.
create_graphics_mask
(self, width, height, ...)Generate a binary mask image from the given graphics input object.
execute_actions
(self, action)Method called when a specific action is requested from the associated widget (see
emit_send_process_action()
).forward_input_image
(self, input_index, ...)Forward input image at position input_index to output at position output_index.
get_elapsed_time
(self)Get the time of the last execution in milliseconds.
get_graphics_mask
(self, index)Get the binary mask generated from graphics input at position index.
get_input
(self, index)Get input at position index.
get_input_count
(self)Get the number of inputs.
get_input_data_type
(self, index)Get input data type at position index.
get_inputs
(self)Get the whole list of inputs.
get_output
(self, index)Get output at position index.
get_output_count
(self)Get the number of outputs.
get_output_data_type
(self, index)Get output data type at position index.
get_outputs
(self)Get the whole list of outputs.
get_parameters
(self)Get values of task parameters.
get_progress_steps
(self)See
get_progress_steps()
.global_input_changed
(self, is_new_sequence)graphics_changed
(self)See
graphics_changed()
.is_graphics_changed_listening
(self)Check whether the task is listening to graphics changed event.
is_mask_available
(self, index)Check whether a binary mask from graphics input is available at position index.
parameters_modified
(self)Notify that the task parameters have changed.
remove_input
(self, index)Remove input at the given position.
run
(self)See
run()
.set_action_flag
(self, action, is_enable)Enable or disable the given action.
set_active
(self, is_active)See
set_active()
.set_input
(self, input, index)Set input at position index with the given one.
set_input_data_type
(self, data_type, index)Set the data type for the input at position index.
set_inputs
(self, inputs)Set the whole list of inputs with the given one.
set_output
(self, output, index)Set output at position index with the given one.
set_output_color_map
(self, index, ...)Bind a display color map to an image output.
set_output_data_type
(self, data_type, index)Set the data type for the output at position index.
set_outputs
(self, outputs)Set the whole list of outputs with the given one.
set_parameters
(self, values)Set values of task parameters.
stop
(self)See
stop()
.update_static_outputs
(self)Determine output data type automatically from input data types.
Attributes
name
Task name (must be unique)
type
Main purpose or data type on which the task is dedicated to.
Details
- __init__((object)arg1) None #
- __init__( (object)self) -> None :
Default constructor
- __init__( (object)self, (str)name) -> None :
Construct CKeypointDetectionTask object with the given name.
Args:
name (str): task name, must be unique
- add_object((CKeypointDetectionTask)self, (int)id, (int)class_index, (float)confidence, (float)x, (float)y, (float)width, (float)height, (object)keypoints) None : #
Add detected object with its associated keypoints.
- Parameters:
id (int) – object identifier
class_index (int) – index of the object class
confidence (float) – confidence of the prediction
x (float) – left coordinate of object bounding box
y (float) – top coordinate of object bounding box
width (float) – width of object bounding box
height (float) – height of object bounding box
keypoints (list of tuple) – keypoints as list of pairs (index,
CPointF
)
- get_keypoint_links((CKeypointDetectionTask)self) object : #
Get the global connection scheme of detected keypoints. It consists in a list of links between points with the following information: starting point index, ending point index, link label and link color. Keypoints list order is very important: there is a strict equivalence between prediction keypoints index, name index and connection scheme.
- Returns:
CKeypointLink
list
- get_keypoint_names((CKeypointDetectionTask)self) object : #
Get keypoint names. Each keypoint is associated with a label. Order in this list is very important: there is a strict equivalence between prediction keypoints index, name index and connection scheme.
- Returns:
keypoint names
- Return type:
str list
- get_object_names((CKeypointDetectionTask)self) object : #
Get class names. Call
read_class_names()
to populate names from text file.- Returns:
class names
- Return type:
str list
- get_results((CKeypointDetectionTask)self) CKeypointsIO : #
Get keypoint detection results as a
CKeypointsIO
instance.- Returns:
keypoint detection results
- Return type:
- get_image_with_graphics((CKeypointDetectionTask)self) object : #
Get visualization image where all extracted information are embedded (graphics items).
- Returns:
visualization image
- Return type:
2D Numpy array
- read_class_names((CKeypointDetectionTask)self, (str)path) None : #
Populate class names from the given text file (one line per class).
- Parameters:
path (str) – path to class names definition file
- set_keypoint_links((CKeypointDetectionTask)self, (object)links) None : #
Set the global connection scheme of detected keypoints. It consists in a list of links between points with the following information: starting point index, ending point index, link label and link color. Keypoints index are given with respect to prediction model and names structures.
- Parameters:
links (
CKeypointLink
list) –
- set_keypoint_names((CKeypointDetectionTask)self, (object)names) None : #
Set keypoint names. Each keypoint is associated with a label. Moreover, order in this list is very important as there must have a strict equivalence between prediction keypoints index, name index and connection scheme.
- Parameters:
names (list of str) –
- set_object_colors((CKeypointDetectionTask)self, (object)colors) None : #
Set colors associated with class names. The given list must have the same size as names list. If not provided, random colors are generated while populating the name list (
read_class_names()
).- Parameters:
list (colors (list of) – r, g, b integer values in range [0, 255])
- set_object_names((CKeypointDetectionTask)self, (object)names) None : #
Set class names. The function generate associated random colors if none is defined.
- Parameters:
names (list of str) –
- emit_add_sub_progress_steps((CKeypointDetectionTask)self, (int)count) None : #
- emit_graphics_context_changed((CKeypointDetectionTask)self) None : #
- emit_output_changed((CKeypointDetectionTask)self) None : #
- emit_step_progress((CKeypointDetectionTask)self) None : #
See
emit_step_progress()
.
- end_task_run((CKeypointDetectionTask)self) None : #
See
end_task_run()
.end_task_run( (CKeypointDetectionTask)self) -> None