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
ad5b090a
Commit
ad5b090a
authored
Feb 06, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Plain Diff
some changes
parents
f1803cbb
214242e2
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
101 additions
and
31 deletions
+101
-31
.idea/21_22j-38.iml
.idea/21_22j-38.iml
+1
-1
.idea/misc.xml
.idea/misc.xml
+1
-1
API/app.py
API/app.py
+5
-1
API/db/__pycache__/dbConnection.cpython-39.pyc
API/db/__pycache__/dbConnection.cpython-39.pyc
+0
-0
API/db/dbConnection.py
API/db/dbConnection.py
+2
-2
API/model/__pycache__/colorModel.cpython-39.pyc
API/model/__pycache__/colorModel.cpython-39.pyc
+0
-0
API/model/__pycache__/readModel.cpython-39.pyc
API/model/__pycache__/readModel.cpython-39.pyc
+0
-0
API/model/colorModel.py
API/model/colorModel.py
+2
-1
backend/IT18218640/__pycache__/keyword_spotting_service.cpython-39.pyc
...18640/__pycache__/keyword_spotting_service.cpython-39.pyc
+0
-0
backend/IT18218640/convert.py
backend/IT18218640/convert.py
+26
-0
backend/IT18218640/image/accuracy_app.png
backend/IT18218640/image/accuracy_app.png
+0
-0
backend/IT18218640/image/chart1.png
backend/IT18218640/image/chart1.png
+0
-0
backend/IT18218640/image/chart3.png
backend/IT18218640/image/chart3.png
+0
-0
backend/IT18218640/image/loss_app.png
backend/IT18218640/image/loss_app.png
+0
-0
backend/IT18218640/server.py
backend/IT18218640/server.py
+2
-2
backend/IT18218640/src/Blue1643090283.mp3
backend/IT18218640/src/Blue1643090283.mp3
+0
-0
backend/IT18218640/train.py
backend/IT18218640/train.py
+14
-4
frontend/src/component/colorActivity.js
frontend/src/component/colorActivity.js
+2
-2
frontend/src/router/router.js
frontend/src/router/router.js
+1
-1
frontend/src/screen/Color.js
frontend/src/screen/Color.js
+1
-1
frontend/src/screen/activity/Blue.js
frontend/src/screen/activity/Blue.js
+6
-15
frontend/src/screen/auth/Login.js
frontend/src/screen/auth/Login.js
+9
-0
frontend/src/screen/auth/Register.js
frontend/src/screen/auth/Register.js
+9
-0
frontend/src/screen/home.js
frontend/src/screen/home.js
+9
-0
frontend/src/screen/splash/splash.js
frontend/src/screen/splash/splash.js
+11
-0
No files found.
.idea/21_22j-38.iml
View file @
ad5b090a
...
...
@@ -6,7 +6,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/API/venv"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/backend/IT18257632/venv"
/>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
8
"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
9
"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
.idea/misc.xml
View file @
ad5b090a
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.
8
"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.
9
"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
API/app.py
View file @
ad5b090a
...
...
@@ -45,6 +45,10 @@ def abc():
if
__name__
==
"__main__"
:
<<<<<<<
HEAD
# app.run(host='192.168.1.101')
=======
app
.
run
(
host
=
'192.168.8.102'
)
>>>>>>>
214242e2720
ae6c4a2b68a5dcc181a9640a724ab
# app.run(host='192.168.8.100,port='5000', debug=True)
app
.
run
(
debug
=
True
)
#
app.run(debug=True)
API/db/__pycache__/dbConnection.cpython-39.pyc
View file @
ad5b090a
No preview for this file type
API/db/dbConnection.py
View file @
ad5b090a
...
...
@@ -12,13 +12,13 @@ def create_con():
database
=
"helply"
,
host
=
"127.0.0.1"
,
user
=
"root"
,
password
=
"
12345678
"
password
=
"
rp19970520
"
)
return
db
def
create_con_pandas
():
db_connection_str
=
'mysql+mysqlconnector://root:
12345678
@127.0.0.1/helply'
db_connection_str
=
'mysql+mysqlconnector://root:
rp19970520
@127.0.0.1/helply'
db
=
create_engine
(
db_connection_str
)
return
db
...
...
API/model/__pycache__/colorModel.cpython-39.pyc
View file @
ad5b090a
No preview for this file type
API/model/__pycache__/readModel.cpython-39.pyc
0 → 100644
View file @
ad5b090a
File added
API/model/colorModel.py
View file @
ad5b090a
...
...
@@ -6,4 +6,5 @@ def get_color_activities():
response
=
get_all_data
(
qry
)
return
response
\ No newline at end of file
return
response
backend/IT18218640/__pycache__/keyword_spotting_service.cpython-39.pyc
0 → 100644
View file @
ad5b090a
File added
backend/IT18218640/convert.py
0 → 100644
View file @
ad5b090a
from
pydub
import
AudioSegment
from
os
import
path
import
subprocess
def
main
():
src
=
input
(
"src/Blue1643090283.mp3"
)
dst
=
input
(
"src/test.wav"
)
sound
=
AudioSegment
.
from_mp3
(
src
)
sound
.
export
(
dst
,
format
=
"wav"
)
print
(
f
"{'sound'}"
)
# # files
# src = "src/Blue1643090283.mp3"
# dst = "dst/test.wav"
#
# # subprocess.call(['ffmpeg', '-i', 'src/Blue1643090283.mp3', 'dst/test.wav'])
#
# # convert wav to mp3
# audSeg = AudioSegment.from_mp3(src).export(dst, format="wav")
#
# # print(f"{audSeg}")
if
__name__
==
"__main__"
:
main
()
\ No newline at end of file
backend/IT18218640/image/accuracy_app.png
deleted
100644 → 0
View file @
f1803cbb
22.2 KB
backend/IT18218640/image/chart1.png
0 → 100644
View file @
ad5b090a
24.2 KB
backend/IT18218640/image/chart3.png
0 → 100644
View file @
ad5b090a
20 KB
backend/IT18218640/image/loss_app.png
deleted
100644 → 0
View file @
f1803cbb
22.2 KB
backend/IT18218640/server.py
View file @
ad5b090a
...
...
@@ -18,7 +18,7 @@ def predict():
new_predict_file_name
=
predict_file_name
[
1
]
new_predict_file_name
=
new_predict_file_name
.
split
(
"."
)
FPFN
=
new_predict_file_name
[
0
]
print
(
f
"{FPFN}"
)
#
print(f"{FPFN}")
# invoke keyword spotting service
kss
=
Keyword_Spotting_service
()
...
...
@@ -34,6 +34,6 @@ def predict():
return
jsonify
(
data
)
if
__name__
==
"__main__"
:
# app.run(host='192.168.8.10
2
')
# app.run(host='192.168.8.10
0
')
#app.run(host='192.168.8.100,port='5000', debug=True)
app
.
run
(
debug
=
False
)
\ No newline at end of file
backend/IT18218640/src/Blue1643090283.mp3
0 → 100644
View file @
ad5b090a
File added
backend/IT18218640/train.py
View file @
ad5b090a
...
...
@@ -3,6 +3,7 @@ import numpy as np
import
tensorflow.keras
as
keras
from
sklearn.model_selection
import
train_test_split
import
matplotlib.pyplot
as
plt
from
keras.callbacks
import
ModelCheckpoint
DATA_PATH
=
"data.json"
SAVE_MODEL_PATH
=
"model.h5"
...
...
@@ -11,7 +12,7 @@ LEARNING_RATE = 0.0001
EPOCHS
=
60
BATCH_SIZE
=
32
NUM_KEYWORDS
=
10
NUM_KEYWORDS
=
6
def
load_dataset
(
data_path
):
...
...
@@ -66,6 +67,12 @@ def build_model(input_shape, learning_rate, error="sparse_categorical_crossentro
model
.
add
(
keras
.
layers
.
Dense
(
64
,
activation
=
"relu"
))
model
.
add
(
keras
.
layers
.
Dropout
(
0.3
))
# model.add(keras.layers.Flatten())
# model.add(keras.layers.Dense(128, activation="relu"))
# model.add(keras.layers.Dense(64, activation="relu"))
# model.add(keras.layers.Dropout(0.3))
# model.add(keras.layers.Dense(16, activation="relu"))
# softmax classifier
model
.
add
(
keras
.
layers
.
Dense
(
NUM_KEYWORDS
,
activation
=
"softmax"
))
...
...
@@ -104,12 +111,15 @@ def main():
input_shape
=
(
X_train
.
shape
[
1
],
X_train
.
shape
[
2
],
X_train
.
shape
[
3
],)
model
=
build_model
(
input_shape
,
LEARNING_RATE
)
# check Point
checkpoint
=
ModelCheckpoint
(
'models/model-{epoch:03d}.h5'
,
monitor
=
'val_loss'
,
save_best_only
=
True
,
mode
=
'auto'
)
# train the model
history
=
model
.
fit
(
X_train
,
y_train
,
epochs
=
EPOCHS
,
batch_size
=
BATCH_SIZE
,
validation_data
=
(
X_validation
,
y_validation
))
history
=
model
.
fit
(
X_train
,
y_train
,
epochs
=
EPOCHS
,
batch_size
=
BATCH_SIZE
,
validation_data
=
(
X_validation
,
y_validation
)
,
callbacks
=
[
checkpoint
]
)
# evaluate the model
test_error
,
test_accuracy
=
model
.
evaluate
(
X_test
,
y_test
)
print
(
f
"Test error: {test_error}, test accuracy: {test_accuracy}"
)
#
test_error, test_accuracy = model.evaluate(X_test, y_test)
#
print(f"Test error: {test_error}, test accuracy: {test_accuracy}")
# save the model
model
.
save
(
SAVE_MODEL_PATH
)
...
...
frontend/src/component/colorActivity.js
View file @
ad5b090a
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
React
from
"
react
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Image
}
from
'
react-native
'
...
...
@@ -10,7 +10,7 @@ export default function ColorActivity(props){
const
navigation
=
useNavigation
();
return
(
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Blue
"
)}}
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Blue
"
,
{
color
})}}
style
=
{{
borderWidth
:
5
,
borderColor
:
color
,
...
...
frontend/src/router/router.js
View file @
ad5b090a
...
...
@@ -8,7 +8,7 @@ import Register from '../screen/auth/Register';
import
Login
from
'
../screen/auth/Login
'
;
import
Splash
from
'
../screen/splash/Splash
'
;
import
Color
from
'
../screen/Color
'
;
import
Blue
from
'
../screen/Blue
'
;
import
Blue
from
'
../screen/
activity/
Blue
'
;
import
Read
from
'
../screen/Read
'
;
import
ReadActivity
from
'
../screen/activity/readActivity
'
;
const
Stack
=
createNativeStackNavigator
();
...
...
frontend/src/screen/Color.js
View file @
ad5b090a
...
...
@@ -6,7 +6,7 @@ import { StyleSheet, View, Text, Pressable, SafeAreaView, ScrollView, Image, Ima
import
ImageButton
from
"
../component/ImageButton
"
;
import
ColorActivity
from
"
../component/colorActivity
"
;
const
webUrel
=
"
http://192.168.8.10
1
:5000/getColorActivities
"
;
const
webUrel
=
"
http://192.168.8.10
2
:5000/getColorActivities
"
;
export
default
function
Color
(){
...
...
frontend/src/screen/Blue.js
→
frontend/src/screen/
activity/
Blue.js
View file @
ad5b090a
...
...
@@ -18,9 +18,10 @@ import {
Image
}
from
'
react-native
'
export
default
function
Blue
()
{
export
default
function
Blue
(
color
)
{
const
navigation
=
useNavigation
();
const
backColor
=
color
.
route
.
params
.
color
;
React
.
useEffect
(()
=>
{
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
...
...
@@ -36,7 +37,7 @@ export default function Blue() {
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../assets/game/gameback.png
"
)}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../
../
assets/game/gameback.png
"
)}
>
<
View
>
...
...
@@ -44,15 +45,15 @@ export default function Blue() {
<
Text
style
=
{
styles
.
text
}
>
Say
the
name
of
this
color
?
<
/Text
>
<
/View
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../assets/game/robo.png
"
)}
><
/Image
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../
../
assets/game/robo.png
"
)}
><
/Image
>
<
/View
>
<
View
>
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../assets/game/blackboard.png
"
)}
><
/Image
>
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../
../
assets/game/blackboard.png
"
)}
><
/Image
>
<
View
style
=
{
styles
.
box
}
>
<
View
style
=
{
{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}
}
>
<
/View
>
<
/View
>
...
...
@@ -77,16 +78,6 @@ const styles = StyleSheet.create({
width
:
"
100%
"
,
height
:
"
100%
"
,
},
box
:
{
width
:
180
,
height
:
180
,
// borderColor: "#000000",
backgroundColor
:
"
blue
"
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
},
blackboard
:
{
marginTop
:
-
420
,
marginLeft
:
240
,
...
...
frontend/src/screen/auth/Login.js
View file @
ad5b090a
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
React
from
"
react
"
;
import
{
SafeAreaView
,
ScrollView
,
View
,
StyleSheet
,
ImageBackground
,
Text
,
TextInput
,
TouchableOpacity
,
Image
}
from
"
react-native
"
;
...
...
@@ -6,6 +7,14 @@ const Login = () => {
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToPortrait
();
});
return
unsubscribe
;
},
[
navigation
]);
return
(
<
SafeAreaView
>
<
ScrollView
>
...
...
frontend/src/screen/auth/Register.js
View file @
ad5b090a
import
React
from
"
react
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
{
SafeAreaView
,
ScrollView
,
View
,
StyleSheet
,
ImageBackground
,
Text
,
TextInput
,
TouchableOpacity
,
Image
}
from
"
react-native
"
;
...
...
@@ -6,6 +7,14 @@ const Register = () => {
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToPortrait
();
});
return
unsubscribe
;
},
[
navigation
]);
return
(
<
SafeAreaView
>
<
ScrollView
>
...
...
frontend/src/screen/home.js
View file @
ad5b090a
import
React
from
"
react
"
;
import
{
StyleSheet
,
View
,
Text
,
Pressable
,
SafeAreaView
,
ScrollView
,
Image
}
from
'
react-native
'
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
ImageButton
from
"
../component/ImageButton
"
;
export
default
function
Home
({
navigation
}){
...
...
@@ -8,6 +9,14 @@ export default function Home({ navigation }){
navigation
.
navigate
(
'
Start
'
);
}
React
.
useEffect
(()
=>
{
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToPortrait
();
});
return
unsubscribe
;
},
[
navigation
]);
return
(
<
SafeAreaView
>
<
ScrollView
>
...
...
frontend/src/screen/splash/splash.js
View file @
ad5b090a
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Image
,
View
,
Text
}
from
"
react-native
"
;
const
Splash
=
()
=>
{
const
navigation
=
useNavigation
();
const
[
isGo
,
setIsGo
]
=
useState
(
true
);
const
Navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToPortrait
();
});
return
unsubscribe
;
},
[
navigation
]);
useEffect
(
()
=>
{
if
(
isGo
==
true
){
...
...
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