# Nvinferaudio custom model

**URL:** <https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788>\
**Category:** DeepStream SDK\
**Created:** [April 10, 2022, 7:58pm UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788 "2022-04-10T19:58:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![user163329](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user163329](https://forums.developer.nvidia.com/u/user163329)\
**Post date:** [April 10, 2022, 7:58pm UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/1 "2022-04-10T19:58:30Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)** Jetson Nano  
**• DeepStream Version** 6.01  
**• JetPack Version (valid for Jetson only)** 4.61  
**• TensorRT Version** 8.01  
**• NVIDIA GPU Driver Version (valid for GPU only)** 470  
**• Issue Type( questions, new requirements, bugs)** Question  
**• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)**  
**• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)**

Good evening

I am trying to incorporate a custom audio classifier into nvinferaudio in Deepstream. While I understand from the documentation that the model itself works on a mel spectogram I am trying to understand the input tensor from sonyc\_audio\_classify.onnx which I see is type: `float32[batch_size,1,635,128]` I am trying relate this to the audio-transform parameter and from what I can see the 128 is the number of mel bins. It would be helpful to have an example frame of input data.

Is this format the standard processing of the nvinveraudio block or is has some input customization been done. Alternatively where can I find the definition of the SONYC classifier to compare against my model and make adjustments.

Any help would be appreciated

---

<div class="post-metadata">

**Author:** ![user163329](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user163329](https://forums.developer.nvidia.com/u/user163329)\
**Post date:** [April 11, 2022, 1:00pm UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/3 "2022-04-11T13:00:50Z")

</div>

Any advice?

---

<div class="post-metadata">

**Author:** ![fanzh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fanzh/32/115955_2.png) [@fanzh](https://forums.developer.nvidia.com/u/fanzh)\
**Post date:** [April 12, 2022, 8:52am UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/4 "2022-04-12T08:52:22Z")

</div>

1 The Gst-nvinferaudio plugin performs transform (log mel spectogram), on the input frame based on `audio-transform` property setting, please refer to [Gst-nvinferaudio — DeepStream 6.1.1 Release documentation](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinferaudio.html)  
2 please refer to demo app deeptream-audio in /opt/nvidia/deepstream/deepstream/sources/apps/sample\_apps/.

---

<div class="post-metadata">

**Author:** ![user163329](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user163329](https://forums.developer.nvidia.com/u/user163329)\
**Post date:** [April 13, 2022, 7:32am UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/5 "2022-04-13T07:32:00Z")

</div>

Hi fanzh

Thanks I have gone through that, it would be helpful to know about the SONYC model used, is that available as it does not seem to be a standard well known model unless I cant find it. I do find the SONYC dataset and the journal article that does talk about a very basic classifier.

Or alternatively what does the tensor represent for example with images the input tensor is NCHW what is the equivalent definition for audio. Am I right so say [batch\_size, audio\_channels (1), data points (635), mel\_bins(128)]?

---

<div class="post-metadata">

**Author:** ![user163329](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user163329](https://forums.developer.nvidia.com/u/user163329)\
**Post date:** [April 14, 2022, 10:48am UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/6 "2022-04-14T10:48:27Z")

</div>

Hi fanzh I didnt reply directly to your post. Where is the best place to request this info?

---

<div class="post-metadata">

**Author:** ![fanzh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fanzh/32/115955_2.png) [@fanzh](https://forums.developer.nvidia.com/u/fanzh)\
**Post date:** [April 15, 2022, 2:01am UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/7 "2022-04-15T02:01:29Z")

</div>

please refer to deepstream-audio 's config file, here are some important parameters, and you can get description in documentation above.  
audio-transform=melsdb,fft\_length=2560,hop\_size=692,dsp\_window=hann,num\_mels=128,sample\_rate=44100,p2db\_ref=(float)1.0,p2db\_min\_power=(float)0.0,p2db\_top\_db=(float)80.0

---

<div class="post-metadata">

**Author:** ![user163329](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@user163329](https://forums.developer.nvidia.com/u/user163329)\
**Post date:** [April 17, 2022, 12:11am UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/8 "2022-04-17T00:11:10Z")

</div>

Thanks I have got it working now by the looks of it

I am getting another error though

0:00:08.963285580 11141 0xbd13680 WARN nvinferaudio gstnvinferaudio.cpp:578:gst\_nvinferaudio\_process\_input:\<audio\_classifier\> error: Failed buffering twice  
ERROR from audio\_classifier: Failed buffering twice

I’ll post another thread for that

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [May 10, 2022, 2:41am UTC](https://forums.developer.nvidia.com/t/nvinferaudio-custom-model/210788/10 "2022-05-10T02:41:48Z")

</div>

Closed on May 10, 2022, 2:41am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
