Adds a new strategy for selecting the next images to be annotated. When prioritise_unmarked_images=true in the config, the next image will be assigned dynamically, by looking for an image with the fewest number of existing masks.
Old behaviour
When new users signs up, create a randomly shuffled list project.image_order for all images in dataset
get_next_image() selects image that is one after the current image in the list of images.
get_previous_image() does the same in reverse, by reversing the position in the list of images by 1
Leads to random images getting several annotations before other images get any, because order is random for each user.
New behaviour
When prioritise_unmarked_images=true, get_next_image() queries database and finds image with lowest current number of associated masks. Also excludes the current image and the ones the user has already annotated. project.image_ids is updated by swapping the entry of the most high priority image with the ID that would have been next.
get_previous_image() still works by simply reducing the index value by 1. In the immediate aftermath of a single swapping operation it will still work as expected, but after multiple swaps there is no guarantee that the reverse image order will remain fixed.
Now, as users continue annotations, images will be served based on which has the fewest existing annotations, leading to an even spread of work across the dataset.
Summary
Adds a new strategy for selecting the next images to be annotated. When
prioritise_unmarked_images=true
in the config, the next image will be assigned dynamically, by looking for an image with the fewest number of existing masks.Old behaviour
project.image_order
for all images in datasetget_next_image()
selects image that is one after the current image in the list of images.get_previous_image()
does the same in reverse, by reversing the position in the list of images by 1New behaviour
prioritise_unmarked_images=true
,get_next_image()
queries database and finds image with lowest current number of associated masks. Also excludes the current image and the ones the user has already annotated.project.image_ids
is updated by swapping the entry of the most high priority image with the ID that would have been next.get_previous_image()
still works by simply reducing the index value by 1. In the immediate aftermath of a single swapping operation it will still work as expected, but after multiple swaps there is no guarantee that the reverse image order will remain fixed.