AK51
September 20, 2022, 3:52am
1
Hi,
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)…
import cv2
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
AK51
September 20, 2022, 6:14am
4
ok, I found the solution. :>
Good to know this.
Also thanks for the feedback.
Hi,
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
Thanks.
AK51
September 20, 2022, 6:47am
6
Yes, but I need to type it again after reboot…
Hi @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:
#!/usr/bin/env python3
#
# 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
This file has been truncated. show original
AK51
September 21, 2022, 3:19am
9
Thanks, I just tried the saveImage(), it works.
However, there is a longer freeze comparing with cv2.
Anyway, it works now.
Thx
system
Closed
October 12, 2022, 5:24am
11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.