Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-191
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
2023-191
2023-191
Commits
d3cac160
Commit
d3cac160
authored
Aug 20, 2023
by
Madhushan Liyanage
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into Madhushan-K.L.B-DEV
parents
f5f32296
948a40fe
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
199 additions
and
2 deletions
+199
-2
Frontend/src/App.js
Frontend/src/App.js
+2
-0
Frontend/src/components/SideNavBar.jsx
Frontend/src/components/SideNavBar.jsx
+1
-1
Frontend/src/pages/AudioToSign.jsx
Frontend/src/pages/AudioToSign.jsx
+138
-0
Frontend/src/styles/audioToSign.css
Frontend/src/styles/audioToSign.css
+47
-0
SpringBootBackend/src/main/java/shrasthra/backend/dao/domain/McqWord.java
...d/src/main/java/shrasthra/backend/dao/domain/McqWord.java
+1
-1
SpringBootBackend/src/main/java/shrasthra/backend/dao/domain/SignMap.java
...d/src/main/java/shrasthra/backend/dao/domain/SignMap.java
+10
-0
No files found.
Frontend/src/App.js
View file @
d3cac160
...
@@ -11,6 +11,7 @@ import Login from './pages/Login';
...
@@ -11,6 +11,7 @@ import Login from './pages/Login';
import
Register
from
'
./pages/Register
'
;
import
Register
from
'
./pages/Register
'
;
import
{
useEffect
,
useState
}
from
'
react
'
;
import
{
useEffect
,
useState
}
from
'
react
'
;
import
Test
from
'
./pages/Test
'
;
import
Test
from
'
./pages/Test
'
;
import
AudioToSign
from
'
./pages/AudioToSign
'
;
function
App
()
{
function
App
()
{
const
[
isLogged
,
setIsLogged
]
=
useState
(
sessionStorage
.
getItem
(
"
isLogged
"
));
const
[
isLogged
,
setIsLogged
]
=
useState
(
sessionStorage
.
getItem
(
"
isLogged
"
));
...
@@ -30,6 +31,7 @@ function App() {
...
@@ -30,6 +31,7 @@ function App() {
<
Routes
>
<
Routes
>
{
/* <Route path='*' element={<VideoToSign/>}/> */
}
{
/* <Route path='*' element={<VideoToSign/>}/> */
}
<
Route
exact
path
=
'
/sign-detection
'
element
=
{
<
VideoToSign
/>
}
/
>
<
Route
exact
path
=
'
/sign-detection
'
element
=
{
<
VideoToSign
/>
}
/
>
<
Route
exact
path
=
'
/audio-to-sign
'
element
=
{
<
AudioToSign
/>
}
/
>
<
/Routes>
<
/Routes>
<
/div
>
<
/div
>
...
...
Frontend/src/components/SideNavBar.jsx
View file @
d3cac160
...
@@ -31,7 +31,7 @@ function SideNavBar() {
...
@@ -31,7 +31,7 @@ function SideNavBar() {
{
/* සංඥා ශබ්දකෝෂය */
}
{
/* සංඥා ශබ්දකෝෂය */
}
<
NavLink
exact
to=
"/about"
className=
"nav-link main-nav-link"
activeClassName=
"active-link"
>
ix
{
d YíofldaIh
</
NavLink
>
<
NavLink
exact
to=
"/about"
className=
"nav-link main-nav-link"
activeClassName=
"active-link"
>
ix
{
d YíofldaIh
</
NavLink
>
{
/* ශබ්ද පරිවර්ථකය */
}
{
/* ශබ්ද පරිවර්ථකය */
}
<
NavLink
exact
to=
"/
contact
"
className=
"nav-link main-nav-link"
activeClassName=
"active-link"
>
Yío mßj¾:lh
</
NavLink
>
<
NavLink
exact
to=
"/
audio-to-sign
"
className=
"nav-link main-nav-link"
activeClassName=
"active-link"
>
Yío mßj¾:lh
</
NavLink
>
{
/* සංඥා හඳුනාගැනීම */
}
{
/* සංඥා හඳුනාගැනීම */
}
<
NavLink
exact
to=
"/sign-detection"
className=
"nav-link main-nav-link "
activeClassName=
"active-link"
>
ix
{
d y÷kd.ekSu
</
NavLink
>
<
NavLink
exact
to=
"/sign-detection"
className=
"nav-link main-nav-link "
activeClassName=
"active-link"
>
ix
{
d y÷kd.ekSu
</
NavLink
>
{
/* වාචික පුහුණුව */
}
{
/* වාචික පුහුණුව */
}
...
...
Frontend/src/pages/AudioToSign.jsx
0 → 100644
View file @
d3cac160
import
React
,
{
useState
}
from
'
react
'
;
import
axios
from
'
axios
'
;
import
{
useRecordWebcam
}
from
'
react-record-webcam
'
;
import
RestService
from
"
../services/RestService
"
;
import
'
../styles/audioToSign.css
'
;
const
AudioToSign
=
()
=>
{
const
[
file
,
setFile
]
=
useState
(
null
);
const
handleFileChange
=
(
event
)
=>
{
const
selectedFile
=
event
.
target
.
files
[
0
];
setFile
(
selectedFile
);
};
// const handleUpload = () => {
// if (file) {
// try {
// const formData = new FormData();
// formData.append('audio1', file);
// axios.post('http://127.0.0.1:5000/uploadaudio', formData, {
// //axios.get('http://localhost:9000/', formData, {
// headers: {
// 'Content-Type': 'multipart/form-data',
// },
// });
// console.log('File uploaded successfully!');
// } catch (error) {
// console.error('Error uploading file:', error);
// }
// }
// };
//*************************************************** */
const
[
videoFile
,
setVideoFile
]
=
useState
(
null
);
const
[
audioFile
,
setAudioFile
]
=
useState
([]);
const
handleVideoFileChange
=
(
event
)
=>
{
setVideoFile
(
event
.
target
.
files
[
0
]);
};
const
handleAudioFileChange
=
(
event
)
=>
{
setAudioFile
(
event
.
target
.
files
[
0
]);
};
const
handleVideoUpload
=
()
=>
{
if
(
videoFile
)
{
const
formData
=
new
FormData
();
formData
.
append
(
'
video
'
,
videoFile
);
axios
.
post
(
'
http://127.0.0.1:5000/transcribe-audio
'
,
formData
)
.
then
(
response
=>
{
console
.
log
(
'
Video uploaded successfully
'
);
})
.
catch
(
error
=>
{
console
.
error
(
'
Error:
'
,
error
);
});
}
};
const
handleAudioUpload
=
()
=>
{
console
.
log
(
audioFile
)
const
formData
=
new
FormData
();
formData
.
append
(
'
audio1
'
,
audioFile
);
axios
.
post
(
'
http://127.0.0.1:5000/transcribe-audio
'
,
formData
)
.
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
'
Audio uploaded successfully
'
);
})
.
catch
(
error
=>
{
console
.
error
(
'
Error:
'
,
error
);
});
};
return
(
<
div
className=
"col col-lg-12"
>
<
div
className=
'row'
>
<
h1
>
Upload Video
</
h1
>
</
div
>
<
div
className=
'row'
>
<
input
type=
"file"
accept=
"video/*"
onChange=
{
handleVideoFileChange
}
/>
{
/* <button onClick={handleVideoUpload}>Upload Video</button> */
}
<
button
className=
"btn video-btn"
onClick=
{
handleVideoUpload
}
>
Upload Video
</
button
>
</
div
>
<
div
className=
'row'
>
<
h1
>
Upload Audio
</
h1
>
</
div
>
<
div
className=
'row'
>
<
input
type=
"file"
onChange=
{
(
e
)
=>
setAudioFile
(
e
.
target
.
files
[
0
])
}
/>
{
/* <button onClick={handleAudioUpload}>Upload Audio</button> */
}
<
button
className=
"btn video-btn"
onClick=
{
handleAudioUpload
}
>
Upload Audio
</
button
>
</
div
>
<
br
/>
<
div
className=
"row"
>
<
div
className=
"col-6 col-sm-4"
>
<
h3
className=
"mt-4"
style=
{
{
fontFamily
:
'
FMAbayaBld
'
}
}
>
w¾:h (
</
h3
>
<
h1
className=
"d-flex align-items-center justify-content-center"
>
ffffs
</
h1
>
</
div
>
<
div
class=
"col-6 col-sm-4"
>
<
video
autoPlay
muted
className=
"video-box1"
/>
</
div
>
</
div
>
</
div
>
);
};
export
default
AudioToSign
;
Frontend/src/styles/audioToSign.css
0 → 100644
View file @
d3cac160
.video-box1
{
border-width
:
3px
;
border-color
:
#af2c00
;
border-style
:
solid
;
border-radius
:
2vw
;
box-shadow
:
0
4px
8px
0
rgba
(
0
,
0
,
0
,
0.552
),
0
10px
10px
0
rgba
(
0
,
0
,
0
,
0.338
);
/* box-shadow: 0 1px 10px 0 rgba(66, 66, 66, 0.336), 0 6px 20px 0 rgba(100, 100, 100, 0.082); */
/* width: 40vw; */
height
:
45vh
;
width
:
65vh
;
align-items
:
center
;
background-color
:
black
;
background-image
:
url('../images/Skulls.jpg')
;
}
.aa
{
align-items
:
end
;
}
.card
{
align-items
:
end
;
width
:
100%
;
background-color
:
transparent
;
border-color
:
transparent
;
}
section
{
margin
:
20px
;
}
input
::-webkit-file-upload-button
{
position
:
absolute
;
padding
:
6px
15px
;
background-color
:
rgb
(
230
,
154
,
78
);
border
:
none
;
border-radius
:
5px
;
color
:
white
;
text-transform
:
uppercase
;
box-shadow
:
0px
3px
3px
-2px
rgba
(
0
,
0
,
0
,
0.2
),
0px
3px
4px
0px
rgba
(
0
,
0
,
0
,
0.14
),
0px
1px
8px
0px
rgba
(
0
,
0
,
0
,
0.12
);
transition
:
100ms
ease-out
;
cursor
:
pointer
;
}
input
::-webkit-file-upload-button:hover
{
background-color
:
#9e8160
;
box-shadow
:
0px
3px
5px
-1px
rgba
(
0
,
0
,
0
,
0.2
),
0px
5px
8px
0px
rgba
(
0
,
0
,
0
,
0.14
),
0px
1px
14px
0px
rgba
(
0
,
0
,
0
,
0.12
)
}
\ No newline at end of file
SpringBootBackend/src/main/java/shrasthra/backend/dao/domain/McqWord.java
View file @
d3cac160
...
@@ -12,7 +12,7 @@ import lombok.Data;
...
@@ -12,7 +12,7 @@ import lombok.Data;
@Data
@Data
@Entity
@Entity
@Table
(
name
=
"
app_user
"
,
catalog
=
"shrasthra"
)
@Table
(
name
=
"
mcq_words
"
,
catalog
=
"shrasthra"
)
public
class
McqWord
{
public
class
McqWord
{
@Id
@Id
...
...
SpringBootBackend/src/main/java/shrasthra/backend/dao/domain/SignMap.java
View file @
d3cac160
...
@@ -14,6 +14,7 @@ public class SignMap {
...
@@ -14,6 +14,7 @@ public class SignMap {
private
Integer
id
;
private
Integer
id
;
private
String
label
;
private
String
label
;
private
String
value
;
private
String
value
;
private
String
imgUrl
;
@Id
@Id
@GeneratedValue
(
strategy
=
IDENTITY
)
@GeneratedValue
(
strategy
=
IDENTITY
)
...
@@ -40,6 +41,15 @@ public class SignMap {
...
@@ -40,6 +41,15 @@ public class SignMap {
public
void
setValue
(
String
value
)
{
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
this
.
value
=
value
;
}
}
@Column
(
name
=
"img_url"
)
public
String
getImgUrl
()
{
return
imgUrl
;
}
public
void
setImgUrl
(
String
imgUrl
)
{
this
.
imgUrl
=
imgUrl
;
}
}
}
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