Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
von-bis-public
VectorProjects
Yoshi
Commits
1208a28c
Commit
1208a28c
authored
Feb 29, 2020
by
JoelMXLinux
Browse files
Imporved Readabillity
parent
3bd409f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
navigation.py
View file @
1208a28c
...
...
@@ -15,7 +15,8 @@ BALLOON_SIZE_MM = 100
PICTURE_PATH
=
'./balloon_pic.jpg'
MAX_DRIVING_DISTANCE
=
1500
;
AZURE_CONFIG_FILE
=
'./azure_config.txt'
IP_ADDRESS
=
'192.168.0.106'
SERIAL
=
'008014c1'
ROBOT_HEIGHT
=
657
probability
=
0.5
...
...
@@ -73,9 +74,9 @@ if __name__ == '__main__':
Then calling a method to drive to the calculated position.
"""
args
=
anki_vector
.
util
.
parse_command_args
()
with
behavior
.
ReserveBehaviorControl
(
serial
=
'008014c1'
,
ip
=
'192.168.0.106'
):
with
behavior
.
ReserveBehaviorControl
(
serial
=
SERIAL
,
ip
=
IP_ADDRESS
):
with
anki_vector
.
Robot
(
serial
=
'008014c1'
,
name
=
'Vector-N8G2'
,
ip
=
'192.168.0.106'
,
with
anki_vector
.
Robot
(
serial
=
SERIAL
,
name
=
'Vector-N8G2'
,
ip
=
IP_ADDRESS
,
behavior_control_level
=
ControlPriorityLevel
.
OVERRIDE_BEHAVIORS_PRIORITY
)
as
robot
:
robot_initiate
(
robot
)
...
...
object_detection.py
View file @
1208a28c
...
...
@@ -3,7 +3,8 @@ import math
class
ObjectDetection
(
object
):
"""Basic abstract class!
"""
Basic abstract class!
"""
ANCHORS
=
np
.
array
([[
0.573
,
0.677
],
[
1.87
,
2.06
],
[
3.34
,
5.47
],
[
7.88
,
3.53
],
[
9.77
,
9.17
]])
...
...
@@ -29,7 +30,8 @@ class ObjectDetection(object):
return
np
.
where
(
x
>
0
,
1
/
(
1
+
np
.
exp
(
-
x
)),
np
.
exp
(
x
)
/
(
1
+
np
.
exp
(
x
)))
def
_non_maximum_suppression
(
self
,
boxes
,
class_probs
,
max_detections
):
"""Remove overlapping bouding boxes
"""
Remove bounding boxes that go beyond the bounding box limit
"""
assert
len
(
boxes
)
==
len
(
class_probs
)
...
...
@@ -139,7 +141,8 @@ class ObjectDetection(object):
raise
NotImplementedError
def
postprocess
(
self
,
prediction_outputs
):
""" Extract bounding boxes from the model outputs.
"""
Extract bounding boxes from the model outputs.
Args:
prediction_outputs: Output from the object detection model. (H x W x C)
...
...
offline_predict.py
View file @
1208a28c
...
...
@@ -46,6 +46,9 @@ def main(image_filename):
if
__name__
==
'__main__'
:
"""
Testing the Prediction with a Sample Image
"""
if
len
(
sys
.
argv
)
<=
1
:
print
(
'USAGE: {} image_filename'
.
format
(
sys
.
argv
[
0
]))
path
=
'/home/joel/Downloads/IMG_20191020_162221_970.jpg'
...
...
Write
Preview
Supports
Markdown
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