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
531eb043
Commit
531eb043
authored
Jul 12, 2023
by
Paranagama R.P.S.D.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : Run video for all frames & add frame count threshold
parent
48efc63a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Project/Backend/Server_Python/services/translate_service.py
Project/Backend/Server_Python/services/translate_service.py
+7
-1
No files found.
Project/Backend/Server_Python/services/translate_service.py
View file @
531eb043
...
...
@@ -169,11 +169,15 @@ class SignLanguagePredictionService:
frames_per_sign
=
self
.
speed_levels
.
get
(
speed
,
50
)
# Default to level 1 if speed level is not provided
# Loop through the frames of the video
while
frame_count
<
50
:
while
frame_count
<
=
video
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
)
:
success
,
frame
=
video
.
read
()
if
not
success
:
break
# TODO Add to COnfig
if
frame_count
>=
250
:
break
# Preprocess the frame
frame
=
cv2
.
cvtColor
(
frame
,
cv2
.
COLOR_BGR2RGB
)
frame
=
cv2
.
resize
(
frame
,
(
IMG_SIZE
,
IMG_SIZE
))
...
...
@@ -190,6 +194,8 @@ class SignLanguagePredictionService:
# Store the prediction for the frame
predictions
.
append
(
sinhala_letter
)
frame_count
+=
1
# TODO Add to COnfig
threshold_percentage
=
60
# Check if the required number of frames per sign has been reached
...
...
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