Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imx500 support #722

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .github/workflows/gen_orig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,26 @@ jobs:
sudo cp /usr/lib/x86_64-linux-gnu/pkgconfig/{,lib}camera.pc ||:
- name: Check out repository code
uses: actions/checkout@v4
- name: Generate tarball
- name: Generate tarballs
run: |
PATH="${HOME}/.local/bin:${PATH}"
TARBALL="rpicam-apps-${GITHUB_REF_NAME:1}.tar.xz"
meson setup build
meson dist --no-tests --include-subprojects -C build
if ! [ -f "build/meson-dist/$TARBALL" ]; then
echo "Expected tarball not found - $TARBALL"
echo "Does 'version' in meson.build match the tag?"
exit 1
fi
mv "build/meson-dist/$TARBALL" rpicam-apps_${GITHUB_REF_NAME:1}.orig.tar.xz
./utils/download-hailo-models.sh hailo-models
XZ_OPT=-9 tar -cJf hailo-models-${GITHUB_REF_NAME:1}.tar.xz hailo-models
- name: Release tarball
uses: softprops/action-gh-release@v1
XZ_OPT=-9 tar -cJf rpicam-apps_${GITHUB_REF_NAME:1}.orig-hailo-models.tar.xz hailo-models
./utils/download-imx500-models.sh imx500-models
XZ_OPT=-9 tar -cJf rpicam-apps_${GITHUB_REF_NAME:1}.orig-imx500-models.tar.xz imx500-models
- name: Release tarballs
uses: softprops/action-gh-release@v2
with:
files: |
build/meson-dist/*.tar.xz
hailo-models-*.tar.xz
*.tar.xz
- if: failure()
run: cat build/meson-logs/meson-log.txt
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
}
}
2 changes: 1 addition & 1 deletion core/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if fs.is_file(dist_version_file)
version_cmd += fs.read(dist_version_file)
endif

version_cpp = vcs_tag(command : version_cmd,
version_cpp = vcs_tag(command : [version_cmd, meson.project_version()],
replace_string: '@VER@',
input : 'version.cpp.in',
output : 'version.cpp',
Expand Down
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
Loading