Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
a7c84b82
Commit
a7c84b82
authored
Oct 12, 2017
by
Manoj Plakal
Browse files
Concatenate instead of add in vggish_train_demo.py.
Also added 'sudo' to installation instructions.
parent
b8e5a44b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
research/audioset/README.md
research/audioset/README.md
+4
-3
research/audioset/vggish_train_demo.py
research/audioset/vggish_train_demo.py
+2
-2
No files found.
research/audioset/README.md
View file @
a7c84b82
...
@@ -84,14 +84,15 @@ Here's a sample installation and test session:
...
@@ -84,14 +84,15 @@ Here's a sample installation and test session:
# $ source vggish/bin/activate # Assuming you use bash
# $ source vggish/bin/activate # Assuming you use bash
# Leave the virtual environment at the end of the session by running
# Leave the virtual environment at the end of the session by running
# $ deactivate
# $ deactivate
# Within the virtual environment, do not use 'sudo'.
# Upgrade pip first.
# Upgrade pip first.
$
python
-m
pip
install
--upgrade
pip
$
sudo
python
-m
pip
install
--upgrade
pip
# Install dependences. Resampy needs to be installed after NumPy and SciPy
# Install dependences. Resampy needs to be installed after NumPy and SciPy
# are already installed.
# are already installed.
$
pip
install
numpy scipy
$
sudo
pip
install
numpy scipy
$
pip
install
resampy tensorflow six
$
sudo
pip
install
resampy tensorflow six
# Clone TensorFlow models repo into a 'models' directory.
# Clone TensorFlow models repo into a 'models' directory.
$
git clone https://github.com/tensorflow/models.git
$
git clone https://github.com/tensorflow/models.git
...
...
research/audioset/vggish_train_demo.py
View file @
a7c84b82
...
@@ -114,8 +114,8 @@ def _get_examples_batch():
...
@@ -114,8 +114,8 @@ def _get_examples_batch():
noise_labels
=
np
.
array
([[
0
,
0
,
1
]]
*
noise_examples
.
shape
[
0
])
noise_labels
=
np
.
array
([[
0
,
0
,
1
]]
*
noise_examples
.
shape
[
0
])
# Shuffle (example, label) pairs across all classes.
# Shuffle (example, label) pairs across all classes.
all_examples
=
sine_examples
+
const_examples
+
noise_examples
all_examples
=
np
.
concatenate
((
sine_examples
,
const_examples
,
noise_examples
))
all_labels
=
sine_labels
+
const_labels
+
noise_labels
all_labels
=
np
.
concatenate
((
sine_labels
,
const_labels
,
noise_labels
))
labeled_examples
=
list
(
zip
(
all_examples
,
all_labels
))
labeled_examples
=
list
(
zip
(
all_examples
,
all_labels
))
shuffle
(
labeled_examples
)
shuffle
(
labeled_examples
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment