Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
6f0dd0d
Perform vector search to get label_id if not provided in request
gkourie Dec 10, 2024
d956947
Add test case for vector search without hnsw index
gkourie Dec 10, 2024
e2c26c2
Add vector search helper functions
gkourie Dec 11, 2024
d838cb2
Use Dynamic Index Switching in vector search
gkourie Dec 11, 2024
f441d15
Move vector search functions to controller
gkourie Dec 18, 2024
a6410b3
Define new attribute for Annotation model to attach multiple labels t…
gkourie Dec 19, 2024
ca8c43a
Add new request format for storing annotation without label_id
gkourie Dec 19, 2024
6df585f
Remove feature vector rule
gkourie Dec 19, 2024
8ffba23
Attach full label models to the labelBOTlabels
gkourie Dec 20, 2024
4945ba0
Avoid adding the subquery to the query as a string
gkourie Dec 20, 2024
ae7d882
Refactor Code and expand documentation
gkourie Dec 20, 2024
296d0f9
Implement annotation-store rules directly in StoreImageAnnotation
gkourie Dec 20, 2024
602b253
Expand labelbot config comments
gkourie Dec 20, 2024
89bc3c8
Fix lint
gkourie Dec 20, 2024
bb3c221
Use WhereIn to get the labelBOTlabels
gkourie Jan 7, 2025
11989cd
Append labelBOTlabels attribute only to the response of the store() c…
gkourie Jan 7, 2025
87ed509
Implement the HNSW drop and rollback logic
gkourie Jan 8, 2025
915438e
Fix lint
gkourie Jan 8, 2025
802764d
Fix store feature vector test case
gkourie Jan 8, 2025
8fafb6e
Set HNSW search paramter to K
gkourie Jan 9, 2025
99ad2f3
Delete unnecessary index existence check
gkourie Jan 9, 2025
bdc02fd
Make index name unconfigurable
gkourie Jan 10, 2025
c8130c5
Add LabelBOT button
gkourie Jan 29, 2025
1f1a513
Fix wrong scss class import
gkourie Jan 30, 2025
128855c
Fix activation/deactivation logic of LabelBOT
gkourie Jan 30, 2025
3a18573
Make drawing possible when LabelBOT is on
gkourie Jan 31, 2025
f5120cb
Fix handle LabelBOT method name
gkourie Jan 31, 2025
2093bc9
Use another canvas to save image for LabelBOT
gkourie Feb 2, 2025
486375f
WIP LabelBOT logic
gkourie Feb 3, 2025
9a2d2de
Fix error loading image which was caused by an empty line in labelbot…
gkourie Feb 5, 2025
24e0d60
Merge branch 'master' into labelbot
gkourie Feb 5, 2025
8716cf7
Add onnx dependency
gkourie Feb 5, 2025
fd7695d
Fix lint-js
gkourie Feb 5, 2025
d4f6445
WIP LabelBOT popover
gkourie Feb 20, 2025
f1b13ec
Implement labelBOT popover
gkourie Mar 3, 2025
182489a
Import labelBOT popup correctly
gkourie Mar 3, 2025
559a1dd
Use Typeahead for the LabelBOT popup input search
gkourie Mar 4, 2025
bea432b
Listen to focus event instead of typing in LabelBOT typeahead
gkourie Mar 4, 2025
92b41ab
Fix label re-attach when searching for top 1 label
gkourie Mar 4, 2025
945a2a2
Integrate labelBOT popup into annotator container
gkourie Mar 5, 2025
6de7948
Reset drawing interaction when maximum number of labelBOT's requests …
gkourie Mar 12, 2025
f68996a
Fix labelBOT's max number of requests message
gkourie Mar 12, 2025
8976b0b
Hide LabelBOT popup when deleting top 1 label's annotation from Annot…
gkourie Mar 12, 2025
0afe1b3
Set LabelBOT labels only when labelBOT is on
gkourie Mar 12, 2025
0947824
Set configurable max number of labelBOT's requests
gkourie Mar 12, 2025
5960c34
Fix php coding style
gkourie Mar 12, 2025
d8e7454
Implement LabelBOT indicator
gkourie Mar 13, 2025
8db7ae7
Add LabelBOT indicator assets
gkourie Mar 13, 2025
23aa975
Add python script to export the onnx model for labelBOT
gkourie Apr 1, 2025
b08c44e
Add new API Endpoint to stream LabelBOT's onnx model
gkourie Apr 2, 2025
00bb7ab
Deselect the selected label automatically when LabelBOT is activated …
gkourie Apr 3, 2025
82fac19
Update LabelBOT change event
gkourie Apr 4, 2025
e3e1d1a
Add Labelbot mixins
gkourie Apr 7, 2025
6bf2b78
Include missing labelbot mixin
gkourie Apr 7, 2025
2ee5616
Cache labelBOT's onnx model
gkourie Apr 7, 2025
6bd4bf0
Fix some annotation tool can't be selected though labelBOT is on
gkourie Apr 7, 2025
f94d3a4
make temporary annotation shown until the annotation is saved when La…
gkourie Apr 7, 2025
083cfb1
Fix some annotation tool that can be selected though LabelBOT is busy
gkourie Apr 8, 2025
a4a15eb
Connect the annotation to LabelBOT's popup with dashed line
gkourie Apr 14, 2025
e47a051
Refactor LabelBOT's code
gkourie Apr 14, 2025
d8fd937
Focus LabelBOT popup on click
gkourie Apr 15, 2025
b21c5e7
Refactor LabelBOT mixin
gkourie Apr 15, 2025
22624cb
Init LabelBOT's onnx model only when LabelBOT is on
gkourie Apr 23, 2025
711eb31
Stop LabelBOT' progress bar when hovering over the labels
gkourie Apr 23, 2025
181edb5
Turn off LabelBOT when loading the onnx model fails
gkourie Apr 23, 2025
4754d95
Set LAbelBOT's popup width to 300px
gkourie Apr 23, 2025
fb9dd49
Add readme and requirements for the onnx export script
gkourie Apr 23, 2025
36fdbff
Remove LabelBOT's onnx model API Controller
gkourie Apr 25, 2025
7493043
Normalize the input image before generating the feature vector for La…
gkourie Apr 25, 2025
2e6b27c
Add Keybord shortcuts for LabelBOT popups
gkourie May 9, 2025
94108dc
Merge remote-tracking branch 'origin/master' into labelbot
gkourie May 19, 2025
0bd63d5
Adjust LabelBOT's emits
gkourie May 12, 2025
0ecef46
Remove LabelBOT's popups when switching images
gkourie May 13, 2025
8ffa0ad
Fix vite cors for onnx-model
gkourie May 19, 2025
2a652aa
Add grap area to LabelBOT's popups
gkourie May 14, 2025
03c4b2d
Fix ImageAnnotationLabelFeatureVector import
gkourie May 19, 2025
ecef2b7
Update LabelBOT indicator style
mzur May 20, 2025
085b37a
Add warm up step to LabelBOT model
gkourie May 20, 2025
a52d07a
Fix LabelBOt's Popup Enter event
gkourie May 20, 2025
dd44a9c
Update package-lock.json
gkourie May 20, 2025
648c89c
Centrize the LabelBOT indicator
gkourie May 20, 2025
710d3ab
Clean up LabelBOT code
gkourie May 20, 2025
120d1e4
Use onnx url instead of onnx file
gkourie May 20, 2025
911cf87
Use watcher for LabelBOT's popup removal when switching images
gkourie May 20, 2025
6a8f2ed
Adjust promise chain indentation
gkourie May 20, 2025
ab2d347
Use Enum for LabelBOT states
gkourie May 20, 2025
ccdf357
Init LabelBOT's overlays when it's on
gkourie May 21, 2025
0f53b3a
Replace LabelBOT's state with Enum overall
gkourie May 21, 2025
dd4a127
Fix LabelBOT messages when using annotating tools
gkourie May 21, 2025
cd87172
Disable LabelBOT toggle when no labels are available
gkourie May 21, 2025
73378e7
Use source image direcly to extract annotation data for LabelBOT
gkourie May 21, 2025
070b2ca
Use refs to clear selected label when LabelBOT is turned on
gkourie May 21, 2025
454ea32
Refactor LabelBOT logic
gkourie May 22, 2025
d25b2da
Set proper title to LabelBOT's toggle button when disabled
gkourie May 22, 2025
8f11027
Fix overlay position for LineString shape annotation
gkourie May 23, 2025
6760b02
Handle the case where LabelBOT does not return any results
gkourie May 23, 2025
fbcb84e
Fix LabelBOT's LabelId
gkourie May 30, 2025
7f02edb
Cleanup LabelBOTs code
gkourie Jun 3, 2025
663947a
Ignore LabelBOT Popup's typeahead when using arrow key bindings tempo…
gkourie Jun 3, 2025
4b4acb7
Fix LabelBOT indicator box padding
gkourie Jun 3, 2025
fdf2244
Start drawing LabelBOT popup line from farthes right vertex
gkourie Jun 4, 2025
ac42868
Set a propriate LabelBOT toggle title
gkourie Jun 4, 2025
da458a5
LabelBOT cleanup
gkourie Jun 4, 2025
9e8b89e
Disable LabelBOT if there are no annotations in the project
gkourie Jun 5, 2025
3b08d02
Show LabelBOT popup when it's disabled during computing
gkourie Jun 5, 2025
1766e45
Set chache variable to track pending LabelBOT requests
gkourie Jun 7, 2025
76d2e2b
Add HNSW creation migration file with show progress Command
gkourie Jun 7, 2025
fcbcc92
Composer fix
gkourie Jun 7, 2025
ca79327
Cleanup LabelBOT backend code.
gkourie Jun 16, 2025
6212740
Fix LabelBOT rate limit is not reached
gkourie Jun 16, 2025
3253c3b
Add semicolon
gkourie Jun 16, 2025
6a06807
Merge remote-tracking branch 'origin/master' into labelbot
gkourie Jun 16, 2025
3aa326c
Set the correct focused LabelBOT popup key when deleting some popup
gkourie Jun 16, 2025
1d9ecd2
Add Top-N key bindings to LabelBOT popup
gkourie Jun 17, 2025
9ffb447
Add visual effect when LAbelBOT popup is focused
gkourie Jun 17, 2025
ba51328
Fix LabelBOT labels deletion method
gkourie Jun 18, 2025
32b0726
sMake LabelBOT popups draggable
gkourie Jun 18, 2025
266fc95
Tweak LabelBOT popup focused and highlight styles
mzur Jun 20, 2025
e3857fb
Simplify LabelBOT popup template and CSS
mzur Jun 20, 2025
9e59cdb
Add title attributes to LabelBOT popup
mzur Jun 20, 2025
f322705
Tweak LabelBOT popup event handling
mzur Jun 20, 2025
f42e80d
Make LabelBOT popup arrow key shortcuts cyclic
mzur Jun 20, 2025
78a1306
Remove overflow hidden from LabelBOT popup so label items in the drop…
gkourie Jun 23, 2025
2c9a6ed
Disable progress bar when dragging LabelBOT Popup
gkourie Jun 23, 2025
32f27ae
Disable LabelBOT when no annotations are associated with any labels o…
gkourie Jun 23, 2025
0225f05
Allow users to create max 20 LabelBOT popups instead of 5
gkourie Jun 23, 2025
733d070
Improve UI of LabelBOT button and indicator
mzur Jun 25, 2025
6059c1a
WIP move LabelBOT popup logic to component
mzur Jun 25, 2025
cf4f66a
Remove unneeded code
mzur Jun 25, 2025
a3c5351
Add LabelBOT section to the manual
gkourie Jun 25, 2025
caf7c9b
Move LabelBOT popup drag logic to component
mzur Jul 1, 2025
667c970
Finish LabelBOT popup dragging behavior
mzur Jul 2, 2025
71e2767
Fix LabelBOT popup timeout again
mzur Jul 2, 2025
ce5a58c
Fix automatic removal of LabelBOT popups
mzur Jul 2, 2025
a8324da
Improve closing of LabelBOT popups on image change
mzur Jul 2, 2025
3d6afee
Move annotationCanvas LabelBOT stuff to mixin
mzur Jul 2, 2025
fc91bae
Fix cleanup of keyboard shortcuts
mzur Jul 2, 2025
676ae88
Adjust default values
mzur Jul 2, 2025
b9f39d6
Remove LabelBotPopup model
mzur Jul 2, 2025
830df13
Implement new LabelBOT popup Esc key behavior
mzur Jul 2, 2025
a2fd109
Fix LabelBOT popup number key behavior
mzur Jul 2, 2025
965a934
Refactor client implementation of LabelBOT request limit
mzur Jul 2, 2025
9fcc7d2
Move more methods to mixin
mzur Jul 2, 2025
7686d6c
Fix linter errors
mzur Jul 2, 2025
bcc3c4a
Enable LabelBOT even if no annotations exist
mzur Jul 2, 2025
b2c9962
Fix CS
mzur Jul 2, 2025
7733fef
Move LabelBOT toggle title logic to labelsTab component
mzur Jul 2, 2025
91d7822
Improve new annotation feature vector validation
mzur Jul 2, 2025
63dc38a
WIP Implement experimental LabelBOT inference via web worker
mzur Jul 2, 2025
f118dcc
Fix web worker in dev environment
mzur Jul 3, 2025
836ef00
Fix issue with config URL
mzur Jul 3, 2025
8afd4a4
Tweak temporary style of LabelBOT annotations
mzur Jul 3, 2025
8a78629
Update LabelBOT popup line on feature change
mzur Jul 3, 2025
43bb3f9
Remove unused variable
mzur Jul 3, 2025
4695392
Fix reset of interaction mode when it should not reset
mzur Jul 3, 2025
8ca6b89
Fix vanishing temporary LabelBOT annotations
mzur Jul 4, 2025
88130b3
Merge pull request #1207 from biigle/labelbot-refactor
mzur Jul 4, 2025
8a49458
Fix closing of LabelBOT popup on annotation deletion
mzur Jul 4, 2025
59e68ce
Optimize temporary LabelBOT canvas
mzur Jul 4, 2025
11fd792
Reject new annotations while LabelBOT is initializing
mzur Jul 4, 2025
0ae69a1
Fix keeping LabelBOT enabled on image switch
mzur Jul 4, 2025
39e772a
Disable LabelBOT on tiled images
mzur Jul 4, 2025
786d158
Initially highlight label 0 in LabelBOT popup
mzur Jul 4, 2025
70f10e8
Use Backspace instead of Del for LabelBOT popup
mzur Jul 4, 2025
58baa5b
Fix removal of keyboard shortcut listeners
mzur Jul 8, 2025
c445897
Implement LabelBOT popup events
mzur Jul 8, 2025
1932b88
Fix handling of missing ONNX file for LabelBOT
mzur Jul 9, 2025
c835090
Fix cancel progress on mouseover over the first label
mzur Jul 9, 2025
0292408
Implement labelbot.show_button config option
mzur Jul 9, 2025
12092b4
Replace create index migration with console command
mzur Jul 9, 2025
f003953
Finish LabelBOT manual article
mzur Jul 9, 2025
28914a8
Fix LabelBOT if user can't annotate
mzur Jul 9, 2025
1882a8f
Acutally fic LabelBOT if user can't annotate
mzur Jul 9, 2025
862ba39
Implement "Backquote" shortcut to toggle LabelBOT
mzur Jul 10, 2025
a55f825
Cancel LabelBOT timeout only after 250ms over popup
mzur Jul 15, 2025
f046f72
Improve contrast of LabelBOT popup progress bar
mzur Jul 15, 2025
59ce560
Show LabelBOT progress bar only in focused popup
mzur Jul 15, 2025
aa50343
Fix keyboard codes listeners
mzur Jul 15, 2025
b521a28
Update LabelBOT popup grab area
mzur Jul 15, 2025
67e45c1
Remove arrow shortcuts and improve attention detection in popup
mzur Jul 15, 2025
c6766ea
Improve LabelBOT popup grab area UI
mzur Jul 15, 2025
35dd88c
Add Esc to leave LabelBOT popup typeahead
mzur Jul 15, 2025
dbd14fe
Improve LabelBOT button info text
mzur Jul 15, 2025
6a43764
Ensure LabelBOT popup visibility at the edges of the viewport
mzur Jul 15, 2025
38b7021
Implement limit for number of open LabelBOT popups
mzur Jul 15, 2025
8b942a4
Add LabelBOT popup timeout settings
mzur Jul 15, 2025
36e8dd1
Fix edge case in LabelBOT popup positioning
mzur Jul 16, 2025
4ba6ade
Tweak LabelBOT manual article
mzur Jul 16, 2025
fa10535
Improve focus state between first label and typeahead
mzur Jul 17, 2025
6715919
Improve labelbot:index-progress command
mzur Jul 30, 2025
3acfd2b
Implement labelbot.ignore_label_trees config option
mzur Jul 30, 2025
7b386cd
Move LabelBOT cache counter logic inside if branch
mzur Jul 31, 2025
5a944ef
Only query labels if LabelBOT was used
mzur Jul 31, 2025
998b32b
Tweak LabelBOT error behavior
mzur Jul 31, 2025
9a9df37
Implement options for labelbot:create-index command
mzur Aug 26, 2025
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
86 changes: 55 additions & 31 deletions app/Http/Controllers/Api/ImageAnnotationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,13 @@ public function store(StoreImageAnnotation $request)
if (is_null($labelId) && $request->has('feature_vector')) {
// Get label tree id(s).
$trees = $this->getLabelTreeIds($request->user(), $image->volume_id);
// Perform ANN search.
$topNLabels = $this->performAnnSearch($request->input('feature_vector'), $trees);
// Perform KNN search as a fallback if ANN search returns no results.
if (empty($topNLabels)) {
$topNLabels = $this->performKnnSearch($request->input('feature_vector'), $trees);
}

// Convert the feature vector into a Vector object for compatibility with the query.
$featureVector = new Vector($request->input('feature_vector'));

// Perform vector search.
$topNLabels = $this->performVectorSearch($featureVector, $trees, $topNLabels);

// Set labelId to top 1 label.
$labelId = $topNLabels[0];
}
Expand All @@ -259,7 +260,7 @@ public function store(StoreImageAnnotation $request)

// Attach the other two labels if they exist.
for ($i = 1; $i < count($topNLabels); $i++) {
$annotation->labelBOTLabels[] = $topNLabels[$i];
$annotation->labelBOTLabels[] = Label::findOrFail($topNLabels[$i]);
}

return $annotation;
Expand Down Expand Up @@ -396,27 +397,52 @@ protected function getLabelTreeIds($user, $volumeId)
}

/**
* Perform ANN search (HNSW + Post-Subquery-Filtering).
* Perform vector search using the Dynamic Index Switching (DIS) technique.
*
* @param vector $featureVector
* @param int[] $trees
* The search process first attempts to retrieve results using an Approximate Nearest Neighbor (ANN) search
* via the HNSW index. If the ANN search returns no results, it falls back to an exact KNN search using the
* B-Tree index for filtering, ensuring that results are always returned.
*
* @return array
* @param vector $featureVector The input feature vector to search for nearest neighbors.
* @param int[] $trees The label tree IDs to filter the data by.
* @param int[] $topNLabels The array to store the top N labels based on the search results.
*
* @return array The array of top N labels that are the closest to the input feature vector.
*/
protected function performAnnSearch($featureVector, $trees)
protected function performVectorSearch($featureVector, $trees, $topNLabels)
{
$featureVector = new Vector($featureVector);
// Perform ANN search.
$topNLabels = $this->performAnnSearch($featureVector, $trees);

// Perform KNN search as a fallback if ANN search returns no results.
if (empty($topNLabels)) {
$topNLabels = $this->performKnnSearch($featureVector, $trees);
}

return $topNLabels;
}

