mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
testing on one image
This commit is contained in:
@ -73,11 +73,11 @@ float sec(clock_t clocks)
|
||||
void top_k(float *a, int n, int k, int *index)
|
||||
{
|
||||
int i,j;
|
||||
for(j = 0; j < k; ++j) index[j] = 0;
|
||||
for(j = 0; j < k; ++j) index[j] = -1;
|
||||
for(i = 0; i < n; ++i){
|
||||
int curr = i;
|
||||
for(j = 0; j < k; ++j){
|
||||
if(a[curr] > a[index[j]]){
|
||||
if((index[j] < 0) || a[curr] > a[index[j]]){
|
||||
int swap = curr;
|
||||
curr = index[j];
|
||||
index[j] = swap;
|
||||
|
Reference in New Issue
Block a user