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
c7b0b64d
Commit
c7b0b64d
authored
Jan 02, 2021
by
Manoj Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing with bavan - file locations
parent
f288dac3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
dataq/detect.py
dataq/detect.py
+14
-5
reveng/pathTester.py
reveng/pathTester.py
+5
-0
No files found.
dataq/detect.py
View file @
c7b0b64d
...
...
@@ -18,10 +18,12 @@ from PIL import Image
from
tensorflow
import
keras
sys
.
path
.
append
(
'.'
)
#from translation.modelUp import sign_predict
from
translation.trans
import
sign_predict
from
translation.trans
import
Translation
from
object_detection.utils
import
label_map_util
from
object_detection.utils
import
visualization_utils
as
vis_util
from
skimage.transform
import
resize
#Set Base Path
PATH
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
...
...
@@ -81,6 +83,8 @@ def run_inference_for_single_image(image, graph):
output_dict
[
'detection_masks'
]
=
output_dict
[
'detection_masks'
][
0
]
return
output_dict
translation
=
Translation
()
#initialize camera
cap
=
cv2
.
VideoCapture
(
0
)
from
PIL
import
Image
...
...
@@ -104,7 +108,7 @@ try:
while
True
:
ret
,
image_np
=
cap
.
read
()
temp_image
=
image_np
.
copy
()
# Expand dimensions since the model expects images to have shape: [1, None, None, 3]
image_np_expanded
=
np
.
expand_dims
(
image_np
,
axis
=
0
)
# Actual detection.
...
...
@@ -125,9 +129,14 @@ try:
###
# I will be sending a POST request to u. a hand picture
if
score
>
80
:
print
(
image_np_expanded
.
shape
)
img
=
Image
.
fromarray
(
image_np
,
'RGB'
)
sign_predict
(
img
)
#print(image_np_expanded.shape)
img
=
Image
.
fromarray
(
temp_image
)
#print(image_np.shape)
img
.
save
(
os
.
getcwd
()
+
"
\\
"
+
"capture.jpg"
)
# array_for_translation = resize(image_np,(224,224,3))
# print(array_for_translation.shape)
translation
.
sign_predict
(
os
.
getcwd
()
+
"
\\
"
+
"capture.jpg"
)
# sign_predict(image_np) <-- still under development
#waiting for the API on that component to be built
# end send request
...
...
reveng/pathTester.py
0 → 100644
View file @
c7b0b64d
import
os
path_to_static
=
os
.
getcwd
()
+
'
\\
static'
print
(
path_to_static
)
\ No newline at end of file
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