* Display result results (from backend or frontend). * * @param {object} results Search result object. Assumed to have the following * fields: * - targetWords {string[]} The target words searched for. * - numSearchedFiles {number} Total number of image files searched over. * - foundIte
(results)
| 94 | * inference. |
| 95 | */ |
| 96 | function displaySearchResults(results) { |
| 97 | hideProgress(); |
| 98 | if (results.foundItems.length === 0) { |
| 99 | showSnackbar( |
| 100 | `No match for "${results.targetWords.join(',')}" ` + |
| 101 | `after searching ${results.numSearchedFiles} file(s). ` + |
| 102 | `Model inference took ${results.tElapsedMillis.toFixed(1)} ms`); |
| 103 | } else { |
| 104 | showSnackbar( |
| 105 | `Found ${results.foundItems.length} ` + |
| 106 | `matches from ${results.numSearchedFiles} image(s). ` + |
| 107 | `Model inference took ${results.tElapsedMillis.toFixed(1)} ms`); |
| 108 | results.foundItems.forEach(foundItem => { |
| 109 | createFoundCard(searchResultsDiv, foundItem); |
| 110 | }); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Display a snackbar message on the screen. |
no test coverage detected