Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
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
0
Merge Requests
0
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 38
21_22-J 38
Commits
a2d1b0b7
Commit
a2d1b0b7
authored
Jan 07, 2022
by
W.D.R.P. Sandeepa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add main method and client end point
parent
4286abe7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
backend/IT18218640/client.py
backend/IT18218640/client.py
+15
-0
backend/IT18218640/server.py
backend/IT18218640/server.py
+6
-1
No files found.
backend/IT18218640/client.py
View file @
a2d1b0b7
import
requests
URL
=
"http://127.0.0.1:5000/predict"
TEST_AUDIO_FILE_PATH
=
"test/other.wav"
if
__name__
==
"__main__"
:
audio_file
=
open
(
TEST_AUDIO_FILE_PATH
,
"rb"
)
values
=
{
"file"
:
(
TEST_AUDIO_FILE_PATH
,
audio_file
,
"audio/wav"
)
}
response
=
requests
.
post
(
URL
,
files
=
values
)
data
=
response
.
json
()
print
(
f
"Predicted Keyword is : {data['Keyword']}"
)
\ No newline at end of file
backend/IT18218640/server.py
View file @
a2d1b0b7
...
...
@@ -32,3 +32,8 @@ def predict():
# send back the predicted keword in json format
data
=
{
"Keyword"
:
predicted_keyword
}
return
jsonify
(
data
)
if
__name__
==
"__main__"
:
# app.run(host='192.168.8.102')
#app.run(host='192.168.8.100,port='5000', debug=True)
app
.
run
(
debug
=
False
)
\ No newline at end of file
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