Releases: zsylvester/segmenteverygrain
v0.3.0 — SAM 2.1 Migration
What's New
SAM 2.1 Migration
- Migrated from
segment-anything(SAM 1) tosam2(SAM 2.1) across the entire codebase - SAM 2.1 checkpoint:
sam2.1_hiera_large.pt(~900MB, down from ~2.4GB) - All notebooks, core library, docs, and dependencies updated
Cross-Platform GPU Support
- Automatic device detection (CUDA / MPS / CPU) for all
build_sam2()calls - macOS Apple Silicon: TensorFlow via Metal + PyTorch via MPS in the same environment
- Pinned
tensorflow<=2.18.1fortensorflow-metalcompatibility
Breaking Changes
- Python ≥3.10 required (SAM 2 dependency)
segment-anythingreplaced bysam2— update your imports:# Old (v0.2.x) from segment_anything import sam_model_registry, SamPredictor # New (v0.3.0) from sam2.build_sam import build_sam2 from sam2.sam2_image_predictor import SAM2ImagePredictor
- SAM checkpoint changed: download
sam2.1_hiera_large.ptfrom here
segmenteverygrain v0.2.5
Major New Features
- New Interactive Editing Interface (interactions module)
- New GrainPlot class - A fast interactive interface for editing grain segmentations (contributed by Dave Matthews)
- New Grain class - Object-oriented representation of individual grains with measurement methods
- New controls:
- Left-click for instant grain creation or selection
- Alt+click for multi-prompt grain creation
- Shift+drag to draw scale bar for unit conversion
- d to delete, m to merge, z to undo
- Ctrl to temporarily hide grain masks
- Helper functions: load_image(), polygons_to_grains(), save_grains(), save_summary(), save_histogram(), save_mask(), get_summary()
- New Grain Extraction & Clustering Module (grain_utils)
- extract_grain_image() / extract_all_grains() - Extract individual grain images
- extract_vgg16_features() - Deep learning feature extraction using pre-trained CNNs
- extract_color_features() - Color-based feature extraction
- cluster_grains() - Cluster grains using K-means/DBSCAN with PCA
- create_clustered_grain_montage() - Visualize clustered grains
- ClusterMontageSelector - Interactive QC tool for removing bad grains
- ClusterMontageLabeler - Interactive tool for labeling grains by category
- plot_classified_grains() - Visualize grains colored by classification
Repository Reorganization
- Moved all Jupyter notebooks to notebooks/ folder
- Updated all documentation links accordingly
Documentation Updates
- Rewrote interactive editing documentation for new GrainPlot API
- Added documentation for grain_utils module
- Reorganized API reference with proper sections
- Updated README with new interactive controls
Notebook Updates
- Updated Segment_every_grain.ipynb to use new GrainPlot workflow
- Updated Segment_every_grain_w_georeferencing.ipynb for new API
- Updated Segment_every_grain_colab.ipynb for new API
- Removed obsolete interactive notebook
Bug Fixes
- Fixed edge grain handling
- Fixed code to work when no scale bar is present
- Reverted changes that were causing test failures
segmenteverygrain v0.2.3
Fixes mostly related to JOSS review process
Added materials related to the manuscript
Added notebook that illustrates training the U-Net model from scratch
segmenteverygrain v0.2.2
Fixes to notebook with georeferencing
Improved documentation
Minor fixes and tweaks
segmenteverygrain v0.2.1
Switch from Keras 2 to Keras 3
Updated Unet model (in Keras 3 format)
Added more sophisticated grain size distribution plots
Fixed bug in grain rasterization function
segmenteverygrain v0.2.0
Functions for fine tuning the Unet model
Saving and loading grain polygons
Add new grains to large images
Improvements to SAM segmentation function
Added initial set of tests
segmenteverygrain v0.1.9
Added documentation; improved efficiency when handling large images
segmenteverygrain v0.1.8
General code cleanup and better documentation. New function for working with large images, by breaking it up into patches. New option for cleaning up the SAM segmentation result when it is of poor quality and contains large objects that span multiple grains.
segmenteverygrain v0.1.7
Fixed installation issues.
segmenteverygrain v0.1.3
Better Unet model and improved Unet training.
Added notebook with georeferenced example.
Deleted images as they were taking up too much space.
https://pypi.org/project/segmenteverygrain/0.1.3/