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
2c901044
Commit
2c901044
authored
Feb 09, 2022
by
W.D.R.P. Sandeepa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add client.js file
parent
f682946d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
backend/IT18218640/client.py
backend/IT18218640/client.py
+1
-1
backend/IT18218640/server.py
backend/IT18218640/server.py
+5
-2
frontend/src/screen/client/Client.js
frontend/src/screen/client/Client.js
+3
-0
No files found.
backend/IT18218640/client.py
View file @
2c901044
import
requests
import
requests
URL
=
"http://1
27.0.0.
1:5000/predict"
URL
=
"http://1
92.168.8.10
1:5000/predict"
TEST_AUDIO_FILE_PATH
=
"test/red.wav"
TEST_AUDIO_FILE_PATH
=
"test/red.wav"
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
backend/IT18218640/server.py
View file @
2c901044
...
@@ -9,6 +9,9 @@ app = Flask(__name__)
...
@@ -9,6 +9,9 @@ app = Flask(__name__)
def
predict
():
def
predict
():
# get audio file and save it
# get audio file and save it
audio_file
=
request
.
files
[
"file"
]
audio_file
=
request
.
files
[
"file"
]
# print(f"{request.files['file']}")
# print(f"{request.files['name']}")
file_name
=
str
(
random
.
randint
(
0
,
100000
))
file_name
=
str
(
random
.
randint
(
0
,
100000
))
audio_file
.
save
((
file_name
))
audio_file
.
save
((
file_name
))
...
@@ -34,6 +37,6 @@ def predict():
...
@@ -34,6 +37,6 @@ def predict():
return
jsonify
(
data
)
return
jsonify
(
data
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# app.run(host='192.168.8.100
')
app
.
run
(
host
=
'192.168.8.101
'
)
#app.run(host='192.168.8.100,port='5000', debug=True)
#app.run(host='192.168.8.100,port='5000', debug=True)
app
.
run
(
debug
=
False
)
# app.run(debug=False)
\ No newline at end of file
\ No newline at end of file
frontend/src/screen/client/Client.js
0 → 100644
View file @
2c901044
import
axios
from
'
axios
'
;
export
default
axios
.
create
({
baseURL
:
'
http://192.168.8.101:5000/predict
'
,
timeout
:
15000
,
});
\ 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