Skip to content

Commit

Permalink
postprocessing: Add initial support for IMX500 postprocessing
Browse files Browse the repository at this point in the history
Add postprocessing stages using the IMX500 inference output. MobileNet
SSD object inference and PoseNet pose estimation software stages have
been implemented in this commit.

Signed-off-by: Naushir Patuck <[email protected]>
  • Loading branch information
naushir committed Sep 26, 2024
1 parent ddfce35 commit 5ccbeb0
Show file tree
Hide file tree
Showing 12 changed files with 1,818 additions and 0 deletions.
123 changes: 123 additions & 0 deletions assets/imx500_mobilenet_ssd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"imx500_object_detection":
{
"max_detections" : 5,
"threshold" : 0.6,
"network_file": "/usr/share/imx500-models/imx500_network_ssd_mobilenetv2_fpnlite_320x320_pp.rpk",

"save_input_tensor":
{
"filename": "/home/pi/input_tensor.raw",
"num_tensors": 10,
"norm_val": [384, 384, 384, 0],
"norm_shift": [0, 0, 0, 0]
},

"temporal_filter":
{
"tolerance": 0.1,
"factor": 0.2,
"visible_frames": 4,
"hidden_frames": 2
},

"classes":
[
"person",
"bicycle",
"car",
"motorcycle",
"airplane",
"bus",
"train",
"truck",
"boat",
"traffic light",
"fire hydrant",
"-",
"stop sign",
"parking meter",
"bench",
"bird",
"cat",
"dog",
"horse",
"sheep",
"cow",
"elephant",
"bear",
"zebra",
"giraffe",
"-",
"backpack",
"umbrella",
"-",
"-",
"handbag",
"tie",
"suitcase",
"frisbee",
"skis",
"snowboard",
"sports ball",
"kite",
"baseball bat",
"baseball glove",
"skateboard",
"surfboard",
"tennis racket",
"bottle",
"-",
"wine glass",
"cup",
"fork",
"knife",
"spoon",
"bowl",
"banana",
"apple",
"sandwich",
"orange",
"broccoli",
"carrot",
"hot dog",
"pizza",
"donut",
"cake",
"chair",
"couch",
"potted plant",
"bed",
"-",
"dining table",
"-",
"-",
"toilet",
"-",
"tv",
"laptop",
"mouse",
"remote",
"keyboard",
"cell phone",
"microwave",
"oven",
"toaster",
"sink",
"refrigerator",
"-",
"book",
"clock",
"vase",
"scissors",
"teddy bear",
"hair drier",
"toothbrush"
]
},

"object_detect_draw_cv":
{
"line_thickness" : 2
}
}
29 changes: 29 additions & 0 deletions assets/imx500_posenet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"imx500_posenet":
{
"max_detections" : 5,
"threshold" : 0.4,
"offset_refinement_steps": 5,
"nms_radius": 10.0,
"network_file": "/usr/share/imx500-models/imx500_network_posenet.rpk",

"save_input_tensor":
{
"filename": "/home/pi/posenet_input_tensor.raw",
"num_tensors": 10
},

"temporal_filter":
{
"tolerance": 0.3,
"factor": 0.3,
"visible_frames": 8,
"hidden_frames": 2
}
},

"plot_pose_cv":
{
"confidence_threshold" : 0.2
}
}
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ summary({
'OpenCV postprocessing' : enable_opencv,
'TFLite postprocessing' : enable_tflite,
'Hailo postprocessing' : enable_hailo,
'IMX500 postprocessing' : get_option('enable_imx500'),
},
bool_yn : true, section : 'Build configuration')
10 changes: 10 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ option('download_hailo_models',
type : 'boolean',
value : true,
description : 'Download and install the Hailo postprocessing models')

option('enable_imx500',
type : 'boolean',
value : true,
description : 'Enable IMX500 postprocessing support')

option('download_imx500_models',
type : 'boolean',
value : true,
description : 'Download and install the IMX500 postprocessing models')
Loading

0 comments on commit 5ccbeb0

Please sign in to comment.