Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-077
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
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
2020-077
2020-077
Commits
acfa9f08
Commit
acfa9f08
authored
Nov 05, 2020
by
Bavanraj
Committed by
Manoj Kumar
Nov 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bavan dev
parent
29bbfcb7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
381 deletions
+39
-381
translation/Readme.txt
translation/Readme.txt
+0
-1
translation/Sign Language.ipynb
translation/Sign Language.ipynb
+0
-374
translation/cam.py
translation/cam.py
+34
-0
translation/path_test.py
translation/path_test.py
+0
-4
translation/trans.py
translation/trans.py
+5
-2
No files found.
translation/Readme.txt
deleted
100644 → 0
View file @
29bbfcb7
Translating the signs.
\ No newline at end of file
translation/Sign Language.ipynb
deleted
100644 → 0
View file @
29bbfcb7
This diff is collapsed.
Click to expand it.
translation/cam.py
0 → 100644
View file @
acfa9f08
import
cv2
#def to take webcam pics
def
myCam
():
cam
=
cv2
.
VideoCapture
(
0
)
cv2
.
namedWindow
(
"test"
)
img_counter
=
0
while
True
:
ret
,
frame
=
cam
.
read
()
if
not
ret
:
print
(
"failed to grab frame"
)
break
cv2
.
imshow
(
"test"
,
frame
)
k
=
cv2
.
waitKey
(
1
)
if
k
%
256
==
27
:
# ESC pressed
print
(
"Escape hit, closing..."
)
break
elif
k
%
256
==
32
:
# SPACE pressed
img_name
=
"opencv_frame_{}.png"
.
format
(
img_counter
)
cv2
.
imwrite
(
img_name
,
frame
)
print
(
"{} written!"
.
format
(
img_name
))
img_counter
+=
1
cam
.
release
()
cv2
.
destroyAllWindows
()
return
translation/path_test.py
deleted
100644 → 0
View file @
29bbfcb7
import
os
import
os
PATH
=
os
.
path
.
dirname
(
__file__
)
print
(
PATH
+
'/converted_keras/keras_model.h5'
)
\ No newline at end of file
translation/trans.py
View file @
acfa9f08
...
...
@@ -6,20 +6,23 @@ import numpy as np
np
.
set_printoptions
(
suppress
=
True
)
# Load the model
model
=
tensorflow
.
keras
.
models
.
load_model
(
'C:/Users/user/Documents/GitHub/2020_077/translation/converted_keras
(2)
/keras_model.h5'
)
model
=
tensorflow
.
keras
.
models
.
load_model
(
'C:/Users/user/Documents/GitHub/2020_077/translation/converted_keras/keras_model.h5'
)
# Create the array of the right shape to feed into the keras model
# The 'length' or number of images you can put into the array is
# determined by the first position in the shape tuple, in this case 1.
data
=
np
.
ndarray
(
shape
=
(
1
,
224
,
224
,
3
),
dtype
=
np
.
float32
)
#data = np.ndarray(shape=(1, 480, 640, 3), dtype=np.float32)
# Replace this with the path to your image
image
=
Image
.
open
(
'C:/Users/user/
Pictures/Camera Roll/test55.jp
g'
)
image
=
Image
.
open
(
'C:/Users/user/
Documents/GitHub/2020_077/opencv_frame_0.pn
g'
)
# resize the image to a 224x224 with the same strategy as in TM2:
# resizing the image to be at least 224x224 and then cropping from the center
size
=
(
224
,
224
)
#size = (640, 480)
image
=
ImageOps
.
fit
(
image
,
size
,
Image
.
ANTIALIAS
)
# turn the image into a numpy array
...
...
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