Skip to content

Commit

Permalink
Update bop.py
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
MedericFourmy authored Oct 31, 2023
1 parent 87e3c28 commit 8ada35c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions happypose/pose_estimators/megapose/evaluation/bop.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ def filter_detections_scene_view(scene_id, view_id, df_all_dets, df_targets):
def keep_best_detections(df_dets_scene_img, df_targets_scene_img):
lst_df_target = []
nb_targets = len(df_targets_scene_img)
MARGIN = 0
for it in range(nb_targets):
target = df_targets_scene_img.iloc[it]
n_best = target.inst_count + MARGIN
n_best = target.inst_count
df_filt_target = df_dets_scene_img[df_dets_scene_img['category_id'] == target.obj_id].sort_values('score', ascending=False)[:n_best]
lst_df_target.append(df_filt_target)
if len(df_filt_target) > 0:
lst_df_target.append(df_filt_target)

Check warning on line 315 in happypose/pose_estimators/megapose/evaluation/bop.py

View check run for this annotation

Codecov / codecov/patch

happypose/pose_estimators/megapose/evaluation/bop.py#L307-L315

Added lines #L307 - L315 were not covered by tests

# if missing dets, keep only one detection to avoid downstream error
df_dets_scene_img = pd.concat(lst_df_target) if len(lst_df_target) > 0 else df_dets_scene_img[:1]

Check warning on line 318 in happypose/pose_estimators/megapose/evaluation/bop.py

View check run for this annotation

Codecov / codecov/patch

happypose/pose_estimators/megapose/evaluation/bop.py#L318

Added line #L318 was not covered by tests
Expand Down

0 comments on commit 8ada35c

Please sign in to comment.