/**
* Perform Approximate Nearest Neighbor (ANN) search using the HNSW index with Post-Subquery Filtering (PSF).
*
* The search uses the HNSW index to find the top K nearest neighbors of the input feature vector,
* and then applies filtering based on the label_tree_id values. If no results are found or if the filtering
* removes all results, an empty array is returned.
*
* @param Vector $featureVector The input feature vector to search for nearest neighbors.
* @param int[] $trees The label tree IDs to filter the data by.
*
* @return array The array of label IDs representing the top nearest neighbors.
*/
protected function performAnnSearch($featureVector, $trees)
{
$subquery = ImageAnnotationLabelFeatureVector::select('label_id', 'label_tree_id')
->selectRaw('(vector <=> ?) AS distance', [$featureVector])
->orderBy('distance')
// K = 100
->limit(config('labelbot.K'));
->limit(config('labelbot.K')); // K = 100

return DB::table(DB::raw("({$subquery->toSql()}) as subquery"))
->setBindings([$featureVector])
return DB::query()->fromSub($subquery, 'subquery')
->whereIn('label_tree_id', $trees)
->select('label_id')
->groupBy('label_id')
->orderByRaw('MIN(distance)')
->limit(config('labelbot.N')) // N = 3
Expand All @@ -425,31 +451,29 @@ protected function performAnnSearch($featureVector, $trees)
}

