In the dusty-nv inference, can the python program trigger a save jpg function? Thx
My program uses dusty-nv inference to check the webcam, if there is anything interesting, save the picture in jpg.
Nano 4G works when I use cudeToNumpy and then, use cv2 function to save the jpg.
However, as I can only buy nano 2G these days, when I import cv2, it is out of memory (even if I have increased the swap memory)…
ImportError: /usr/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block
May I know how to save the jpg without using cv2? Thx
ok, I found the solution. :>
Good to know this.
Also thanks for the feedback.
Just want to confirm again.
Is this issue fixed by exporting the following variable?
$ export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1
Yes, but I need to type it again after reboot…
@AK51, you could at it to your user’s
~/.bashrc file so that it gets set for you after reboot.
Also, you can use
jetson.utils.saveImage() to save images to disk without needing cv2. Here’s an example which saves snapshots of detected objects:
This file has been truncated.
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Thanks, I just tried the saveImage(), it works.
However, there is a longer freeze comparing with cv2.
Anyway, it works now.