Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rp_server_one
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
Ranasinghe R.A.P.T
rp_server_one
Commits
0c658a5c
Commit
0c658a5c
authored
Apr 25, 2022
by
Pamal-Ranasinghe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final out put video uploaded to the aws s3
parent
98243cc2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
23 deletions
+56
-23
resources/__pycache__/speechExtraction.cpython-38.pyc
resources/__pycache__/speechExtraction.cpython-38.pyc
+0
-0
resources/awsOperation.py
resources/awsOperation.py
+4
-4
resources/wordsMappingModel.py
resources/wordsMappingModel.py
+47
-0
resources/wordsProcessModel.py
resources/wordsProcessModel.py
+5
-19
No files found.
resources/__pycache__/speechExtraction.cpython-38.pyc
View file @
0c658a5c
No preview for this file type
resources/awsOperation.py
View file @
0c658a5c
...
...
@@ -4,8 +4,8 @@ import numpy as np
class
AwsOperation
:
def
__init__
(
self
,
bucket_name
):
self
.
bucket_name
=
bucket_name
def
__init__
(
self
):
pass
def
s3_connector
(
self
):
...
...
@@ -13,5 +13,5 @@ class AwsOperation:
aws_access_key_id
=
"AKIAWAP4EPNHCC6BXFXV"
,
aws_secret_access_key
=
"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"
,
)
s3
=
session
.
resource
(
's3'
)
return
s3
.
Bucket
(
self
.
bucket_name
)
\ No newline at end of file
return
session
.
resource
(
's3'
)
# return s3.Bucket(self.bucket_name)
\ No newline at end of file
resources/wordsMappingModel.py
0 → 100644
View file @
0c658a5c
from
.awsOperation
import
AwsOperation
from
moviepy.editor
import
*
from
loguru
import
logger
import
os
import
json
import
cv2
import
numpy
as
np
import
glob
# pamalcodex
class
WordMapping
:
def
__init__
(
self
,
filtered_sentence
):
self
.
filtered_sentence
=
filtered_sentence
def
words_map_with_gestures
(
self
):
try
:
clip_arr
=
[]
aws
=
AwsOperation
()
s3_session
=
aws
.
s3_connector
()
bucket
=
s3_session
.
Bucket
(
'rpserverone'
)
extension
=
".mp4"
for
i
in
range
(
0
,
len
(
self
.
filtered_sentence
)):
print
(
type
(
i
))
print
(
str
(
self
.
filtered_sentence
[
i
])
+
extension
)
bucket
.
download_file
(
str
(
self
.
filtered_sentence
[
i
])
+
extension
,
'D:/s3_tute/'
+
str
(
self
.
filtered_sentence
[
i
])
+
extension
)
for
filename
in
glob
.
glob
(
'D:/s3_tute/*.mp4'
):
clip
=
VideoFileClip
(
filename
)
clip_arr
.
append
(
clip
)
final
=
concatenate_videoclips
(
clip_arr
)
final
.
write_videofile
(
"assets/final_video/final_out.mp4"
)
s3_session
.
meta
.
client
.
upload_file
(
"assets/final_video/final_out.mp4"
,
"pamalcodex"
,
"final_out.mp4"
)
os
.
remove
(
os
.
path
.
join
(
"D:/rp_server_one/assets/final_video"
,
"final_out.mp4"
))
except
Exception
as
e
:
logger
.
error
(
str
(
e
))
return
json
.
loads
(
json
.
dumps
({
"message"
:
str
(
e
)})),
500
\ No newline at end of file
resources/wordsProcessModel.py
View file @
0c658a5c
from
nltk.tokenize
import
word_tokenize
from
loguru
import
logger
from
.awsOperation
import
AwsOperation
from
.wordsMappingModel
import
WordMapping
from
moviepy.editor
import
*
import
os
import
json
import
cv2
import
numpy
as
np
import
glob
from
moviepy.editor
import
*
class
WordModel
:
...
...
@@ -39,24 +41,8 @@ class WordModel:
if
w
not
in
stop_words
:
filtered_sentence
.
append
(
w
)
aws
=
AwsOperation
(
'rpserverone'
)
bucket
=
aws
.
s3_connector
()
extension
=
".mp4"
# sign_names = ["this", "beautiful", "day"]
for
i
in
range
(
0
,
len
(
filtered_sentence
)):
print
(
type
(
i
))
print
(
str
(
filtered_sentence
[
i
])
+
extension
)
bucket
.
download_file
(
str
(
filtered_sentence
[
i
])
+
extension
,
'D:/s3_tute/'
+
str
(
filtered_sentence
[
i
])
+
extension
)
for
filename
in
glob
.
glob
(
'D:/s3_tute/*.mp4'
):
clip
=
VideoFileClip
(
filename
)
clip_arr
.
append
(
clip
)
final
=
concatenate_videoclips
(
clip_arr
)
final
.
write_videofile
(
"final_out.mp4"
)
word_mapper
=
WordMapping
(
filtered_sentence
)
word_mapper
.
words_map_with_gestures
()
return
json
.
loads
(
json
.
dumps
({
"filtered_words"
:
filtered_sentence
,
...
...
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