supervision icon indicating copy to clipboard operation
supervision copied to clipboard

fixed a bug in get_data_item for np.array index

Open MoHoss007 opened this issue 1 year ago • 1 comments

Description

fixed a bug in get_data_item for np.array index, there was a bug when trying to mask detections using np.array and the list values in data field were not getting updated properly.

Type of change

Please delete options that are not relevant.

  • [x] Bug fix (non-breaking change which fixes an issue)

How has this change been tested, please provide a testcase or example of how you tested the change.

It was tested as part of my personal project. example:

# detections was created before:
detections.data["test_data"] = [None for _ in range(len(detections))]
detections = detections[detections.confidence > 0.5]
# this would lead to error in validation function without the current changes, since the size of data["test_data"] will not change.

Any specific deployment considerations

N/A

Docs

  • N/A

MoHoss007 avatar Mar 28 '24 00:03 MoHoss007

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 28 '24 00:03 CLAassistant

Hi, @MoHoss007 👋🏻 thanks a lot for your interest in supervision and the time you spend working on this PR. It looks like we just merged alternative PR to solve this issue. You can learn more from the links below.

  • https://github.com/roboflow/supervision/issues/1061
  • https://github.com/roboflow/supervision/pull/1062
  • https://github.com/roboflow/supervision/pull/1063

SkalskiP avatar Mar 28 '24 13:03 SkalskiP