Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Arrays;

/**
* Helper functions for the TensorFlow image classifier.
Expand Down Expand Up @@ -97,7 +98,12 @@ public int compare(Recognition lhs, Recognition rhs) {
}

List<Recognition> results = new ArrayList<>(RESULTS_TO_SHOW);
for (Recognition r: sortedLabels) {
// Array to hold the sorted results from the PQ
Recognition[] sorted_results = sortedLabels.toArray(new Recognition[RESULTS_TO_SHOW]);
// Sort the array based on the PQ's comparator
Arrays.sort(sorted_results, sortedLabels.comparator());

for (Recognition r: sorted_results) {
results.add(0, r);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Arrays;

/**
* Helper functions for the TensorFlow image classifier.
Expand Down Expand Up @@ -97,7 +98,12 @@ public int compare(Recognition lhs, Recognition rhs) {
}

List<Recognition> results = new ArrayList<>(RESULTS_TO_SHOW);
for (Recognition r: sortedLabels) {
// Array to hold the sorted results from the PQ
Recognition[] sorted_results = sortedLabels.toArray(new Recognition[RESULTS_TO_SHOW]);
// Sort the array based on the PQ's comparator
Arrays.sort(sorted_results, sortedLabels.comparator());

for (Recognition r: sorted_results) {
results.add(0, r);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Arrays;

/**
* Helper functions for the TensorFlow image classifier.
Expand Down Expand Up @@ -97,7 +98,12 @@ public int compare(Recognition lhs, Recognition rhs) {
}

List<Recognition> results = new ArrayList<>(RESULTS_TO_SHOW);
for (Recognition r: sortedLabels) {
// Array to hold the sorted results from the PQ
Recognition[] sorted_results = sortedLabels.toArray(new Recognition[RESULTS_TO_SHOW]);
// Sort the array based on the PQ's comparator
Arrays.sort(sorted_results, sortedLabels.comparator());

for (Recognition r: sorted_results) {
results.add(0, r);
}

Expand Down