Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-029
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-029
2023-029
Commits
23495a40
Commit
23495a40
authored
Aug 03, 2023
by
Paranagama R.P.S.D.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : Translate sign language to text. Frontend integration
parent
531eb043
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
14 deletions
+66
-14
Project/Backend/Server_Python/main.py
Project/Backend/Server_Python/main.py
+1
-0
Project/Frontend/Web_App/package-lock.json
Project/Frontend/Web_App/package-lock.json
+19
-7
Project/Frontend/Web_App/package.json
Project/Frontend/Web_App/package.json
+3
-1
Project/Frontend/Web_App/src/config.ts
Project/Frontend/Web_App/src/config.ts
+1
-1
Project/Frontend/Web_App/src/pages/translate-page.tsx
Project/Frontend/Web_App/src/pages/translate-page.tsx
+21
-1
Project/Frontend/Web_App/src/services/SignLanguageToText.js
Project/Frontend/Web_App/src/services/SignLanguageToText.js
+12
-0
Project/Frontend/Web_App/yarn.lock
Project/Frontend/Web_App/yarn.lock
+9
-4
No files found.
Project/Backend/Server_Python/main.py
View file @
23495a40
...
@@ -19,6 +19,7 @@ app.include_router(translate_controler.router)
...
@@ -19,6 +19,7 @@ app.include_router(translate_controler.router)
origins
=
[
origins
=
[
"http://localhost"
,
"http://localhost"
,
"http://localhost:8080"
,
"http://localhost:8080"
,
"http://localhost:8004"
,
]
]
app
.
add_middleware
(
CORSMiddleware
,
app
.
add_middleware
(
CORSMiddleware
,
...
...
Project/Frontend/Web_App/package-lock.json
View file @
23495a40
...
@@ -32,11 +32,13 @@
...
@@ -32,11 +32,13 @@
"amazon-cognito-identity-js"
:
"^5.2.11"
,
"amazon-cognito-identity-js"
:
"^5.2.11"
,
"apexcharts"
:
"^3.36.0"
,
"apexcharts"
:
"^3.36.0"
,
"autosuggest-highlight"
:
"^3.3.4"
,
"autosuggest-highlight"
:
"^3.3.4"
,
"axios"
:
"^1.
1.2
"
,
"axios"
:
"^1.
4.0
"
,
"change-case"
:
"^4.1.2"
,
"change-case"
:
"^4.1.2"
,
"date-fns"
:
"^2.29.3"
,
"date-fns"
:
"^2.29.3"
,
"firebase"
:
"^9.12.1"
,
"firebase"
:
"^9.12.1"
,
"form-data"
:
"^4.0.0"
,
"framer-motion"
:
"^7.5.3"
,
"framer-motion"
:
"^7.5.3"
,
"fs"
:
"^0.0.1-security"
,
"highlight.js"
:
"^11.6.0"
,
"highlight.js"
:
"^11.6.0"
,
"i18next"
:
"^21.10.0"
,
"i18next"
:
"^21.10.0"
,
"i18next-browser-languagedetector"
:
"^6.1.8"
,
"i18next-browser-languagedetector"
:
"^6.1.8"
,
...
@@ -2856,9 +2858,9 @@
...
@@ -2856,9 +2858,9 @@
}
}
},
},
"node_modules/axios"
:
{
"node_modules/axios"
:
{
"version"
:
"1.
1.2
"
,
"version"
:
"1.
4.0
"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-1.
1.2
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-1.
4.0
.tgz"
,
"integrity"
:
"sha512-
bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaW
A=="
,
"integrity"
:
"sha512-
S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSE
A=="
,
"dependencies"
:
{
"dependencies"
:
{
"follow-redirects"
:
"^1.15.0"
,
"follow-redirects"
:
"^1.15.0"
,
"form-data"
:
"^4.0.0"
,
"form-data"
:
"^4.0.0"
,
...
@@ -4593,6 +4595,11 @@
...
@@ -4593,6 +4595,11 @@
"tslib"
:
"2.4.0"
"tslib"
:
"2.4.0"
}
}
},
},
"node_modules/fs"
:
{
"version"
:
"0.0.1-security"
,
"resolved"
:
"https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz"
,
"integrity"
:
"sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"node_modules/fs.realpath"
:
{
"node_modules/fs.realpath"
:
{
"version"
:
"1.0.0"
,
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
,
...
@@ -11022,9 +11029,9 @@
...
@@ -11022,9 +11029,9 @@
"dev"
:
true
"dev"
:
true
},
},
"axios"
:
{
"axios"
:
{
"version"
:
"1.
1.2
"
,
"version"
:
"1.
4.0
"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-1.
1.2
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-1.
4.0
.tgz"
,
"integrity"
:
"sha512-
bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaW
A=="
,
"integrity"
:
"sha512-
S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSE
A=="
,
"requires"
:
{
"requires"
:
{
"follow-redirects"
:
"^1.15.0"
,
"follow-redirects"
:
"^1.15.0"
,
"form-data"
:
"^4.0.0"
,
"form-data"
:
"^4.0.0"
,
...
@@ -12420,6 +12427,11 @@
...
@@ -12420,6 +12427,11 @@
"tslib"
:
"2.4.0"
"tslib"
:
"2.4.0"
}
}
},
},
"fs"
:
{
"version"
:
"0.0.1-security"
,
"resolved"
:
"https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz"
,
"integrity"
:
"sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"fs.realpath"
:
{
"fs.realpath"
:
{
"version"
:
"1.0.0"
,
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
,
...
...
Project/Frontend/Web_App/package.json
View file @
23495a40
...
@@ -42,11 +42,13 @@
...
@@ -42,11 +42,13 @@
"amazon-cognito-identity-js"
:
"^5.2.11"
,
"amazon-cognito-identity-js"
:
"^5.2.11"
,
"apexcharts"
:
"^3.36.0"
,
"apexcharts"
:
"^3.36.0"
,
"autosuggest-highlight"
:
"^3.3.4"
,
"autosuggest-highlight"
:
"^3.3.4"
,
"axios"
:
"^1.
1.2
"
,
"axios"
:
"^1.
4.0
"
,
"change-case"
:
"^4.1.2"
,
"change-case"
:
"^4.1.2"
,
"date-fns"
:
"^2.29.3"
,
"date-fns"
:
"^2.29.3"
,
"firebase"
:
"^9.12.1"
,
"firebase"
:
"^9.12.1"
,
"form-data"
:
"^4.0.0"
,
"framer-motion"
:
"^7.5.3"
,
"framer-motion"
:
"^7.5.3"
,
"fs"
:
"^0.0.1-security"
,
"highlight.js"
:
"^11.6.0"
,
"highlight.js"
:
"^11.6.0"
,
"i18next"
:
"^21.10.0"
,
"i18next"
:
"^21.10.0"
,
"i18next-browser-languagedetector"
:
"^6.1.8"
,
"i18next-browser-languagedetector"
:
"^6.1.8"
,
...
...
Project/Frontend/Web_App/src/config.ts
View file @
23495a40
...
@@ -3,7 +3,7 @@ import { PATH_DASHBOARD } from './routes/paths';
...
@@ -3,7 +3,7 @@ import { PATH_DASHBOARD } from './routes/paths';
// API
// API
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
export
const
BACKEND_URL
=
'
http://127.0.0.1:8000/
'
;
export
const
HOST_API_KEY
=
process
.
env
.
HOST_API_KEY
||
''
;
export
const
HOST_API_KEY
=
process
.
env
.
HOST_API_KEY
||
''
;
export
const
FIREBASE_API
=
{
export
const
FIREBASE_API
=
{
...
...
Project/Frontend/Web_App/src/pages/translate-page.tsx
View file @
23495a40
...
@@ -41,6 +41,7 @@ import { useSnackbar } from 'notistack';
...
@@ -41,6 +41,7 @@ import { useSnackbar } from 'notistack';
import
useCopyToClipboard
from
'
src/hooks/useCopyToClipboard
'
;
import
useCopyToClipboard
from
'
src/hooks/useCopyToClipboard
'
;
import
Iconify
from
'
src/components/iconify/Iconify
'
;
import
Iconify
from
'
src/components/iconify/Iconify
'
;
import
dynamic
from
'
next/dynamic
'
;
import
dynamic
from
'
next/dynamic
'
;
import
SignLanguageToTextService
from
'
src/services/SignLanguageToText.js
'
;
const
useReactMediaRecorder
=
()
=>
const
useReactMediaRecorder
=
()
=>
// eslint-disable-next-line react-hooks/rules-of-hooks
// eslint-disable-next-line react-hooks/rules-of-hooks
...
@@ -57,7 +58,7 @@ export default function AboutPage() {
...
@@ -57,7 +58,7 @@ export default function AboutPage() {
const
[
isUploadFile
,
setIsUploadFile
]
=
useState
<
boolean
|
string
|
null
>
(
true
);
const
[
isUploadFile
,
setIsUploadFile
]
=
useState
<
boolean
|
string
|
null
>
(
true
);
const
[
videoUrl
,
setVideoUrl
]
=
useState
(
''
);
const
[
videoUrl
,
setVideoUrl
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
value
,
setValue
]
=
useState
(
'
ආආආආආආආආආආආආආආආආ
'
);
const
[
value
,
setValue
]
=
useState
(
''
);
const
handleDropSingleFile
=
useCallback
(
async
(
acceptedFiles
:
File
[])
=>
{
const
handleDropSingleFile
=
useCallback
(
async
(
acceptedFiles
:
File
[])
=>
{
const
file
=
acceptedFiles
[
0
];
const
file
=
acceptedFiles
[
0
];
...
@@ -105,6 +106,22 @@ export default function AboutPage() {
...
@@ -105,6 +106,22 @@ export default function AboutPage() {
// Video Upload
// Video Upload
const
translateSignLanguageToText
=
async
()
=>
{
setLoading
(
true
);
const
formData
=
new
FormData
();
formData
.
append
(
'
video_request
'
,
file
,
'
test_video.mp4
'
);
try
{
const
response
=
await
SignLanguageToTextService
.
predictSignLanguageVideo
(
10
,
formData
);
console
.
log
(
response
.
data
);
setValue
(
response
.
data
.
predictions
);
setLoading
(
false
);
}
catch
(
error
)
{
console
.
log
(
error
);
setLoading
(
false
);
}
};
return
(
return
(
<>
<>
<
Head
>
<
Head
>
...
@@ -211,6 +228,9 @@ export default function AboutPage() {
...
@@ -211,6 +228,9 @@ export default function AboutPage() {
mb
:
3
,
mb
:
3
,
}
}
}
}
disabled=
{
loading
}
disabled=
{
loading
}
onClick=
{
()
=>
{
translateSignLanguageToText
();
}
}
>
>
Translate
Translate
</
Button
>
</
Button
>
...
...
Project/Frontend/Web_App/src/services/SignLanguageToText.js
0 → 100644
View file @
23495a40
import
axios
from
'
axios
'
;
class
SignLanguageToTextService
{
predictSignLanguageVideo
(
speed
,
data
)
{
return
axios
.
post
(
`http://127.0.0.1:8000/predict-sign-language/video/speed_levels?speed=
${
speed
}
`
,
data
);
}
}
export
default
new
SignLanguageToTextService
();
Project/Frontend/Web_App/yarn.lock
View file @
23495a40
...
@@ -1723,10 +1723,10 @@
...
@@ -1723,10 +1723,10 @@
"resolved" "https://registry.npmjs.org/axe-core/-/axe-core-4.3.5.tgz"
"resolved" "https://registry.npmjs.org/axe-core/-/axe-core-4.3.5.tgz"
"version" "4.3.5"
"version" "4.3.5"
"axios@^1.
1.2
":
"axios@^1.
4.0
":
"integrity" "sha512-
bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaW
A=="
"integrity" "sha512-
S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSE
A=="
"resolved" "https://registry.npmjs.org/axios/-/axios-1.
1.2
.tgz"
"resolved" "https://registry.npmjs.org/axios/-/axios-1.
4.0
.tgz"
"version" "1.
1.2
"
"version" "1.
4.0
"
dependencies:
dependencies:
"follow-redirects" "^1.15.0"
"follow-redirects" "^1.15.0"
"form-data" "^4.0.0"
"form-data" "^4.0.0"
...
@@ -2802,6 +2802,11 @@
...
@@ -2802,6 +2802,11 @@
"resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
"resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
"version" "1.0.0"
"version" "1.0.0"
"fs@^0.0.1-security":
"integrity" "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
"resolved" "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz"
"version" "0.0.1-security"
"function-bind@^1.1.1":
"function-bind@^1.1.1":
"integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
"resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
...
...
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