SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.38k stars 192 forks source link

BUG: NDArray filted_array = ori_array[max_prob > conf_threshold]; #519

Open 1Zengy opened 1 week ago

1Zengy commented 1 week ago

In the C# code, NDArray filted_array = ori_array[max_prob > conf_threshold]; Here, ori_array is an NDArray with a shape of [1, 8400, 5], where 5 represents the five probabilities of 5 classes. max_prob is an NDArray with a shape of [1, 8400], indicating the maximum probability among the 5 classes. conf_threshold is a float value which represents the threshold of probability.

I would like to delete the objects in the 8400 dimension where the maximum probability is lower than the conf_threshold. However, even though I have ensured that ori_array and max_prob have the same values, the code will randomly return either an exact value with a shape of [n, 5] or a null value with a shape of [0, 5]. Here is my data saved using "np.save()". ori_array.json max_prob.json