Filter image list by annotation status (#27) + CPU fallback for unsupported CUDA GPUs (#57)#71
Merged
Conversation
Adds a combo above the image list (All / Without annotations / With annotations). Rows are hidden via setRowHidden — never removed — so row-index iteration (DINO batch navigation, COCO import) stays valid and no spurious currentRowChanged/switch_image fires. A non-matching current row is hidden too; hiding does not change current_image, so the canvas keeps showing the worked-on image while its row leaves the list. Multi-dim images count as annotated when any slice has annotations. Re-apply hooks into ClassController.update_slice_list_colors, which every annotation-mutation site already reaches. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nu#57) torch.cuda.is_available() is True for Pascal GPUs (e.g. GTX 1050, sm_61) even though torch>=2.8 wheels ship sm_70+ kernels only, so every launch died with 'CUDA error: no kernel image is available'. New core/torch_utils.resolve_torch_device() compares the device capability against torch.cuda.get_arch_list() and returns cpu + an actionable warning on mismatch (cached process-wide). SAM passes device= on every predict, DINO's _resolve_device delegates to the helper (DINO_DEVICE override kept), YOLO train/predict pass device=. One-time QMessageBox via maybe_warn_cpu_fallback at SAM model pick and DINO detect. README gains a Pascal/Maxwell note with the torch-downgrade command. arc42 docs updated for both features. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bnsreenu
pushed a commit
that referenced
this pull request
Jun 25, 2026
- #30: save trained YOLO model with model.save() not model.export() - #44: open all text files (YAML/JSON/TXT, incl. .iap project) as UTF-8 to prevent the Windows cp1252 'charmap' crash - #33: edit the smallest containing polygon so nested annotations are reachable (reuses shoelace calculate_area) - #60: sort the image list alphabetically via a signals-blocked model+view rebuild (not setSortingEnabled), preserving the all_images[i] <-> image_list.item(i) invariant - #56: add imagecodecs dependency and catch the LZW/compressed-TIFF ValueError with an actionable dialog instead of crashing Stacked on the #27/#57 branch (PR #71) because #60/#56 build on the image-list filter work. 157 tests pass; ruff F,E9 clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @bnsreenu — this PR resolves two open issues. Each feature is its own commit, and the diff is scoped to just these two changes (plus tests and arc42 doc updates).
Closes #27 — Filter image list by annotation status
Adds a combo box above the image list with All images / Without annotations / With annotations.
setRowHidden, never removed — this keeps row-index iteration valid (DINO batch navigation, COCO import) and fires no spuriouscurrentRowChanged→switch_image.current_image, so the canvas keeps showing the worked-on image while its row leaves the list.ClassController.update_slice_list_colors, which every annotation-mutation path already reaches.(The arrow-key navigation half of #27 already works in current master.)
Closes #57 — CPU fallback for unsupported CUDA compute capability
torch.cuda.is_available()returns True for Pascal GPUs (e.g. GTX 1050, sm_61) even though torch ≥ 2.8 wheels ship sm_70+ kernels only — so inference died withCUDA error: no kernel image is available.core/torch_utils.resolve_torch_device()compares the device's compute capability againsttorch.cuda.get_arch_list()and falls back to CPU with an actionable warning (cached process-wide).device=on every predict), DINO (_resolve_device,DINO_DEVICEoverride preserved), and YOLO train/predict.QMessageBoxwarning at SAM model pick / DINO detect, plus a README note with the torch-downgrade command for users who want to keep GPU inference.Testing
torch_utilsunit tests with a fake torch module, and an end-to-end filter-wiring test through a fullImageAnnotator).Happy to adjust naming or split further if you'd prefer.