Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WS-488] [WS-954] feature/comment #153

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
20 changes: 10 additions & 10 deletions api_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,21 +293,21 @@ URL to a page that gives annotation instructions.
{
default_toolbox_item_order: AllowedToolboxItem[],

default_keybinds = {
"annotation_size_small": string,
"annotation_size_large": string,
"annotation_size_plus": string,
"annotation_size_minus": string,
"annotation_vanish": string
},

distance_filter_toolbox_item: FilterDistanceConfig,

annotation_size_small_keybind: string,

annotation_size_large_keybind: string,

annotation_size_plus_keybind: string,

annotation_size_minus_keybind: string,

annotation_vanish_keybind: string,

change_zoom_keybind: string,

create_point_annotation_keybind: string,

default_annotation_size: number,

delete_annotation_keybind: string,

Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ All notable changes to this project will be documented here.

Nothing yet.

## [0.11.0] - TODO: DATE
- Fix bug where typing in text boxes would sometimes trigger keybinds.
- This fix included a refactor of some keypress events by combining them into a single event listener.
- Deprecated the `default_keybinds` argument in the configuration object. Each of the keybinds previously set by `default_keybinds` can now be set individually. See `api_spec.md` for details.
- Deprecated the `default_annotation_size` argument in the configuration object. Use the `initial_line_size` argument instead. See `api_spec.md` for details.
- Removed cookie previously used to track subtask line size. New jobs will always default to the `initial_line_size` argument if provided.
- Rework `vanish` mode to truly vanish annotations rather than just drawing them really really small. Also vanish all dialogs while vanished.

## [0.10.12] - May 24th, 2024
- Fix broken undo/redo behavior for polygons.
- General improvements aimed at reducing memory usage and improving performance.
Expand Down
2 changes: 1 addition & 1 deletion demo/multi-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"id": 21
}
],
"allowed_modes": ["whole-image"],
"allowed_modes": ["whole-image", "comment"],
"resume_from": null,
"task_meta": null,
"annotation_meta": null
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.

2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ export class ULabel {
public toggle_delete_class_id_in_toolbox(): void;
public change_brush_size(scale_factor: number): void;
public remove_listeners(): void;
public hide_global_edit_suggestion(): void;
public hide_edit_suggestion(): void;
static process_classes(ulabel_obj: any, arg1: string, subtask_obj: any);
static build_id_dialogs(ulabel_obj: any);

Expand Down
2 changes: 1 addition & 1 deletion 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.10.12",
"version": "0.11.0",
"main": "dist/ulabel.js",
"module": "dist/ulabel.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export const DELETE_MODES = ["delete_polygon", "delete_bbox"]
export const DELETE_CLASS_ID = -1;
export const MODES_3D = ["global", "bbox3"];
export const NONSPATIAL_MODES = ["whole-image", "global"];
export const TEXT_MODES = ["whole-image", "global", "comment"];
export const N_ANNOS_PER_CANVAS = 100;
export const LEGACY_DEFAULT_LINE_SIZE = 4;

export type PolygonSpatialData = {
spatial_payload: [number[]][],
Expand Down
22 changes: 11 additions & 11 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ export class Configuration {
AllowedToolboxItem.SubmitButtons,
]

public default_keybinds = {
"annotation_size_small": "s", //The s Key by default
"annotation_size_large": "l", //The l Key by default
"annotation_size_plus": "=", //The = Key by default
"annotation_size_minus": "-", //The - Key by default
"annotation_vanish": "v" //The v Key by default
}

// Config for RecolorActiveItem
public recolor_active_toolbox_item: RecolorActiveConfig = {
gradient_turned_on: false
Expand All @@ -81,12 +73,20 @@ export class Configuration {
"show_overlay_on_load": false
}

public annotation_size_small_keybind: string = "s";

public annotation_size_large_keybind: string = "l";

public annotation_size_plus_keybind: string = "=";

public annotation_size_minus_keybind: string = "-";

public annotation_vanish_keybind: string = "v";

public change_zoom_keybind: string = "r";

public create_point_annotation_keybind: string = "c";

public default_annotation_size: number = 6;


public delete_annotation_keybind: string = "d";

public filter_low_confidence_default_value: number;
Expand Down
4 changes: 3 additions & 1 deletion src/html_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function add_style_to_document(ulabel: ULabel) {
/**
* Creates a mode button that when clicked switches the current annotation type.
*
* @param md_key Key for which button is being constructed. Valid Keys: bbox, point, polygon, tbar, polyline, contour, bbox3, whole-image, global
* @param md_key Key for which button is being constructed. Valid Keys: bbox, point, polygon, tbar, polyline, contour, bbox3, whole-image, global, delete_polygon, delete_bbox, comment
* @param md_name Mode name which shows when selected.
* @param svg_blob svg which shows up on the button
* @param cur_md Current annotation mode
Expand Down Expand Up @@ -178,6 +178,8 @@ export function prep_window_html(ulabel: ULabel, toolbox_item_order: unknown[] =
get_md_button("global", "Global", GLOBAL_SVG, curmd, ulabel.subtasks),
get_md_button("delete_polygon", "Delete", DELETE_POLYGON_SVG, curmd, ulabel.subtasks),
get_md_button("delete_bbox", "Delete", DELETE_BBOX_SVG, curmd, ulabel.subtasks),
// TODO: uq comment icon
get_md_button("comment", "Comment", BBOX_SVG, curmd, ulabel.subtasks),
];

// Append but don't wait
Expand Down
Loading