MCPcopy Create free account

hub / github.com/bnsreenu/digitalsreeni-image-annotator / functions

Functions1,194 in github.com/bnsreenu/digitalsreeni-image-annotator

↓ 42 callersMethodclear
(self)
src/digitalsreeni_image_annotator/controllers/annotation_history.py:92
↓ 26 callersMethodapply_canvas_selection
Apply a selection change that originated on the canvas (issue #75) and mirror it onto the annotation list so Delete / Merge / Change C
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:623
↓ 25 callersMethodupdate_annotation_list
(self, image_name=None)
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:144
↓ 24 callersMethodload
Return ``(image_rgb, [{"mask": bool HxW}, ...])``.
src/digitalsreeni_image_annotator/training/sam_trainer.py:166
↓ 22 callersFunction_cell
(window)
tests/integration/test_annotation_history.py:68
↓ 21 callersMethodcenter
(self)
src/digitalsreeni_image_annotator/dialogs/snake_game.py:29
↓ 21 callersMethodundo
Step back one edit. Returns the snapshot to restore, or None. ``current_snapshot`` (the live state) is moved onto the redo stack so a
src/digitalsreeni_image_annotator/controllers/annotation_history.py:67
↓ 20 callersMethod_update_bbox_drag
Advance an in-progress shape resize/move, mutating the annotation's geometry in place so the canvas + selection overlay redraw live.
src/digitalsreeni_image_annotator/widgets/image_label.py:1314
↓ 20 callersMethodget_image_coordinates
(self, pos)
src/digitalsreeni_image_annotator/widgets/image_label.py:915
↓ 18 callersMethodauto_save
(self)
src/digitalsreeni_image_annotator/controllers/project_controller.py:527
↓ 18 callersMethodclear
(self)
src/digitalsreeni_image_annotator/widgets/image_label.py:513
↓ 17 callersFunction_snap
A tiny annotation-dict snapshot keyed by class name.
tests/unit/test_annotation_history.py:13
↓ 17 callersFunction_square
(x, y, s, number, cls="cell")
tests/integration/test_annotation_history.py:35
↓ 17 callersFunction_square
(x0, y0, side, name)
tests/unit/test_canvas_selection.py:25
↓ 17 callersFunctioncalculate_area
(annotation)
src/digitalsreeni_image_annotator/utils.py:36
↓ 17 callersMethodcan_undo
(self, key)
src/digitalsreeni_image_annotator/controllers/annotation_history.py:59
↓ 16 callersMethodsave_current_annotations
(self)
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:259
↓ 15 callersFunction_seed
(window, anns, monkeypatch)
tests/integration/test_annotation_history.py:57
↓ 15 callersMethodupdate_slice_list_colors
(self)
src/digitalsreeni_image_annotator/controllers/class_controller.py:66
↓ 14 callersMethod_pen_w
Overlay pen width: ui-scaled, zoom-compensated (constant on screen).
src/digitalsreeni_image_annotator/widgets/image_label.py:184
↓ 14 callersFunction_square
(x0, y0, side, number)
tests/integration/test_canvas_selection_controller.py:27
↓ 14 callersMethodactivate_tool
Single choke-point for canvas-tool activation. Makes all six tools (manual + SAM) mutually exclusive and keeps ``current_tool``, the
src/digitalsreeni_image_annotator/annotator_window.py:942
↓ 13 callersFunctioncalculate_bbox
(segmentation)
src/digitalsreeni_image_annotator/utils.py:47
↓ 13 callersFunctionexport_coco_json
(all_annotations, class_mapping, image_paths, slices, image_slices, output_dir, json_filename=None)
src/digitalsreeni_image_annotator/io/export_formats.py:29
↓ 13 callersMethodrecord
Push the pre-mutation snapshot; clear redo; cap depth. Skips the push when ``before_snapshot`` equals the current undo top (deep valu
src/digitalsreeni_image_annotator/controllers/annotation_history.py:45
↓ 12 callersMethod_begin_shape_edit
Arm a resize/move of one selected shape. `kind` picks the geometry the handles drive: a polygon ("seg") scales/translates its vertices, a
src/digitalsreeni_image_annotator/widgets/image_label.py:1278
↓ 12 callersMethod_commit_bbox_drag
Finish a shape drag: clamp into the image and persist if it actually moved; otherwise treat the press as a plain click → select.
src/digitalsreeni_image_annotator/widgets/image_label.py:1382
↓ 12 callersFunction_try
(label: str, fn)
tools/check_pyqt6_torch_coexistence.py:38
↓ 12 callersMethoddelete_selected_annotations
(self)
src/digitalsreeni_image_annotator/annotator_window.py:892
↓ 11 callersMethodswitch_image
(self, item)
src/digitalsreeni_image_annotator/controllers/image_controller.py:355
↓ 10 callersFunction_add_image
(mw, file_name, is_multi_slice=False)
tests/unit/test_image_filter.py:40
↓ 10 callersFunction_arm
(label, ann, mode, handle, start)
tests/unit/test_bbox_edit.py:108
↓ 10 callersFunction_bbox
(x, y, w, h, name="cell")
tests/unit/test_bbox_edit.py:26
↓ 10 callersFunctiondefault_class_color
Hex colour for the index-th class, cycling through DEFAULT_CLASS_COLORS. Callers wrap the result in ``QColor(...)`` (kept out of this module so t
src/digitalsreeni_image_annotator/core/constants.py:54
↓ 10 callersMethodrecord_history
Snapshot the pre-mutation state of one image for undo. Call *before* a synchronous mutation. ``key`` defaults to the current image; p
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:295
↓ 9 callersMethod_annotation_bbox
Axis-aligned bounds (x0, y0, x1, y1) of an annotation, or None. Falls through to the bbox when segmentation is absent/None/empty (imported
src/digitalsreeni_image_annotator/widgets/image_label.py:1087
↓ 9 callersMethod_bbox_handle_at
Handle id under pos for a shape's bounding box, or None. Grab radius is zoom-compensated so it stays a constant on-screen target.
src/digitalsreeni_image_annotator/widgets/image_label.py:1215
↓ 9 callersMethod_log_msg
(self, msg)
src/digitalsreeni_image_annotator/dialogs/dino_merge_dialog.py:139
↓ 9 callersMethod_set_silently
Set a spin box without re-entering the rebalance handlers.
src/digitalsreeni_image_annotator/dialogs/dataset_splitter.py:124
↓ 9 callersMethod_single_selected_shape
The selected annotation iff exactly one shape is selected and it has a bounding box (segmentation or bbox) — the state in which the handles
src/digitalsreeni_image_annotator/widgets/image_label.py:1190
↓ 9 callersMethodcheck_unsaved_changes
(self)
src/digitalsreeni_image_annotator/widgets/image_label.py:491
↓ 9 callersFunctionclamp_font_pt
Coerce any stored/passed value to a usable point size. QSettings round-trips values as strings on some backends, and a hand-edited registry/I
src/digitalsreeni_image_annotator/app_settings.py:23
↓ 9 callersFunctionnormalize_image
Normalize image array to 8-bit range.
src/digitalsreeni_image_annotator/utils.py:193
↓ 9 callersFunctionsimplify_polygon
Reduce the vertex count of a flat ``[x1, y1, ...]`` polygon (Douglas- Peucker via ``cv2.approxPolyDP``) so users can trade detail for smaller
src/digitalsreeni_image_annotator/utils.py:145
↓ 8 callersMethod_finish_selection
Resolve a press→release in select mode into a selection change. Shift makes it additive (drag) / toggling (click).
src/digitalsreeni_image_annotator/widgets/image_label.py:1155
↓ 8 callersMethod_is_select_mode
True when the canvas is idle (no drawing/SAM tool, not editing, no temp review) — the only state where bare clicks/drags select existi
src/digitalsreeni_image_annotator/widgets/image_label.py:1058
↓ 8 callersFunction_values
(dlg)
tests/ui/test_splitter_balance.py:23
↓ 8 callersMethodannotation_at
Smallest-area annotation containing pos, or None. Covers both segmentation and bbox annotations and skips hidden classes. Smallest win
src/digitalsreeni_image_annotator/widgets/image_label.py:1106
↓ 8 callersMethoddistance
Calculate distance between two points.
src/digitalsreeni_image_annotator/widgets/image_label.py:1539
↓ 8 callersMethodimage_has_annotations
True if the image (or, for multi-dim images, any of its slices) has at least one annotation.
src/digitalsreeni_image_annotator/controllers/image_controller.py:139
↓ 8 callersMethodsort_image_list
Populate image_list in alphabetical order (upstream issue #60). Sorts the model (`all_images`) and the view together so the `all_imag
src/digitalsreeni_image_annotator/controllers/image_controller.py:93
↓ 8 callersMethodstart_polygon_edit
(self, pos)
src/digitalsreeni_image_annotator/widgets/image_label.py:1424
↓ 8 callersMethodupdate_class_list
(self)
src/digitalsreeni_image_annotator/controllers/class_controller.py:197
↓ 8 callersMethodupdate_image_info
(self, additional_info=None)
src/digitalsreeni_image_annotator/annotator_window.py:827
↓ 7 callersFunction_qimage_to_numpy
QImage → RGB numpy array. Returned array is a fresh copy. The naive ``np.frombuffer(qimage.constBits().asarray(N))`` aliases the QImage's pix
src/digitalsreeni_image_annotator/inference/sam_utils.py:69
↓ 7 callersFunction_seed
(window, anns, monkeypatch)
tests/integration/test_annotation_table.py:62
↓ 7 callersMethodapply_image_filter
(self)
src/digitalsreeni_image_annotator/annotator_window.py:295
↓ 7 callersMethodcan_redo
(self, key)
src/digitalsreeni_image_annotator/controllers/annotation_history.py:63
↓ 7 callersFunctionfit_bbox_inside
Translate a ``[x, y, w, h]`` box back inside the image **preserving its size** (shrinking only if it is larger than the image). For the move path:
src/digitalsreeni_image_annotator/utils.py:90
↓ 7 callersMethodinitialize_yolo_trainer
(self)
src/digitalsreeni_image_annotator/controllers/yolo_controller.py:104
↓ 7 callersFunctionmask_to_xyxy
Tight ``[x1, y1, x2, y2]`` bounding box of a bool mask, or None if empty.
src/digitalsreeni_image_annotator/training/sam_trainer.py:102
↓ 7 callersMethodmodifiers
(self)
tests/unit/test_bbox_edit.py:43
↓ 7 callersFunctionresolve_torch_device
Return ``(device, warning)``. ``device`` is ``"cuda"`` or ``"cpu"``; ``warning`` is None or a human-readable explanation of why CUDA was reje
src/digitalsreeni_image_annotator/core/torch_utils.py:16
↓ 6 callersFunction_dense
(number=1)
tests/integration/test_annotation_table.py:73
↓ 6 callersMethod_history_key
(self)
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:292
↓ 6 callersMethod_live_annotation
Resolve a (possibly list-copied) annotation to the live object inside ``self.annotations`` — what the canvas renders and ``save_curren
src/digitalsreeni_image_annotator/widgets/image_label.py:1202
↓ 6 callersFunction_populate
(mw, names)
tests/unit/test_image_list_sort.py:40
↓ 6 callersMethod_resize_bbox
New [x, y, w, h] after dragging `handle` to `pos`, keeping the opposite edge/corner fixed. Normalised so width/height never go negativ
src/digitalsreeni_image_annotator/widgets/image_label.py:1228
↓ 6 callersFunctionclamp_segmentation
Clamp every vertex of a flat ``[x1, y1, x2, y2, ...]`` polygon into the image rectangle ``[0, width] x [0, height]``. Per-coordinate clamping
src/digitalsreeni_image_annotator/utils.py:55
↓ 6 callersFunctionclip_polygon_to_bounds
Clip a flat ``[x1, y1, ...]`` polygon to the image rectangle via a shapely intersection, returning the flat exterior of the largest resulting
src/digitalsreeni_image_annotator/utils.py:103
↓ 6 callersMethodkeyPressEvent
(self, event)
src/digitalsreeni_image_annotator/dialogs/snake_game.py:53
↓ 6 callersMethodload_image_annotations
(self)
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:248
↓ 6 callersMethodsave_project
(self, show_message=True)
src/digitalsreeni_image_annotator/controllers/project_controller.py:380
↓ 6 callersMethodtrain
Fine-tune and save. Returns a small result dict; raises on failure. ``groups`` is an iterable of :class:`SampleGroup`. ``batch_size`` is a
src/digitalsreeni_image_annotator/training/sam_trainer.py:260
↓ 5 callersFunction_circle
A flat [x1,y1,...] polygon approximating a circle with n vertices.
tests/unit/test_polygon_simplify.py:13
↓ 5 callersMethod_hidden
(self, mw)
tests/unit/test_image_filter.py:109
↓ 5 callersMethod_refresh_list
(self)
src/digitalsreeni_image_annotator/dialogs/dino_phrase_editor.py:231
↓ 5 callersFunction_run_sync
Run fn on a worker thread; pump the calling thread's event loop until done; return the result. Re-raises exceptions on the caller. Looks sync
src/digitalsreeni_image_annotator/inference/sam_utils.py:244
↓ 5 callersFunction_seed
(window, anns)
tests/integration/test_canvas_selection_controller.py:35
↓ 5 callersFunction_seg
(x0, y0, side, name="cell")
tests/unit/test_bbox_edit.py:30
↓ 5 callersMethod_set_sam_ui_locked
Disable/enable SAM inference controls + the fine-tune menu so no concurrent inference, model swap, or second training run can start wh
src/digitalsreeni_image_annotator/controllers/sam_train_controller.py:219
↓ 5 callersMethod_sync_selection_buttons
Merge needs ≥2 annotations; Change Class needs ≥1. Shared by the list-driven and canvas-driven (issue #75) selection paths.
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:617
↓ 5 callersFunctionclamp_bbox
Trim a ``[x, y, w, h]`` box to the image rectangle by clamping each corner independently, keeping it rectangular and at least 1x1. This is the
src/digitalsreeni_image_annotator/utils.py:70
↓ 5 callersMethodclear_current_annotation
Clear the current annotation.
src/digitalsreeni_image_annotator/widgets/image_label.py:273
↓ 5 callersMethodclear_temp_sam_prediction
(self)
src/digitalsreeni_image_annotator/widgets/image_label.py:487
↓ 5 callersMethodconvert_to_serializable
(self, obj)
src/digitalsreeni_image_annotator/annotator_window.py:310
↓ 5 callersFunctionexport_yolo_v5plus
Export annotations in YOLO v5+ format. Directory structure: output_dir/ ├── data.yaml ├── images/ │ ├── train/
src/digitalsreeni_image_annotator/io/export_formats.py:246
↓ 5 callersFunctionload_ui_prefs
Return (font_pt, dark_mode), with defaults (10, True).
src/digitalsreeni_image_annotator/app_settings.py:41
↓ 5 callersMethodon_class_selected
(self, current=None, previous=None)
src/digitalsreeni_image_annotator/controllers/class_controller.py:246
↓ 5 callersMethodpoint_to_tuple
Convert QPoint to tuple.
src/digitalsreeni_image_annotator/widgets/image_label.py:1532
↓ 5 callersMethodshow_centered
(self, parent)
src/digitalsreeni_image_annotator/dialogs/help_window.py:24
↓ 5 callersMethodupdate_annotation_list
(self, image_name=None)
src/digitalsreeni_image_annotator/annotator_window.py:532
↓ 5 callersMethodupdate_slice_list
(self)
src/digitalsreeni_image_annotator/controllers/image_controller.py:791
↓ 5 callersMethodupdate_window_title
(self)
src/digitalsreeni_image_annotator/controllers/project_controller.py:31
↓ 4 callersMethod_is_missing_codec_error
True if a tifffile read failed because the imagecodecs package is unavailable for the TIFF's compression — e.g. LZW (#56). Matches on
src/digitalsreeni_image_annotator/controllers/image_controller.py:302
↓ 4 callersFunction_npts
(seg)
tests/unit/test_polygon_simplify.py:22
↓ 4 callersFunction_seed
(window, anns)
tests/integration/test_bbox_edit_controller.py:42
↓ 4 callersFunction_selected_data
(window)
tests/integration/test_canvas_selection_controller.py:43
↓ 4 callersMethod_selected_row_items
Col-0 items of the selected rows, deduped. The table selects whole rows, but selectedItems()/selectedIndexes() yield a cell per column.
src/digitalsreeni_image_annotator/controllers/annotation_controller.py:136
↓ 4 callersFunction_square
(x0, y0, side, name)
tests/unit/test_polygon_edit.py:21
next →1–100 of 1,194, ranked by callers