embeded/jetson2022. 3. 29. 16:02

 

[링크 : https://github.com/NVIDIA-AI-IOT/deepstream_python_apps]

[링크 : https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/apps/deepstream-ssd-parser]

 

 

----

tritonserver for jetson (build)

[링크 : https://github.com/triton-inference-server/server/blob/main/docs/jetson.md]

 

+

[ 50%] Building CXX object CMakeFiles/triton-core.dir/backend_model_instance.cc.o
In file included from /home/jetson/work/server/build/_deps/repo-core-src/src/backend_model_instance.cc:37:0:
/home/jetson/work/server/build/_deps/repo-core-src/src/metrics.h:40:10: fatal error: dcgm_agent.h: No such file or directory
 #include <dcgm_agent.h>
          ^~~~~~~~~~~~~~
compilation terminated.

[링크 : https://github.com/NVIDIA/gpu-monitoring-tools/tree/master/bindings/go/dcgm]

  [링크 : https://github.com/NVIDIA/gpu-monitoring-tools]

 

pytorch 다운로드 경로

[링크 : https://jstar0525.tistory.com/171]

 

Known Issues
Triton PIP wheels for ARM SBSA are not available from PyPI and pip will install an incorrect Jetson version of Triton for ARM SBSA. The correct wheel file can be pulled directly from the ARM SBSA SDK image and manually installed.

[링크 : https://github.com/triton-inference-server/server/releases]

 

$ sudo docker pull nvcr.io/nvidia/tritonserver:21.11-py3-sdk

[링크 : https://zhuanlan.zhihu.com/p/471291236]

'embeded > jetson' 카테고리의 다른 글

jetson nano 부팅이 안됨  (0) 2022.04.06
deepstream triton server  (0) 2022.03.30
deepstream onnx part.2  (0) 2022.03.29
jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
Posted by 구차니
embeded/jetson2022. 3. 29. 11:32

생각해보니 deepstream onnx  github프로젝트의 경우

tiny_yolov2를 기반으로 작동하도록 libnvdsinfer_custom_bbox_tiny_yolo.so 를 생성했으니

ssd 와는 구조가 달라 당연히(?) 맞지 않으니 에러가 발생하고 죽는 듯.

[링크 : https://github.com/thatbrguy/Deep-Stream-ONNX]

 

ERROR: [TRT]: 2: [pluginV2DynamicExtRunner.cpp::execute::115] Error Code 2: Internal Error (Assertion status == kSTATUS_SUCCESS failed.)
ERROR: Build engine failed from config file
ERROR: failed to build trt engine.
0:08:17.537206102  9070     0x3f617730 ERROR                nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1934> [UID = 1]: build engine file failed
0:08:17.545680634  9070     0x3f617730 ERROR                nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2020> [UID = 1]: build backend context failed
0:08:17.545766053  9070     0x3f617730 ERROR                nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1257> [UID = 1]: generate backend failed, check config file settings
0:08:17.546456543  9070     0x3f617730 WARN                 nvinfer gstnvinfer.cpp:841:gst_nvinfer_start:<primary_gie> error: Failed to create NvDsInferContext instance
0:08:17.546521285  9070     0x3f617730 WARN                 nvinfer gstnvinfer.cpp:841:gst_nvinfer_start:<primary_gie> error: Config file path: /home/jetson/work/Deep-Stream-ONNX/config/config_infer_custom_yolo.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED
** ERROR: <main:658>: Failed to set pipeline to PAUSED

 

azure의 custom vision 의 README에 기재된 링크를 가보았는데

[링크 : https://github.com/Azure-Samples/customvision-export-samples]

 

onnx 포맷으로는 python과 c#만 제공하고

해당 사이트에서 python을 받아서 실행해보니 하나의 사진에 대해서 처리가 가능한 예제를 제공한다.

[링크 : https://github.com/Azure-Samples/customvision-export-samples/tree/main/samples/python/onnx]

[링크 : https://github.com/Azure-Samples/customvision-export-samples/tree/main/samples/csharp/onnx]

 

 

+

ssd deepstream 예제가 있는데

python 스크립트에 h264 elementary stream을 넣어주어야 한댄다

[링크 : https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/apps/deepstream-ssd-parser]

 

-h h264가 포인트 인 듯.

$ ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -vcodec libx264 -f h264 test.264

[링크 : https://stackoverflow.com/questions/27090114/what-does-elementary-stream-mean-in-terms-of-h264]

 

JVT NAL sequence, H.264 라는 타입으로 변경된 듯.

sample_0.h264: JVT NAL sequence, H.264 video @ L 31
sample_0.mp4:  ISO Media, MP4 v2 [ISO 14496-14]

 

Joint Video Team (JVT)
NAL: Network Abstraction Layer

[링크 : http://iphome.hhi.de/suehring/tml/JM%20Reference%20Software%20Manual%20(JVT-AE010).pdf]

 

+

sample_ssd_relu6.uff 파일은 ssd inception v2 기반 모델인가?

[링크 :  https://eva-support.adlinktech.com/docs/ssdnbspinception-v2-nbsp-nbsp-nbsp-nbspnbsp]

'embeded > jetson' 카테고리의 다른 글

deepstream triton server  (0) 2022.03.30
deepstream part.3  (0) 2022.03.29
jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
azure custom vision - precision, recall  (0) 2022.03.28
Posted by 구차니
embeded/jetson2022. 3. 29. 11:27

'embeded > jetson' 카테고리의 다른 글

deepstream part.3  (0) 2022.03.29
deepstream onnx part.2  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
azure custom vision - precision, recall  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
Posted by 구차니
embeded/jetson2022. 3. 28. 17:03

 

[링크 : https://towardsdatascience.com/how-to-deploy-onnx-models-on-nvidia-jetson-nano-using-deepstream-b2872b99a031]

git clone https://github.com/thatbrguy/Deep-Stream-ONNX.git
cd Deep-Stream-ONNX

wget https://github.com/onnx/models/blob/main/vision/object_detection_segmentation/tiny-yolov2/model/tinyyolov2-8.tar.gz
wget https://github.com/onnx/models/blob/main/vision/object_detection_segmentation/tiny-yolov2/model/tinyyolov2-8.tar.gz
# 구글 드라이브 다운로드

tar -xvf sample.tar.gz
tar -xvf tinyyolov2-7.tar.gz
cp tiny_yolov2/Model.onnx tiny_yolov2.onnx

cd custom_bbox_parser/
$ git diff
diff --git a/custom_bbox_parser/Makefile b/custom_bbox_parser/Makefile
index 5bab5a4..b764725 100644
--- a/custom_bbox_parser/Makefile
+++ b/custom_bbox_parser/Makefile
@@ -1,7 +1,8 @@
 CUDA_VER:=10
 SRCFILES:=nvdsparsebbox_tiny_yolo.cpp
 TARGET_LIB:=libnvdsinfer_custom_bbox_tiny_yolo.so
-DEEPSTREAM_PATH:=/home/nano/deepstream_sdk_v4.0_jetson
+#DEEPSTREAM_PATH:=/home/nano/deepstream_sdk_v4.0_jetson
+DEEPSTREAM_PATH:=/opt/nvidia/deepstream/deepstream-6.0

 ifeq ($(CUDA_VER),)
   $(error "CUDA_VER is not set")
diff --git a/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp b/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp
index c6251e5..0825e68 100644
--- a/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp
+++ b/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp
@@ -432,7 +432,7 @@ extern "C" bool NvDsInferParseCustomYoloV2Tiny(

     // Obtaining the output layer.
     const NvDsInferLayerInfo &layer = outputLayersInfo[0];
-    assert (layer.dims.numDims == 3);
+    assert (layer.inferDims.numDims == 3);

     // Decoding the output tensor of TinyYOLOv2 to the NvDsInferParseObjectInfo format.
     std::vector<NvDsInferParseObjectInfo> objects =

 

[링크 : https://github.com/thatbrguy/Deep-Stream-ONNX]

 

 

 *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8554/ds-test ***

Opening in BLOCKING MODE
Opening in BLOCKING MODE

Using winsys: x11
WARNING: [TRT]: Detected invalid timing cache, setup a local cache instead
INFO: [Implicit Engine Info]: layers num: 2
0   INPUT  kFLOAT image           3x416x416
1   OUTPUT kFLOAT grid            125x13x13


Runtime commands:
        h: Print this help
        q: Quit

        p: Pause
        r: Resume

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
      To go back to the tiled display, right-click anywhere on the window.


**PERF:  FPS 0 (Avg)    FPS 1 (Avg)     FPS 2 (Avg)     FPS 3 (Avg)
**PERF:  0.00 (0.00)    0.00 (0.00)     0.00 (0.00)     0.00 (0.00)
** INFO: <bus_callback:194>: Pipeline ready

Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
** INFO: <bus_callback:180>: Pipeline running



-------------------------------
0:00:00.369440298  8235     0x31571330 WARN                 nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1161> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5
ERROR: Deserialize engine failed because file path: /home/jetson/work/Deep-Stream-ONNX/config/../tiny_yolov2.onnx_b1_fp16.engine open error
0:00:01.781999412  8235     0x31571330 WARN                 nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1889> [UID = 1]: deserialize engine from file :/home/jetson/work/Deep-Stream-ONNX/config/../tiny_yolov2.onnx_b1_fp16.engine failed
0:00:01.782126640  8235     0x31571330 WARN                 nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1996> [UID = 1]: deserialize backend context from engine from file :/home/jetson/work/Deep-Stream-ONNX/config/../tiny_yolov2.onnx_b1_fp16.engine failed, try rebuild
0:00:01.782165021  8235     0x31571330 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
0:01:43.015792426  8235     0x31571330 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1947> [UID = 1]: serialize cuda engine to file: /home/jetson/work/Deep-Stream-ONNX/tiny_yolov2.onnx_b1_gpu0_fp16.engine successfully
0:01:43.196589822  8235     0x31571330 INFO                 nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/home/jetson/work/Deep-Stream-ONNX/config/config_infer_custom_yolo.txt sucessfully
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 4
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0
H264: Profile = 66, Level = 0
NVMEDIA_ENC: bBlitMode is set to TRUE
NVMEDIA_ENC: bBlitMode is set to TRUE
 

'embeded > jetson' 카테고리의 다른 글

deepstream onnx part.2  (0) 2022.03.29
jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
azure custom vision - precision, recall  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
jetson nano deepstream  (0) 2022.02.10
Posted by 구차니
embeded/jetson2022. 3. 28. 15:59

ms azure의 custon vision 서비스(?)를 이용해서 학습을 시도하는데

"하나의 태그당 15개 이상의 이미지 필요" 라는 제약조건이 걸려있다.

 

학습 시간에 따라서도 다르게 나오긴 한데

4시간 학습 걸어놨는데 1시간 조금 넘어서 멈춘걸 보면

학습치가 수렴하면 자동 종료하게 해둔 듯 한다.

 

 

 

 

 

precision이야 정확도일 것 같고, recall 번역이 안되네 -_ㅠ

"옳을 것으로 예상되어진 모든 태그들 중에 올바르게 찾은 퍼센트"

 

precision은 결과값에 대한 true가 true 인 조건

recall은 원본 데이터의 true에 대한 결과의 true가 true인 조건

 

+

Recall이 낮아졌다가 다시 높아졌는데 어느게 좋은건가 찾아보니 Precision과 Recall도 둘다 높은게 좋은거라고

[링크 : https://sumniya.tistory.com/26]

 

다운로드 받으면 metadata_properties.json 파일이 존재하는데 (tflite, onnx, onnx float16 확인)

학습시 별다른 옵션이 없던걸 봐서는 azure custom vision은 SSD 알고리즘만 지원하는 듯.

{
    "CustomVision.Metadata.AdditionalModelInfo": "",
    "CustomVision.Metadata.Version": "1.2",
    "CustomVision.Postprocess.Method": "SSD",
    "CustomVision.Postprocess.Yolo.Biases": "[]",
    "CustomVision.Postprocess.Yolo.NmsThreshold": "0.0",
    "CustomVision.Preprocess.CropHeight": "0",
    "CustomVision.Preprocess.CropMethod": "NoCrop",
    "CustomVision.Preprocess.CropWidth": "0",
    "CustomVision.Preprocess.MaxDimension": "0",
    "CustomVision.Preprocess.MaxScale": "0.0",
    "CustomVision.Preprocess.MinDimension": "0",
    "CustomVision.Preprocess.MinScale": "0.0",
    "CustomVision.Preprocess.NormalizeMean": "[0.0, 0.0, 0.0]",
    "CustomVision.Preprocess.NormalizeStd": "[1.0, 1.0, 1.0]",
    "CustomVision.Preprocess.ResizeMethod": "Stretch",
    "CustomVision.Preprocess.TargetHeight": "320",
    "CustomVision.Preprocess.TargetWidth": "320",
    "Image.BitmapPixelFormat": "Rgb8",
    "Image.ColorSpaceGamma": "SRGB",
    "Image.NominalPixelRange": "Normalized_0_1"
}

 

'embeded > jetson' 카테고리의 다른 글

jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
jetson nano deepstream  (0) 2022.02.10
jetson nano developer board(구형) 부팅 문제  (0) 2022.02.09
Posted by 구차니
embeded/jetson2022. 3. 28. 15:02

nvidia jetson nano 4GB

 

--- 과거 아키이빙 이미지 끌어옴

nvidia ion

[링크 : https://minimonk.tistory.com/4579]

 

8800GT 혹은 8600GT 추정

[링크 : https://minimonk.tistory.com/2116]

'embeded > jetson' 카테고리의 다른 글

deepstream onnx  (0) 2022.03.28
azure custom vision - precision, recall  (0) 2022.03.28
jetson nano deepstream  (0) 2022.02.10
jetson nano developer board(구형) 부팅 문제  (0) 2022.02.09
nvidia jetson nano 2gb / csi  (0) 2022.01.21
Posted by 구차니
embeded/raspberry pi2022. 3. 18. 23:42

이거 하나 찾으려고 개고생중

일단 wheezy 에 있다고 하는데

jessie 이미지 받아서 해보니 라즈베리 3는 작동 안되고 2에서는 울프람과 마인크래프트가 존재하는 것 확인

 

bullseye 32bit나 64bit에는 당연히(!) 없네 

'embeded > raspberry pi' 카테고리의 다른 글

linux iio adc + rpi  (0) 2022.06.20
PI 400 써봄  (0) 2022.05.25
rpi opencv python pid servo  (0) 2022.03.08
rpi i2c oled  (0) 2022.02.10
라즈베리 파이 부품 도착  (0) 2022.02.09
Posted by 구차니
embeded/raspberry pi2022. 3. 8. 19:35

이건 어디다 넣어야 하나 -_-?

영상을 통해서 중앙으로 이동시키는건 서보를 이용해서

한번에 못가면 점진적으로 오류를 보정하면서 가면되는거고

그걸 PID를 통해 보정을 해주면 되는데 보정 주기라던가..

새로운 위치값을 어떤식으로 주면 될지 몰라서 검색.

 

[링크 : https://pyimagesearch.com/2019/04/01/pan-tilt-face-tracking-with-a-raspberry-pi-and-opencv/]

 

'embeded > raspberry pi' 카테고리의 다른 글

PI 400 써봄  (0) 2022.05.25
라즈베리 파이2 / 마인크래프트  (0) 2022.03.18
rpi i2c oled  (0) 2022.02.10
라즈베리 파이 부품 도착  (0) 2022.02.09
rpi csi to dsi...  (0) 2022.01.21
Posted by 구차니
embeded/jetson2022. 2. 10. 11:27

jetson nano developer (4GB 모델)로 해서 그런지

xavier nx에서 할때랑 비교하면 초기 구동 시간이 어마어마하게 오래 걸린다.

 

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Quickstart.html] 빠른 실행

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/] 목차

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_ref_app_deepstream.html]

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Zero_Coding_Sample_Graphs.html#deepstream-app]

'embeded > jetson' 카테고리의 다른 글

azure custom vision - precision, recall  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
jetson nano developer board(구형) 부팅 문제  (0) 2022.02.09
nvidia jetson nano 2gb / csi  (0) 2022.01.21
jetson nano gpu 사용 상태 확인  (0) 2022.01.20
Posted by 구차니
embeded/raspberry pi2022. 2. 10. 10:45

동일한 녀석인듯? 일단 시도 해봐야 겠다.

 

[링크 : https://rudalskim.tistory.com/109]

 

+

일단 사용한 라이브러리는 deprecated 이고

[링크 : https://github.com/adafruit/Adafruit_Python_SSD1306]

 

이미지를 출력하도록 해놔서 python의 image 라이브러리를 이용하여 text도 그려서 출력하는 듯.

[링크 : https://github.com/adafruit/Adafruit_Python_SSD1306/blob/master/examples/animate.py]

 

+

하라는 대로 해서 하니 나오긴 한데, 해당 라이브러리에서 이미지 말고 텍스트를 출력 할 수 있는진 좀 봐야 할 듯.

import time 
import Adafruit_GPIO.SPI as SPI 
import Adafruit_SSD1306 
from PIL import Image

RST = 25
DC = 24
SPI_PORT = 0
SPI_DEVICE = 0

disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST)
disp.begin()
disp.clear()
disp.display()

image = Image.open('test.png').resize((disp.width, disp.height), Image.ANTIALIAS).convert('1')
disp.image(image)
disp.display()

 

테스트 용으로 대충 128x64 사이즈로 만든 png 파일

 

아래와 같이 잘 나온다.

 

다만 OLED 라고 해도 리프레시는 존재하는지(당연한건가...?)

셔터속도에 따라 비어보이는 경우가 존재한다.

'embeded > raspberry pi' 카테고리의 다른 글

라즈베리 파이2 / 마인크래프트  (0) 2022.03.18
rpi opencv python pid servo  (0) 2022.03.08
라즈베리 파이 부품 도착  (0) 2022.02.09
rpi csi to dsi...  (0) 2022.01.21
rpi 7" dsi  (0) 2022.01.21
Posted by 구차니