Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
21_22-J 31
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 31
21_22-J 31
Commits
bc5f42f9
Commit
bc5f42f9
authored
Jan 10, 2022
by
chalaka78
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sound detection models
parent
fe01bf90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
User/views.py
User/views.py
+60
-0
No files found.
User/views.py
View file @
bc5f42f9
...
@@ -429,6 +429,66 @@ def Customer_Frequency(request):
...
@@ -429,6 +429,66 @@ def Customer_Frequency(request):
def
AdminHome
(
request
):
def
AdminHome
(
request
):
return
render
(
request
,
'Admin/AdminHome.html'
)
return
render
(
request
,
'Admin/AdminHome.html'
)
# tensorflow sound detection model
# import tensorflow as tf
# import tensorflow_io as tfio
#
# import tensorflow as tf
# import tensorflow_io as tfio
#
# audio = tfio.audio.AudioIOTensor('gs://clouds-sample-tests/speech/brooklyn.flac')
#
# print(audio)
#
#
# # remove last dimension
# audio_tensor = tf.squeeze(audio_slice, axis=[-1])
#
# print(audio_tensor)
#
# from IPython.display import Audio
#
# Audio(audio_tensor.numpy(), rate=audio.rate.numpy())
#
#
# import matplotlib.pyplot as plt
#
#
# tensor = tf.cast(audio_tensor, tf.float32) / 32768.0
#
# plt.figure()
# plt.plot(tensor.numpy())
# pyaudio sound detection model
# import numpy as np
#
# import warnings
# warnings.filterwarnings("ignore")
#
# from pyaudioclassification import feature_extraction, train, predict, print_leaderboard
#
# parent_dir = '.'
#
#
# if np.DataSource().exists("./feat.npy") and np.DataSource().exists("./label.npy"):
# features, labels = np.load('./feat.npy'), np.load('./label.npy')
# else:
# features, labels = feature_extraction('./data/')
# np.save('./feat.npy', features)
# np.save('./label.npy', labels)
#
#
# if np.DataSource().exists("./model.h5"):
# from keras.models import load_model
# model = load_model('./model.h5')
# else:
# model = train(features, labels, epochs=100)
# model.save('./model.h5')
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