Skip to content

Commit

Permalink
Detect null results of point detection and skip
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-jeff committed May 29, 2024
1 parent 2e021c5 commit 6853400
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions common/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,6 @@ def find_object_poses(
):
"""Detect objects given network output"""

# run_sampling = True

# Detect objects from belief maps and affinities
objects, all_peaks = ObjectDetector.find_objects(
vertex2,
Expand All @@ -548,12 +546,16 @@ def find_object_poses(
detected_objects = []
obj_name = pnp_solver.object_name

# print(all_peaks)

# print("find_object_poses: found {} objects ================".format(len(objects)))
for obj in objects:
# Run PNP
points = obj[1] + [(obj[0][0] * scale_factor, obj[0][1] * scale_factor)]
if None in points:
print("Incomplete cuboid detection.")
print(" result from detection:", points)
print("Skipping.")
continue

cuboid2d = np.copy(points)
location, quaternion, projected_points = pnp_solver.solve_pnp(points)

Expand Down

0 comments on commit 6853400

Please sign in to comment.