embeded/i.mx 8m plus2025. 8. 22. 16:36

eIQ의 TAO가 먼가 해서 눌렀더니

 

전이학습이 가능한 솔루션이라..

NVIDIA TAO Toolkit은 어떤 솔루션인가요?

AI/머신 러닝 모델을 처음부터 만들려면 엄청난 양의 데이터와 수많은 데이터 과학자가 필요합니다. 하지만 이제는 기존 신경망 모델에서 학습된 기능을 추출하여 새로운 맞춤형 모델에 적용하는 주요 기법인 transfer learning을 통해 모델 개발을 가속할 수 있습니다.

TensorFlow와 PyTorch를 기반으로 하는 NVIDIA TAO Toolkit은 AI/딥 러닝 프레임워크의 복잡성을 없애 모델 훈련 프로세스를 가속하는 NVIDIA TAO 프레임워크의 로코드 버전입니다. TAO Toolkit을 사용하면 AI 전문 지식이나 대규모 훈련 데이터 세트 없이도 전이 학습의 이점을 활용해 자체 데이터로 NVIDIA의 사전 훈련된 모델을 미세 조정하고 추론에 맞춰 최적화할 수 있습니다.

[링크 : https://developer.nvidia.com/ko-kr/tao-toolkit]

'embeded > i.mx 8m plus' 카테고리의 다른 글

eiq 에러들  (0) 2025.08.26
eiq 학습 시도  (0) 2025.08.26
eqi - model tool  (0) 2025.08.22
NNstreamer - tensor*  (0) 2025.08.18
openVX, verisilicon(vivante)  (0) 2025.08.14
Posted by 구차니
embeded/i.mx 8m plus2025. 8. 22. 16:33

facenet 모델열어 보려고 실행했는데

160x160x3 음.. 160x160 사이즈의 RGB 영상을 입력 받고, 128개의 float32형 벡터를 출력하는 모델이다.

 

많이 익숙한 녀석이라 확인해보니, 역시 netron 이었군.

'embeded > i.mx 8m plus' 카테고리의 다른 글

eiq 학습 시도  (0) 2025.08.26
nvidia tao toolkit  (0) 2025.08.22
NNstreamer - tensor*  (0) 2025.08.18
openVX, verisilicon(vivante)  (0) 2025.08.14
gstreamer pipeline / appsink  (0) 2025.08.14
Posted by 구차니
embeded/i.mx 8m plus2025. 8. 18. 15:01

i.mx8의 selfie_segmentrer.py 에서 발췌

        # Set backend and delegates
        if self.backend == "CPU":
            if self.platform == "i.MX8MP":
                backend = "true:CPU custom=NumThreads:4"
            else:
                backend = "true:CPU custom=NumThreads:2"
        else:
            if self.platform == "i.MX8MP":
                os.environ["USE_GPU_INFERENCE"] = "0"
                backend = (
                    "true:npu custom=Delegate:External,ExtDelegateLib:libvx_delegate.so"
                )
            else:
                backend = "true:npu custom=Delegate:External,ExtDelegateLib:libethosu_delegate.so"



                + " ! videoconvert ! video/x-raw,format=RGB ! tensor_converter ! "
                + "tensor_transform mode=arithmetic option=typecast:float32,div:255.0 ! "
                + "tensor_filter framework=tensorflow-lite model="
                + self.tflite_model
                + " accelerator="
                + backend
                + " name=tensor_filter latency=1 ! tensor_sink name=tensor_sink "

 

gsteramer의 엘리먼트를 기본으로 NN에 맞춰서 몇개 추가한 것 같은데

[링크 : https://nnstreamer.github.io/gst/nnstreamer/tensor_converter/README.html]

[링크 : https://nnstreamer.github.io/gst/nnstreamer/tensor_transform/README.html]

[링크 : https://nnstreamer.github.io/gst/nnstreamer/tensor_decoder/README.html]

[링크 : https://nnstreamer.github.io/gst/nnstreamer/tensor_filter/README.html]

[링크 : https://nnstreamer.github.io/gst/nnstreamer/tensor_sink/README.html]

   [링크 : https://nnstreamer.github.io/gst/nnstreamer/elements/gsttensor_sink.html]

 

사용예에서 보면 converter / transform / filter / sink 순으로 쓰는 듯

[CAM] - [videoconvert] - [videoscale] - [tee] -+- [queue] - [videoconvert] - [cairooverlay] - [ximagesink]
                                               +- [queue] - [videoscale] - [tensor_converter] - [tensor_transform] - [tensor_filter] - [tensor_sink]

[링크 : https://nnstreamer.github.io/how-to-run-examples.html]

 

 

+

gst-inspector tensor_converter

더보기
root@imx8mpevk:~# gst-inspect-1.0 tensor_converter
Factory Details:
  Rank                     none (0)
  Long-name                TensorConverter
  Klass                    Converter/Tensor
  Description              Converts an audio, video, text, or arbitrary stream to a tensor stream of C-Array for neural network framework filters
  Author                   MyungJoo Ham <myungjoo.ham@samsung.com></myungjoo.ham@samsung.com>

Plugin Details:
  Name                     nnstreamer
  Description              nnstreamer plugin library
  Filename                 /usr/lib/gstreamer-1.0/libnnstreamer.so
  Version                  2.4.0
  License                  LGPL
  Source module            nnstreamer
  Binary package           nnstreamer
  Origin URL               https://github.com/nnstreamer/nnstreamer

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstTensorConverter

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: { (string)RGB, (string)BGR, (string)RGBx, (string)BGRx, (string)xRGB, (string)xBGR, (string)RGBA, (string)BGRA, (string)ARGB, (string)ABGR, (string)GRAY8, (string)GRAY16_BE, (string)GRAY16_LE }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
         interlace-mode: progressive
      audio/x-raw
                 format: { (string)S8, (string)U8, (string)S16LE, (string)S16BE, (string)U16LE, (string)U16BE, (string)S32LE, (string)S32BE, (string)U32LE, (string)U32BE, (string)F32LE, (string)F32BE, (string)F64LE, (string)F64BE }
                   rate: [ 1, 2147483647 ]
               channels: [ 1, 2147483647 ]
                 layout: interleaved
      text/x-raw
                 format: utf8
      application/octet-stream
      other/tensors
                 format: flexible
              framerate: [ 0/1, 2147483647/1 ]
      application/octet-stream
      other/protobuf-tensor
              framerate: [ 0/1, 2147483647/1 ]
  
  SRC template: 'src'
    Availability: Always
    Capabilities:
      other/tensor
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: { (string)static, (string)flexible }
              framerate: [ 0/1, 2147483647/1 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:

  frames-per-tensor   : The number of frames in output tensor
                        flags: readable, writable
                        Unsigned Integer. Range: 1 - 4294967295 Default: 1 
  
  input-dim           : Input tensor dimension from inner array
                        flags: readable, writable
                        String. Default: ""
  
  input-type          : Type of each element of the input tensor
                        flags: readable, writable
                        String. Default: ""
  
  mode                : Converter mode. e.g., mode=custom-code:. For detail, refer to </registered callback name>https://github.com/nnstreamer/nnstreamer/blob/main/gst/nnstreamer/elements/gsttensor_converter.md#custom-converter
                        flags: readable, writable
                        String. Default: ""
  
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "tensorconverter0"
  
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  
  set-timestamp       : The flag to set timestamp when received a buffer with invalid timestamp
                        flags: readable, writable
                        Boolean. Default: true
  
  silent              : Produce verbose output
                        flags: readable, writable
                        Boolean. Default: true
  
  sub-plugins         : Registrable sub-plugins list
                        flags: readable
                        String. Default: "python3,protobuf"

 

gst-inspector tensor_transform

더보기
root@imx8mpevk:~# gst-inspect-1.0 tensor_transform
Factory Details:
  Rank                     none (0)
  Long-name                TensorTransform
  Klass                    Filter/Tensor
  Description              Transforms other/tensor dimensions for different models or frameworks
  Author                   MyungJoo Ham <myungjoo.ham@samsung.com>

Plugin Details:
  Name                     nnstreamer
  Description              nnstreamer plugin library
  Filename                 /usr/lib/gstreamer-1.0/libnnstreamer.so
  Version                  2.4.0
  License                  LGPL
  Source module            nnstreamer
  Binary package           nnstreamer
  Origin URL               https://github.com/nnstreamer/nnstreamer

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstTensorTransform

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      other/tensor
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: { (string)static, (string)flexible }
              framerate: [ 0/1, 2147483647/1 ]
  
  SRC template: 'src'
    Availability: Always
    Capabilities:
      other/tensor
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: { (string)static, (string)flexible }
              framerate: [ 0/1, 2147483647/1 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:

  acceleration        : Orc acceleration
                        flags: readable, writable
                        Boolean. Default: true
  
  apply               : Select tensors to apply, separated with ',' in case of multiple tensors. Default to apply all tensors.
                        flags: readable, writable
                        String. Default: ""
  
  mode                : Mode used for transforming tensor
                        flags: readable, writable
                        Enum "gtt_mode_type" Default: -1, "unknown"
                           (0): dimchg           - Mode for changing tensor dimensions, option=FROM_DIM:TO_DIM (with a regex, ^([0-9]|1[0-5]):([0-9]|1[0-5])$, where NNS_TENSOR_RANK_LIMIT is 16)
                           (1): typecast         - Mode for casting type of tensor, option=(^[u]?int(8|16|32|64)$|^float(16|32|64)$)
                           (2): arithmetic       - Mode for arithmetic operations with tensor, option=[typecast:TYPE,][per-channel:(false|true@DIM),]add|mul|div:NUMBER[@CH_IDX], ...
                           (3): transpose        - Mode for transposing shape of tensor, option=D1':D2':D3':D4 (fixed to 3)
                           (4): stand            - Mode for statistical standardization of tensor, option=(default|dc-average)[:TYPE][,per-channel:(false|true)]
                           (5): clamp            - Mode for clamping all elements of tensor into the range, option=CLAMP_MIN:CLAMP_MAX
                           (-1): unknown          - Unknown or not-implemented-yet mode
  
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "tensortransform0"
  
  option              : Option for the tensor transform mode ?
                        flags: readable, writable
                        String. Default: null
  
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  
  qos                 : Handle Quality-of-Service events
                        flags: readable, writable
                        Boolean. Default: false
  
  silent              : Produce verbose output ?
                        flags: readable, writable
                        Boolean. Default: true
  
  transpose-rank-limit: The rank limit of transpose, which varies per version of nnstreamer and may be lower than the global rank limit if it is over 4.
                        flags: readable
                        Unsigned Integer. Range: 0 - 16 Default: 4 

 

 

gst-inspector tensor_decoder

더보기
root@imx8mpevk:~# gst-inspect-1.0 tensor_decoder  
Factory Details:
  Rank                     none (0)
  Long-name                TensorDecoder
  Klass                    Converter/Tensor
  Description              Converts tensor stream of C-Array for neural network framework filters to audio or video stream
  Author                   Jijoong Moon <jijoong.moon@samsung.com>

Plugin Details:
  Name                     nnstreamer
  Description              nnstreamer plugin library
  Filename                 /usr/lib/gstreamer-1.0/libnnstreamer.so
  Version                  2.4.0
  License                  LGPL
  Source module            nnstreamer
  Binary package           nnstreamer
  Origin URL               https://github.com/nnstreamer/nnstreamer

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstTensorDecoder

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      other/tensor
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: static
            num_tensors: [ 1, 16 ]
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: flexible
              framerate: [ 0/1, 2147483647/1 ]
  
  SRC template: 'src'
    Availability: Always
    Capabilities:
      ANY

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:

  config-file         : sets config file path which contains plugins properties
                        flags: 
** (gst-inspect-1.0:1706): WARNING **: 05:54:08.872: /usr/src/debug/nnstreamer/2.4.0/gst/nnstreamer/elements/gsttensor_decoder.c:592: invalid property id 13 for "config-file" of type 'GParamString' in 'GstTensorDecoder'
readable, writable
                        String. Default: null
  
  mode                : Decoder mode
                        flags: readable, writable
                        String. Default: ""
  
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "tensordecoder0"
  
  option1             : option for specific decoder modes, 1st one.
                        flags: readable, writable
                        String. Default: null
  
  option2             : option for specific decoder modes, 2nd one.
                        flags: readable, writable
                        String. Default: null
  
  option3             : option for specific decoder modes, 3rd one.
                        flags: readable, writable
                        String. Default: null
  
  option4             : option for specific decoder modes, 4th one.
                        flags: readable, writable
                        String. Default: null
  
  option5             : option for specific decoder modes, 5th one.
                        flags: readable, writable
                        String. Default: null
  
  option6             : option for specific decoder modes, 6th one.
                        flags: readable, writable
                        String. Default: null
  
  option7             : option for specific decoder modes, 7th one.
                        flags: readable, writable
                        String. Default: null
  
  option8             : option for specific decoder modes, 8th one.
                        flags: readable, writable
                        String. Default: null
  
  option9             : option for specific decoder modes, 9th one.
                        flags: readable, writable
                        String. Default: null
  
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  
  qos                 : Handle Quality-of-Service events
                        flags: readable, writable
                        Boolean. Default: false
  
  silent              : Produce verbose output
                        flags: readable, writable
                        Boolean. Default: true
  
  sub-plugins         : Registrable sub-plugins list
                        flags: readable
                        String. Default: "protobuf,direct_video,bounding_boxes,image_segment,python3,octet_stream,pose_estimation,tensor_region,image_labeling"

 

 

gst-inspector tensor_filter

더보기
root@imx8mpevk:~# gst-inspect-1.0 tensor_filter 
Factory Details:
  Rank                     none (0)
  Long-name                TensorFilter
  Klass                    Filter/Tensor
  Description              Handles NN Frameworks (e.g., tensorflow) as Media Filters with other/tensor type stream
  Author                   MyungJoo Ham <myungjoo.ham@samsung.com>

Plugin Details:
  Name                     nnstreamer
  Description              nnstreamer plugin library
  Filename                 /usr/lib/gstreamer-1.0/libnnstreamer.so
  Version                  2.4.0
  License                  LGPL
  Source module            nnstreamer
  Binary package           nnstreamer
  Origin URL               https://github.com/nnstreamer/nnstreamer

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstTensorFilter

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      other/tensor
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: { (string)static, (string)flexible }
              framerate: [ 0/1, 2147483647/1 ]
  
  SRC template: 'src'
    Availability: Always
    Capabilities:
      other/tensor
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: { (string)static, (string)flexible }
              framerate: [ 0/1, 2147483647/1 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:

  accelerator         : Set accelerator for the subplugin with format (true/false):(comma separated ACCELERATOR(s)). true/false determines if accelerator is to be used. list of accelerators determines the backend (ignored with false). Example, if GPU, NPU can be used but not CPU - true:npu,gpu,!cpu. The full list of accelerators can be found in nnstreamer_plugin_api_filter.h. Note that only a few subplugins support this property.
                        flags: readable, writable
                        String. Default: ""
  
  custom              : Custom properties for subplugins ?
                        flags: readable, writable
                        String. Default: ""
  
  framework           : Neural network framework
                        flags: readable, writable
                        String. Default: "auto"
  
  input               : Input tensor dimension from inner array, up to 4 dimensions ?
                        flags: readable, writable
                        String. Default: ""
  
  input-combination   : Select the input tensor(s) to invoke the models
                        flags: readable, writable
                        String. Default: ""
  
  inputlayout         : Set channel first (NCHW) or channel last layout (NHWC) or None for input data. Layout of the data can be any or NHWC or NCHW or none for now. 
                        flags: readable, writable
                        String. Default: ""
  
  inputname           : The Name of Input Tensor
                        flags: readable, writable
                        String. Default: ""
  
  inputranks          : The Rank of the Input Tensor, which is separated with ',' in case of multiple Tensors
                        flags: readable
                        String. Default: ""
  
  inputtype           : Type of each element of the input tensor ?
                        flags: readable, writable
                        String. Default: ""
  
  invoke-dynamic      : Flexible tensors whose memory size changes can be used asinput and output of the tensor filter. With this option, the output caps is always in the format of flexible tensors.
                        flags: readable, writable
                        Boolean. Default: false
  
  is-updatable        : Indicate whether a given model to this tensor filter is updatable in runtime. (e.g., with on-device training)
                        flags: readable, writable
                        Boolean. Default: false
  
  latency             : Turn on performance profiling for the average latency over the recent 10 inferences in microseconds. Currently, this accepts either 0 (OFF) or 1 (ON).
                        flags: readable, writable
                        Integer. Range: 0 - 1 Default: -1 
  
  latency-report      : Report to the pipeline the estimated tensor-filter element latency.
                        flags: readable, writable
                        Boolean. Default: false
  
  model               : File path to the model file. Separated with ',' in case of multiple model files(like caffe2)
                        flags: readable, writable
                        String. Default: ""
  
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "tensorfilter0"
  
  output              : Output tensor dimension from inner array, up to 4 dimensions ?
                        flags: readable, writable
                        String. Default: ""
  
  output-combination  : Select the output tensor(s) from the input tensor(s) and/or model output
                        flags: readable, writable
                        String. Default: ""
  
  outputlayout        : Set channel first (NCHW) or channel last layout (NHWC) or None for output data. Layout of the data can be any or NHWC or NCHW or none for now. 
                        flags: readable, writable
                        String. Default: ""
  
  outputname          : The Name of Output Tensor
                        flags: readable, writable
                        String. Default: ""
  
  outputranks         : The Rank of the Out Tensor, which is separated with ',' in case of multiple Tensors
                        flags: readable
                        String. Default: ""
  
  outputtype          : Type of each element of the output tensor ?
                        flags: readable, writable
                        String. Default: ""
  
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  
  qos                 : Handle Quality-of-Service events
                        flags: readable, writable
                        Boolean. Default: false
  
  shared-tensor-filter-key: Multiple element instances of tensor-filter in a pipeline may share a single resource instance if they share the same framework (subplugin) and neural network model. Designate "shared-tensor-filter-key" to declare and share such instances. If it is NULL, it means the model representations is not shared.
                        flags: readable, writable
                        String. Default: ""
  
  silent              : Produce verbose output
                        flags: readable, writable
                        Boolean. Default: true
  
  sub-plugins         : Registrable sub-plugins list
                        flags: readable
                        String. Default: "custom,custom-easy,cpp,python3,tvm,tensorflow2-lite"
  
  throughput          : Turn on performance profiling for the average throughput in the number of outputs per seconds (i.e., FPS), multiplied by 1000 to represent a floating point using an integer. Currently, this accepts either 0 (OFF) or 1 (ON).
                        flags: readable, writable
                        Integer. Range: 0 - 1 Default: -1 

 

 

gst-inspector tensor_sink

더보기
root@imx8mpevk:~# gst-inspect-1.0 tensor_sink  
Factory Details:
  Rank                     none (0)
  Long-name                TensorSink
  Klass                    Sink/Tensor
  Description              Sink element to handle tensor stream
  Author                   Samsung Electronics Co., Ltd.

Plugin Details:
  Name                     nnstreamer
  Description              nnstreamer plugin library
  Filename                 /usr/lib/gstreamer-1.0/libnnstreamer.so
  Version                  2.4.0
  License                  LGPL
  Source module            nnstreamer
  Binary package           nnstreamer
  Origin URL               https://github.com/nnstreamer/nnstreamer

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSink
                         +----GstTensorSink

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      other/tensor
              framerate: [ 0/1, 2147483647/1 ]
      other/tensors
                 format: { (string)static, (string)flexible, (string)sparse }
              framerate: [ 0/1, 2147483647/1 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'

Element Properties:

  async               : Go asynchronously to PAUSED
                        flags: readable, writable
                        Boolean. Default: true
  
  blocksize           : Size in bytes to pull per buffer (0 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  
  emit-signal         : Emit signal for new data, stream start, eos
                        flags: readable, writable
                        Boolean. Default: true
  
  enable-last-sample  : Enable the last-sample property
                        flags: readable, writable
                        Boolean. Default: true
  
  last-sample         : The last sample received in the sink
                        flags: readable
                        Boxed pointer of type "GstSample"
  
  max-bitrate         : The maximum bits per second to render (0 = disabled)
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  
  max-lateness        : Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited)
                        flags: readable, writable
                        Integer64. Range: -1 - 9223372036854775807 Default: -1 
  
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "tensorsink0"
  
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  
  processing-deadline : Maximum processing time for a buffer in nanoseconds
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 20000000 
  
  qos                 : Generate Quality-of-Service events upstream
                        flags: readable, writable
                        Boolean. Default: true
  
  render-delay        : Additional render delay of the sink in nanoseconds
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  
  signal-rate         : New data signals per second (0 for unlimited, max 500)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 500 Default: 0 
  
  silent              : Produce verbose output
                        flags: readable, writable
                        Boolean. Default: true
  
  stats               : Sink Statistics
                        flags: readable
                        Boxed pointer of type "GstStructure"
                                                        average-rate: 0
                                                             dropped: 0
                                                            rendered: 0

  
  sync                : Sync on the clock
                        flags: readable, writable
                        Boolean. Default: false
  
  throttle-time       : The time to keep between rendered buffers (0 = disabled)
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  
  ts-offset           : Timestamp offset in nanoseconds
                        flags: readable, writable
                        Integer64. Range: -9223372036854775808 - 9223372036854775807 Default: 0 
  

Element Signals:

  "eos" :  void user_function (GstElement * object,
                               gpointer user_data);

  "stream-start" :  void user_function (GstElement * object,
                                        gpointer user_data);

  "new-data" :  void user_function (GstElement * object,
                                    GstBuffer * arg0,
                                    gpointer user_data);

 

'embeded > i.mx 8m plus' 카테고리의 다른 글

nvidia tao toolkit  (0) 2025.08.22
eqi - model tool  (0) 2025.08.22
openVX, verisilicon(vivante)  (0) 2025.08.14
gstreamer pipeline / appsink  (0) 2025.08.14
nxp eiq 우분투 실행 실패  (0) 2025.07.31
Posted by 구차니
embeded/i.mx 8m plus2025. 8. 14. 16:42

영상처리의 가속을 위한 크로스 플랫폼.

Portable, Power-efficient Vision Processing
OpenVX™ is an open, royalty-free standard for cross platform acceleration of computer vision applications. OpenVX enables performance and power-optimized computer vision processing, especially important in embedded and real-time use cases such as face, body and gesture tracking, smart video surveillance, advanced driver assistance systems (ADAS), object and scene reconstruction, augmented reality, visual inspection, robotics and more.

[링크 : https://www.khronos.org/openvx/]

[링크 : https://cho001.tistory.com/224]

 

소스 뒤져보다 보니 so 파일 두개가 보이는데

        if os.path.exists("/usr/lib/libtim-vx.so"):
            backends_available = ["NPU", "CPU"]
            
            ext_delegate = tflite.load_delegate("/usr/lib/libvx_delegate.so")

 

libtim-vx.so는 openVX를 통해 가속받는 VeriSilicon 사의 Tensor Interface Module 을 위한 라이브러리이고

[링크 : https://github.com/VeriSilicon/TIM-VX]

 

libvx_delegate.so 는 openVX 함수를 위한 것인듯 한데..

[링크 : https://github.com/nxp-imx/tflite-vx-delegate-imx]

 

verisilicon 으로 검색하면 vivante NPU IP 를 소유하고 있는 것으로 보인다.

NXP 에서 vivante GPU를 구매해서 GC7000UL을 i.mx8mp에 넣은것 같다.

그러다 보니 gpu / npu를 통일 업체걸로 구매한 듯.

[링크 : https://www.verisilicon.com/en/IPPortfolio/VivanteNPUIP]

'embeded > i.mx 8m plus' 카테고리의 다른 글

eqi - model tool  (0) 2025.08.22
NNstreamer - tensor*  (0) 2025.08.18
gstreamer pipeline / appsink  (0) 2025.08.14
nxp eiq 우분투 실행 실패  (0) 2025.07.31
nxp g2d_blit  (0) 2025.04.01
Posted by 구차니
embeded/i.mx 8m plus2025. 8. 14. 15:07

nxp i.mx8mp 예제를 뜯어 보다가 신기한 걸 발견. 저렇게 해서 성능이 잘 나왔던건가?

            cam_pipeline = cv2.VideoCapture(
                "v4l2src device=" + cam + " ! imxvideoconvert_g2d ! "
                "video/x-raw,format=RGBA,width="
                + str(self.width)
                + ",height="
                + str(self.height)
                + " ! "
                + "videoconvert ! appsink"
            )

        status, org_img = cam_pipeline.read()

[링크 : https://gstreamer.freedesktop.org/documentation/applib/gstappsink.html?gi-language=c]

 


+

i.mx8mp 에서 해보니 비디오 받아오는게 느린게 아니라서 위의 파이프라인을 넣어도 느린건 여전하다.

+

 

cv::VideoCapture::VideoCapture ( const String &  filename, int  apiPreference)

Open video file or a capturing device or a IP video stream for video capturing with API Preference.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
filename it can be:
name of video file (eg. video.avi)
or image sequence (eg. img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...)
or URL of video stream (eg. protocol://host:port/script_name?script_params|auth)
or GStreamer pipeline string in gst-launch tool format in case if GStreamer is used as backend Note that each video stream or IP camera feed has its own URL scheme. Please refer to the documentation of source stream to know the right URL.
apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.

See also
cv::VideoCaptureAPIs

[링크 : https://docs.opencv.org/3.4/d8/dfe/classcv_1_1VideoCapture.html#a949d90b766ba42a6a93fe23a67785951]

 

camSet='v4l2src device=/dev/video0 ! video/x-raw,width=640,height=360 ! nvvidconv flip-method='+str(flip)+' \
        ! video/x-raw(memory:NVMM), format=I420, width=640, height=360 ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert \
        ! video/x-raw, format=BGR enable-max-performance=1 ! appsink '
cam=cv2.VideoCapture(camSet,cv2.CAP_GSTREAMER)

[링크 : https://stackoverflow.com/questions/71816725/streaming-opencv-videocapture-frames-using-gstreamer-in-python-for-webcam]

 

CAP_GSTREAMER 
Python: cv.CAP_GSTREAMER
GStreamer.

[링크 : https://docs.opencv.org/3.4/d4/d15/group__videoio__flags__base.html#gga023786be1ee68a9105bf2e48c700294da38dcac6866f7608675dd35ba0b9c3c07]

 

appsink 예제

[링크 : https://makepluscode.tistory.com/entry/Gstreamer-Python-Appsink-구현하기] python

[링크 : https://ralpioxxcs.github.io/post/gstreamer/1_gst/] cpp

'embeded > i.mx 8m plus' 카테고리의 다른 글

NNstreamer - tensor*  (0) 2025.08.18
openVX, verisilicon(vivante)  (0) 2025.08.14
nxp eiq 우분투 실행 실패  (0) 2025.07.31
nxp g2d_blit  (0) 2025.04.01
sounddevice on arm i.mx8 evk  (0) 2024.05.14
Posted by 구차니
embeded/i.mx 8m plus2025. 7. 31. 17:51

설치하고 실행하는데 패키지가 부족한지 에러가 발생

그런데 에러가 매번 동일한건 함정.. -_-


콘솔 실행

/opt/nxp/eIQ_Toolkit_v1.8.0/bin/eiqenv.sh
/opt/nxp/eIQ_Toolkit_v1.8.0/eiq-portal

[링크 : https://community.nxp.com/t5/eIQ-Machine-Learning-Software/eIQ-Toolkit-Ubuntu-Installation/td-p/1727046]

 

이런 에러가 나서 두 개 패키지 설치해주고 해결되었다.

ubuntu 22.04.5 LTS 기준

 

$ sudo apt-cache search libffi
libffi7 - 외부 함수 인터페이스 라이브러리 런타임

 

libssl이 3.0대로 올라가면서 하위호환 문제가 발생한거로 보임

$ wget https://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb
$ sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb

[링크 : https://stackoverflow.com/questions/72133316/libssl-so-1-1-cannot-open-shared-object-file-no-such-file-or-directory]

 

실행 성공!

 

쓰는법은 이제 봐야함

[링크 : https://docs.nxp.com/bundle/EIQTUG/page/topics/introduction.html]

'embeded > i.mx 8m plus' 카테고리의 다른 글

openVX, verisilicon(vivante)  (0) 2025.08.14
gstreamer pipeline / appsink  (0) 2025.08.14
nxp g2d_blit  (0) 2025.04.01
sounddevice on arm i.mx8 evk  (0) 2024.05.14
NXP i.mx8mp LF_v6.1.55-2.2.0 테스트  (0) 2023.12.21
Posted by 구차니
embeded/i.mx 8m plus2025. 4. 1. 18:28

하.. 성능 땜시 blit 함수 찾았는데

nxp 의 i.mx6 및 imx8 에서도 사용이 가능한 라이브러리가 존재한다.

그나저나 i.mx9이 imx8quad max 보다는 떨어지고 나머지 i.mx8 시리즈 보단 나은 신기한 구성이다.

[링크 : https://www.nxp.com/docs/en/user-guide/IMX_GRAPHICS_USERS_GUIDE.pdf]

 

원하던 함수는 바로 이것. 그런데 user guide지 application note 가 아니라 함수만 설명하고 상세 인자 설명은 없는 상황..

[링크 : https://www.nxp.com/docs/en/user-guide/IMX_GRAPHICS_USERS_GUIDE.pdf]

 

뒤지면 나오긴 한데.. 크흡..

[링크 : https://github.com/nxp-imx/g2d-samples]

    [링크 : https://github.com/nxp-imx/g2d-samples/blob/imx_2.3/multiblit_test/g2d_multiblit.c]

[링크 : https://community.nxp.com/t5/i-MX-Processors/g2d-alloc-alloc-memory-fail-with-size-6220800/m-p/451245]

 

Posted by 구차니
embeded/i.mx 8m plus2024. 5. 14. 15:45

fail!!

portaudio는 라이브러리 같은데

반대로.. 리눅스 시스템에서 지원하고 있는 오디오 시스템이 어떻게 되는지 확인하는 방법을 찾아 봐야 할 듯.

 

root@imx8mpevk:~# python3 tone.py 
Traceback (most recent call last):
  File "/home/root/tone.py", line 2, in <module>
    import sounddevice as sd
  File "/usr/lib/python3.11/site-packages/sounddevice.py", line 71, in <module>
    raise OSError('PortAudio library not found')
OSError: PortAudio library not found

 

라즈베리에서는 portaudio를 지원하나 본데 i.mx8 보드에서는 apt로도 설치가 안되는데

귀찮으니(?) 라이브러리 빌드해서 넣어봐야 하나?

sudo apt-get install libportaudio2
sudo apt-get install libasound2-dev

[링크 : https://park-duck.tistory.com/entry/portAudio-library-not-found-에러-해결]

'embeded > i.mx 8m plus' 카테고리의 다른 글

nxp eiq 우분투 실행 실패  (0) 2025.07.31
nxp g2d_blit  (0) 2025.04.01
NXP i.mx8mp LF_v6.1.55-2.2.0 테스트  (0) 2023.12.21
missed: not vectorized: relevant stmt not supported:  (0) 2023.08.31
nxp i.mx8mp win iot part 2  (0) 2023.05.26
Posted by 구차니
embeded/i.mx 8m plus2023. 12. 21. 15:51

i.MX Machine Learning User's Guide에 있는거 테스트 해봄

The behavior is as follows:
• If USE_GPU_INFERENCE=1, the graph is executed on the GPU
• Otherwise, the graph is executed on the NPU (if available)
By default, the NPU is used for OpenVX graph execution.

 

전체 실행시간으로는 neon 이 가장 빨랐고, inference 시간으로는 NPU가 가장 빨랐다.

의외로 GPU 가속이 NEON만도 못하다는 충격적인(!) 결과가..

root@imx8mpevk:/usr/bin/tensorflow-lite-2.12.1/examples# time ./label_image 
INFO: Loaded model ./mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
INFO: invoked
INFO: average time: 41.16 ms
INFO: 0.764706: 653 military uniform
INFO: 0.121569: 907 Windsor tie
INFO: 0.0156863: 458 bow tie
INFO: 0.0117647: 466 bulletproof vest
INFO: 0.00784314: 835 suit

real    0m0.173s
user    0m0.520s
sys     0m0.024s
root@imx8mpevk:/usr/bin/tensorflow-lite-2.12.1/examples# time USE_GPU_INFERENCE=0 ./label_image --external_delegate_path=/usr/lib/libvx_delegate.so
INFO: Loaded model ./mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
Vx delegate: allowed_cache_mode set to 0.
Vx delegate: device num set to 0.
Vx delegate: allowed_builtin_code set to 0.
Vx delegate: error_during_init set to 0.
Vx delegate: error_during_prepare set to 0.
Vx delegate: error_during_invoke set to 0.
EXTERNAL delegate created.
INFO: Applied EXTERNAL delegate.
W [HandleLayoutInfer:291]Op 162: default layout inference pass.
INFO: invoked
INFO: average time: 2.861 ms
INFO: 0.768627: 653 military uniform
INFO: 0.105882: 907 Windsor tie
INFO: 0.0196078: 458 bow tie
INFO: 0.0117647: 466 bulletproof vest
INFO: 0.00784314: 835 suit

real    0m3.116s
user    0m2.916s
sys     0m0.195s
root@imx8mpevk:/usr/bin/tensorflow-lite-2.12.1/examples# time USE_GPU_INFERENCE=1 ./label_image --external_delegate_path=/usr/lib/libvx_delegate.so
INFO: Loaded model ./mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
Vx delegate: allowed_cache_mode set to 0.
Vx delegate: device num set to 0.
Vx delegate: allowed_builtin_code set to 0.
Vx delegate: error_during_init set to 0.
Vx delegate: error_during_prepare set to 0.
Vx delegate: error_during_invoke set to 0.
EXTERNAL delegate created.
INFO: Applied EXTERNAL delegate.
W [query_hardware_caps:89]Unsupported evis version
W [HandleLayoutInfer:291]Op 162: default layout inference pass.
INFO: invoked
INFO: average time: 171.261 ms
INFO: 0.784314: 653 military uniform
INFO: 0.105882: 907 Windsor tie
INFO: 0.0156863: 458 bow tie
INFO: 0.00784314: 466 bulletproof vest
INFO: 0.00392157: 835 suit

real    0m1.992s
user    0m1.377s
sys     0m0.103s

'embeded > i.mx 8m plus' 카테고리의 다른 글

nxp g2d_blit  (0) 2025.04.01
sounddevice on arm i.mx8 evk  (0) 2024.05.14
missed: not vectorized: relevant stmt not supported:  (0) 2023.08.31
nxp i.mx8mp win iot part 2  (0) 2023.05.26
nxp i.mx8mp win iot  (0) 2023.05.26
Posted by 구차니
embeded/i.mx 8m plus2023. 8. 31. 10:33

cortex-a53 에서 neon 으로 실수 나누기를 하는데

이상하게 적용이 안되서 확인중

 

소스는 아래 한줄인데 stdev_val은 앞서 단계에서 계산한 변수라 그런가

scope 문제로 인해서 안될 것 같진 않은데

int tempval = (int)((value - abs_avg) / (int)stdev_val);

 

아무튼 에러는 아래와 같이. 332 라인은 for() 337은 위의 소스인데

modules/m7_adc.c:332:27: missed: couldn't vectorize loop
modules/m7_adc.c:337:11: missed: not vectorized: relevant stmt not supported: tempval_168 = _73 / stdev_val_162;

 

얘 되고

int tempval = (int)((double)(value - abs_avg) / (double)stdev_val);

 

얘도 된다.

int tempval = (int)((value - abs_avg) / (double)stdev_val);

 

나누기 연산에서 피 연산자가 int 형이면 안되고, double 형이면 된다라..

아래 문서를 참조해도 딱히 divide 연산자에 대한 이야기는 없고

cortex-a53이라면.. cortex-a9도 아니고.. hardware divider가 없을리도 없을 것 같은데.

아무튼.. 의외의 점이라면 예제코드 중에 곱셈은 있어도 나눗셈은 없다. (에이 설마..)

[링크 : https://gcc.gnu.org/projects/tree-ssa/vectorization.html]

'embeded > i.mx 8m plus' 카테고리의 다른 글

sounddevice on arm i.mx8 evk  (0) 2024.05.14
NXP i.mx8mp LF_v6.1.55-2.2.0 테스트  (0) 2023.12.21
nxp i.mx8mp win iot part 2  (0) 2023.05.26
nxp i.mx8mp win iot  (0) 2023.05.26
rpmsg-lite  (0) 2023.03.23
Posted by 구차니