Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ All notable changes to this project will be documented here.

Nothing yet.

## [0.16.1] - Jan 13th, 2025
- Added `click_and_drag_poly_annotations` flag to the configuration object, that when set to false prevents continuous points from being added to a polyline or polygon annotations when clicking and dragging.

## [0.16.0] - Nov 8th, 2024
- Added loading overlay with spinning icon while ULabel is initializing
- Moved several existing utilties (mostly static methods) to isolated files:
Expand Down
3 changes: 3 additions & 0 deletions api_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ Keybind to decrease the brush size. Default is `[`. Requires the active subtask
### `n_annos_per_canvas`
The number of annotations to render on a single canvas. Default is `100`. Increasing this number may improve performance for jobs with a large number of annotations.

### `click_and_drag_poly_annotations`
If true, the user can click and drag to contiuously place points for polyline and polygon annotations. Default is `true`.


## Display Utility Functions

Expand Down
1 change: 1 addition & 0 deletions demo/multi-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
],
"toggle_brush_mode_keybind": "f",
"create_bbox_on_initial_crop": "|",
"click_and_drag_poly_annotations": false,
});
// Wait for ULabel instance to finish initialization
ulabel.init(function () {
Expand Down
2 changes: 1 addition & 1 deletion dist/ulabel.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ulabel.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ulabel",
"description": "An image annotation tool.",
"version": "0.16.0",
"version": "0.16.1",
"main": "dist/ulabel.js",
"module": "dist/ulabel.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export class Configuration {

public n_annos_per_canvas: number = DEFAULT_N_ANNOS_PER_CANVAS;

public click_and_drag_poly_annotations: boolean = true;

constructor(...kwargs: { [key: string]: unknown }[]) {
this.modify_config(...kwargs);
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3974,7 +3974,7 @@ export class ULabel {
// If this mouse event is a click, add a new member to the list of keypoints
// ender clicks are filtered before they get here
add_keypoint = true;
if (isclick || is_click_dragging) {
if (isclick || (is_click_dragging && this.config.click_and_drag_poly_annotations)) {
if (n_kpts === 0) {
// If no keypoints, then we create an ender at the mouse position
// this.create_polygon_ender(gmx, gmy, actid);
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ULABEL_VERSION = "0.16.0";
export const ULABEL_VERSION = "0.16.1";
Loading