Skip to content

Commit

Permalink
increased the confidence threshold of the YOLO model to prevent overl…
Browse files Browse the repository at this point in the history
…apping labels and prevented navigator from investigating large objects when running in the simulation evenironment
  • Loading branch information
DaniParr committed Sep 6, 2024
1 parent 20c1958 commit 01bbfbb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<arg name="out_topic_model1" default="detections_model1" />
<arg name="out_topic_model2" default="detections_model2" />
<arg name="out_topic_model3" default="stc_detections_model" />
<arg name="conf_thresh" default="0.25" />
<arg name="conf_thresh" default="0.7" />
<arg name="image_size" default="640" />
<arg name="device" default="cpu" />
<arg name="use_yolo_model1" default="False" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,26 @@ async def explore_closest_until(self, is_done, filter_and_sort):
# and find closest one within 25 meters (max width of a gate).
if cone_buoys_investigated > 0 and potential_candidate is None:
for i in range(len(objects)):
print(positions[i])
obj_vol = (
objects[i].scale.x * objects[i].scale.y * objects[i].scale.z
)

# Catch case where we invesitegate the shore
if obj_vol > 3:
print(
f"Object {i} volume: ",
objects[i].scale.x
* objects[i].scale.y
* objects[i].scale.z,
)
continue
else:
print(positions[i])

if (
objects[i].id not in investigated
and "round" not in objects[i].labeled_classification
and obj_vol < 3
):
distance = np.linalg.norm(positions[i] - self.pose[0])
if distance < shortest_distance and distance <= 25:
Expand All @@ -308,9 +324,24 @@ async def explore_closest_until(self, is_done, filter_and_sort):
# if that doesn't produce any results, literally just go to closest buoy
if potential_candidate is None:
for i in range(len(objects)):
obj_vol = (
objects[i].scale.x * objects[i].scale.y * objects[i].scale.z
)

# Catch case where we invesitegate the shore
if obj_vol > 3:
print(
f"Object {i} volume: ",
objects[i].scale.x
* objects[i].scale.y
* objects[i].scale.z,
)
continue

if (
objects[i].id not in investigated
and "round" not in objects[i].labeled_classification
and obj_vol < 3
):
distance = np.linalg.norm(positions[i] - self.pose[0])
if distance < shortest_distance:
Expand Down

0 comments on commit 01bbfbb

Please sign in to comment.