"samplerate, data = wavfile.read('./7061-6-0-0.wav')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "computational-europe",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:absl:Lingvo does not support eager execution yet. Please disable eager execution with tf.compat.v1.disable_eager_execution() or proceed at your own risk.\n"
]
}
],
"source": [
"import leaf_audio.frontend as frontend\n",
"\n",
"leaf = frontend.Leaf()\n",
"melfbanks = frontend.MelFilterbanks()\n",
"tfbanks = frontend.TimeDomainFilterbanks()\n",
"sincnet = frontend.SincNet()\n",
"sincnet_plus = frontend.SincNetPlus()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "disciplinary-brain",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"numpy.ndarray"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(data)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "compound-diesel",
"metadata": {},
"outputs": [],
"source": [
"data = data.astype('float')"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "sustained-default",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dtype('float64')"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.dtype"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "developmental-lounge",
"metadata": {},
"outputs": [],
"source": [
"leaf_representation = leaf(data)\n",
"melfbanks_representation = melfbanks(data)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "fuzzy-helmet",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensorflow.python.framework.ops.EagerTensor"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(melfbanks_representation)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "funny-emperor",
"metadata": {},
"outputs": [],
"source": [
"leaf_representation\n",
"t= melfbanks_representation.numpy"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "raising-stephen",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bound method _EagerTensorBase.numpy of <tf.Tensor: shape=(99225, 1, 40), dtype=float32, numpy=\n",
WARNING:absl:Lingvo does not support eager execution yet. Please disable eager execution with tf.compat.v1.disable_eager_execution() or proceed at your own risk.
%% Cell type:code id:disciplinary-brain tags:
``` python
type(data)
```
%%%% Output: execute_result
numpy.ndarray
%% Cell type:code id:compound-diesel tags:
``` python
data=data.astype('float')
```
%% Cell type:code id:sustained-default tags:
``` python
data.dtype
```
%%%% Output: execute_result
dtype('float64')
%% Cell type:code id:developmental-lounge tags:
``` python
leaf_representation=leaf(data)
melfbanks_representation=melfbanks(data)
```
%% Cell type:code id:fuzzy-helmet tags:
``` python
type(melfbanks_representation)
```
%%%% Output: execute_result
tensorflow.python.framework.ops.EagerTensor
%% Cell type:code id:funny-emperor tags:
``` python
leaf_representation
t=melfbanks_representation.numpy
```
%% Cell type:code id:raising-stephen tags:
``` python
t
```
%%%% Output: execute_result
<bound method _EagerTensorBase.numpy of <tf.Tensor: shape=(99225, 1, 40), dtype=float32, numpy=