Example Detection
These pipelines features the example_detection algorithm in kwiver_algo_core.
This algorithm simply takes in a set of images or a video and generates dummy detections for each image/frame.
Then the detections boxes are drawn on the frame and displayed in a window.
It is a good example for how to use detection data types in kwiver.
Setup
The pipefiles associated with this tutorial are <kwiver build directory>examples/pipelines/example_detector_on_image.pipe
and <kwiver build directory>examples/pipelines/example_detector_on_video.pipe
You will need to have KWIVER_ENABLE_EXAMPLES turned on during CMake configuration of kwiver to get this file.
There is nothing more that will need to be done to execute this pipe file.
You can edit the edit the example_detector_on_video pipe file if you want to change the video file to be viewed,
or the <kwiver build directory>examples/pipelines/image_list.txt if you want to change images to be viewed.
Execution
Run the following command from the kwiver buildbin directory (bin/release on windows)
Relativly point to the darknet_image.pipe or darknet_video.pipe file like this:
# Windows Example :
kwiver runner ..\..\examples\pipelines\example_detector_on_image.pipe
# Linux Example :
./kwiver runner ../examples/pipelines/example_detector_on_image.pipe
# Windows Example :
kwiver runner ..\..\examples\pipelines\example_detector_on_video.pipe
# Linux Example :
./kwiver runner ../examples/pipelines/example_detector_on_video.pipe
Process Graph
The following image displays the pipeline graph.
Each process is linked to its associated definition page to learn more about it and the algorithms it uses.
example_detector_on_image
strict digraph "unnamed" {
clusterrank=local;
subgraph "cluster_detector" {
color=lightgray;
"detector_main" [label=<<u>detector<br/>:: image_object_detector</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/image_object_detector.html"];
"detector_input_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"detector_input_image" -> "detector_main" [arrowhead=none,color=black];
"detector_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"detector_main" -> "detector_output__heartbeat" [arrowhead=none,color=black];
"detector_output_detected_object_set" [label="detected_object_set\n:: kwiver:detected_object_set",shape=none,height=0,width=0,fontsize=12];
"detector_main" -> "detector_output_detected_object_set" [arrowhead=none,color=black];
}
subgraph "cluster_disp" {
color=lightgray;
"disp_main" [label=<<u>disp<br/>:: image_viewer</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/image_viewer.html"];
"disp_input_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"disp_input_image" -> "disp_main" [arrowhead=none,color=black];
"disp_input_timestamp" [label="timestamp\n:: kwiver:timestamp",shape=none,height=0,width=0,fontsize=12];
"disp_input_timestamp" -> "disp_main" [arrowhead=none,color=black];
"disp_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"disp_main" -> "disp_output__heartbeat" [arrowhead=none,color=black];
}
subgraph "cluster_draw" {
color=lightgray;
"draw_main" [label=<<u>draw<br/>:: draw_detected_object_boxes</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/draw_detected_object_boxes.html"];
"draw_input_detected_object_set" [label="detected_object_set\n:: kwiver:detected_object_set",shape=none,height=0,width=0,fontsize=12];
"draw_input_detected_object_set" -> "draw_main" [arrowhead=none,color=black];
"draw_input_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"draw_input_image" -> "draw_main" [arrowhead=none,color=black];
"draw_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"draw_main" -> "draw_output__heartbeat" [arrowhead=none,color=black];
"draw_output_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"draw_main" -> "draw_output_image" [arrowhead=none,color=black];
}
subgraph "cluster_input" {
color=lightgray;
"input_main" [label=<<u>input<br/>:: frame_list_input</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/frame_list_input.html"];
"input_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output__heartbeat" [arrowhead=none,color=black];
"input_output_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output_image" [arrowhead=none,color=black];
"input_output_image_file_name" [label="image_file_name\n:: kwiver:image_file_name",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output_image_file_name" [arrowhead=none,color=black];
"input_output_timestamp" [label="timestamp\n:: kwiver:timestamp",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output_timestamp" [arrowhead=none,color=black];
}
"detector_output_detected_object_set" -> "draw_input_detected_object_set" [minlen=1,color=black,weight=1];
"draw_output_image" -> "disp_input_image" [minlen=1,color=black,weight=1];
"input_output_image" -> "detector_input_image" [minlen=1,color=black,weight=1];
"input_output_image" -> "draw_input_image" [minlen=1,color=black,weight=1];
"input_output_timestamp" -> "disp_input_timestamp" [minlen=1,color=black,weight=1];
}
example_detector_on_video
strict digraph "unnamed" {
clusterrank=local;
subgraph "cluster_detector" {
color=lightgray;
"detector_main" [label=<<u>detector<br/>:: image_object_detector</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/image_object_detector.html"];
"detector_input_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"detector_input_image" -> "detector_main" [arrowhead=none,color=black];
"detector_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"detector_main" -> "detector_output__heartbeat" [arrowhead=none,color=black];
"detector_output_detected_object_set" [label="detected_object_set\n:: kwiver:detected_object_set",shape=none,height=0,width=0,fontsize=12];
"detector_main" -> "detector_output_detected_object_set" [arrowhead=none,color=black];
}
subgraph "cluster_disp" {
color=lightgray;
"disp_main" [label=<<u>disp<br/>:: image_viewer</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/image_viewer.html"];
"disp_input_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"disp_input_image" -> "disp_main" [arrowhead=none,color=black];
"disp_input_timestamp" [label="timestamp\n:: kwiver:timestamp",shape=none,height=0,width=0,fontsize=12];
"disp_input_timestamp" -> "disp_main" [arrowhead=none,color=black];
"disp_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"disp_main" -> "disp_output__heartbeat" [arrowhead=none,color=black];
}
subgraph "cluster_draw" {
color=lightgray;
"draw_main" [label=<<u>draw<br/>:: draw_detected_object_boxes</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/draw_detected_object_boxes.html"];
"draw_input_detected_object_set" [label="detected_object_set\n:: kwiver:detected_object_set",shape=none,height=0,width=0,fontsize=12];
"draw_input_detected_object_set" -> "draw_main" [arrowhead=none,color=black];
"draw_input_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"draw_input_image" -> "draw_main" [arrowhead=none,color=black];
"draw_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"draw_main" -> "draw_output__heartbeat" [arrowhead=none,color=black];
"draw_output_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"draw_main" -> "draw_output_image" [arrowhead=none,color=black];
}
subgraph "cluster_input" {
color=lightgray;
"input_main" [label=<<u>input<br/>:: video_input</u>>,shape=ellipse,rank=same,fontcolor=blue,fontsize=16,href="../sprokit/processes/video_input.html"];
"input_output__heartbeat" [label="_heartbeat\n:: _none",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output__heartbeat" [arrowhead=none,color=black];
"input_output_image" [label="image\n:: kwiver:image",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output_image" [arrowhead=none,color=black];
"input_output_timestamp" [label="timestamp\n:: kwiver:timestamp",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output_timestamp" [arrowhead=none,color=black];
"input_output_video_metadata" [label="video_metadata\n:: kwiver:video_metadata",shape=none,height=0,width=0,fontsize=12];
"input_main" -> "input_output_video_metadata" [arrowhead=none,color=black];
}
"detector_output_detected_object_set" -> "draw_input_detected_object_set" [minlen=1,color=black,weight=1];
"draw_output_image" -> "disp_input_image" [minlen=1,color=black,weight=1];
"input_output_image" -> "detector_input_image" [minlen=1,color=black,weight=1];
"input_output_image" -> "draw_input_image" [minlen=1,color=black,weight=1];
"input_output_timestamp" -> "disp_input_timestamp" [minlen=1,color=black,weight=1];
}