/**
* Perform KNN search (B-Tree + Post-Filtering).
* Perform exact KNN search using the B-Tree index for filtering.
*
* @param Vector $featureVector
* @param int[] $trees
* This search filters the data based on label_tree_id using the B-Tree index,
* and then performs the vector search to find the nearest neighbors of the input feature vector.
* This method is used as a fallback when the ANN search does not return results.
*
* @return array
*/
* @param Vector $featureVector The input feature vector to search for nearest neighbors.
* @param int[] $trees The label tree IDs to filter the data by.
*
* @return array The array of label IDs representing the top nearest neighbors.
*/
protected function performKnnSearch($featureVector, $trees)
{
$featureVector = new Vector($featureVector);

$subquery = ImageAnnotationLabelFeatureVector::select('label_id', 'label_tree_id')
->selectRaw('(vector <=> ?) AS distance', [$featureVector])
// filter by label tree id in subquery
// to use B-Tree index for filtering and speeding up the vector search
->whereIn('label_tree_id', $trees)
->whereIn('label_tree_id', $trees) // Apply label tree ID filter in the subquery to use the B-Tree index for faster filtering
->orderBy('distance')
->limit(config('labelbot.K')); // K = 100

// TODO: Drop HNSW index temporary
// DB::beginTransaction();

$topNLabels = DB::table(DB::raw("({$subquery->toSql()}) as subquery"))
->setBindings(array_merge([$featureVector], $trees))
->select('label_id')
$topNLabels = DB::query()->fromSub($subquery, 'subquery')
->groupBy('label_id')
->orderByRaw('MIN(distance)')
->limit(config('labelbot.N')) // N = 3
Expand Down
10 changes: 7 additions & 3 deletions app/Http/Requests/StoreImageAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Biigle\Image;
use Biigle\Shape;
use Illuminate\Foundation\Http\FormRequest;

class StoreImageAnnotation extends StoreImageAnnotationLabelFeatureVector
class StoreImageAnnotation extends FormRequest
{
/**
* The image on which the annotation should be created.
Expand Down Expand Up @@ -33,10 +34,13 @@ public function authorize()
*/
public function rules()
{
return array_merge(parent::rules(), [
return [
'label_id' => 'required_without:feature_vector|integer|exists:labels,id',
'feature_vector' => 'required_without:label_id|array|size:384',
'confidence' => 'required|numeric|between:0,1',
'shape_id' => 'required|integer|exists:shapes,id',
'points' => 'required|array',
]);
];
}

/**
Expand Down
51 changes: 0 additions & 51 deletions app/Http/Requests/StoreImageAnnotationLabelFeatureVector.php

This file was deleted.

17 changes: 15 additions & 2 deletions config/labelbot.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,25 @@
return [

/*
| K for KNN
|--------------------------------------------------------------------------
| K for KNN (K-Nearest Neighbors)
|--------------------------------------------------------------------------
|
| The value of K determines the number of nearest neighbors to consider
| when performing a KNN search. This is used in both Approximate
| Nearest Neighbor (ANN) and Exact KNN searches.
*/
'K' => 100,

/*
| N for top N labels
|--------------------------------------------------------------------------
| N for Top N Labels
|--------------------------------------------------------------------------
|
| The value of N specifies how many top labels should be returned from
| the search results. After performing a KNN or ANN search, the top N
| labels (based on their distance to the query vector) will be selected
| and returned.
*/
'N' => 3,
];
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,12 @@ public function testStoreWithFeatureVectorWithoutHNSW()
$response->assertSuccessful();
// The feature vector of differentLabel is more similar to the input feature vector
// than feature vector of anotherDifferentLabel, so it is ranked higher.
$response->assertJsonFragment(['labelBOTLabels' => [$differentLabel->id, $anotherDifferentLabel->id]]);
$response->assertJsonFragment([
'labelBOTLabels' => [
['id' => $differentLabel->id],
['id' => $anotherDifferentLabel->id],
]
]);
}

public function testStoreValidatePoints()
Expand Down
Loading