Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
Vocal Repertoire Embedder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Best
Vocal Repertoire Embedder
Commits
07a00170
Commit
07a00170
authored
2 years ago
by
Paul Best
Browse files
Options
Downloads
Patches
Plain Diff
update readmes
parent
0aeeca5d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
new_specie/README.md
+1
-1
1 addition, 1 deletion
new_specie/README.md
new_specie/print_annot.py
+55
-0
55 additions, 0 deletions
new_specie/print_annot.py
paper_experiments/README.md
+11
-0
11 additions, 0 deletions
paper_experiments/README.md
with
67 additions
and
1 deletion
new_specie/README.md
+
1
−
1
View file @
07a00170
...
...
@@ -8,4 +8,4 @@ sort_cluster.py
use
`python myscript.py --help`
to get more information on each scripts' usage
required packages can be install using
`pip install -r
requirements.txt
requirements.txt`
required packages can be install using
`pip install -r requirements.txt`
This diff is collapsed.
Click to expand it.
new_specie/print_annot.py
0 → 100755
+
55
−
0
View file @
07a00170
import
soundfile
as
sf
import
os
from
tqdm
import
tqdm
import
matplotlib.pyplot
as
plt
import
soundfile
as
sf
import
pandas
as
pd
,
numpy
as
np
import
models
,
utils
as
u
import
torch
from
filterbank
import
MelFilter
,
STFT
,
Log1p
,
MedFilt
fs
=
44_100
sampleDur
=
2.5
nMel
=
96
hop
=
260
width
=
int
((
sampleDur
*
fs
-
2048
)
/
hop
)
+
1
pad_width
=
int
((
1
*
fs
)
/
hop
)
+
1
frontend
=
torch
.
nn
.
Sequential
(
STFT
(
2048
,
hop
),
MelFilter
(
fs
,
2048
,
96
,
500
,
4000
),
Log1p
(
4
),
MedFilt
()
)
#df = pd.read_csv('S4A09100_20220527$045924.Table.1.selections.txt', delimiter='\t')
#df['filename'] = 'S4A09100_20220527$045924.wav'
#df['pos'] = df['Begin Time (s)'] + 1.25
#df['dur'] = df['End Time (s)'] - df['Begin Time (s)']
#df.drop(df[((df.dur < 2.5)|(df.dur > 8))].index, inplace=True)
df
=
pd
.
read_csv
(
'
all_annot.csv
'
)
df
=
df
[
'
Cao
'
]
=
'
C
'
df
[
'
pos
'
]
=
df
[
'
Begin Time (s)
'
]
+
1.25
loader
=
torch
.
utils
.
data
.
DataLoader
(
u
.
Dataset
(
df
,
'
./
'
,
fs
,
2.5
+
2
),
batch_size
=
1
,
num_workers
=
8
,
collate_fn
=
u
.
collate_fn
)
for
x
,
idx
in
tqdm
(
loader
):
x
=
frontend
(
x
).
squeeze
().
detach
()[:,
pad_width
:
-
pad_width
]
plt
.
figure
()
plt
.
imshow
(
x
,
origin
=
'
lower
'
,
aspect
=
'
auto
'
)
plt
.
subplots_adjust
(
top
=
1
,
bottom
=
0
,
left
=
0
,
right
=
1
)
plt
.
savefig
(
f
'
gibbon_calls/cao_vit_DL/
{
idx
.
item
()
}
'
)
plt
.
close
()
exit
()
sig
,
fs
=
sf
.
read
(
'
S4A09100_20220527$045924.wav
'
)
for
i
,
r
in
tqdm
(
df
.
iterrows
(),
total
=
len
(
df
)):
# x = frontend(torch.Tensor(sig[int(fs*r['Begin Time (s)']):int(fs*r['End Time (s)']), 1]).unsqueeze(0)).squeeze().detach()
x
=
frontend
(
torch
.
Tensor
(
sig
[
int
(
fs
*
r
[
'
Begin Time (s)
'
]):
int
(
fs
*
(
r
[
'
Begin Time (s)
'
]
+
2.5
)),
1
]).
unsqueeze
(
0
)).
squeeze
().
detach
()
plt
.
imshow
(
x
,
origin
=
'
lower
'
,
aspect
=
'
auto
'
,
extent
=
[
0
,
r
.
dur
,
500
,
5000
])
plt
.
tight_layout
()
plt
.
savefig
(
f
'
gibbon_calls/cao_vit_cut/
{
i
}
'
)
plt
.
close
()
This diff is collapsed.
Click to expand it.
paper_experiments/README.md
0 → 100755
+
11
−
0
View file @
07a00170
Scripts to run the experiments described in the published paper and plot figures are gathered in this folder.
Specifically :
-
train_AE.py to train an auto-encoder for a given dataset
-
compute_embeddings.py to use a pretrained auto-encoder to compute vocalisation embeddings
-
test_AE.py to cluster given embeddings and compute the NMI with respect to expert labels
-
run_XX_baseline.py for baseline feature extraction procedures
-
plot_XX.py to plot figures reporting results
use
`python myscript.py --help`
to get more information on each scripts' usage
required packages can be install using
`pip install -r requirements.txt`
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment