Fixed both in to_upload\app.py:
duration=30 instead of 120
The GPU section is now timed separately, so the results box reports:
Segmentation time: 7.02 s (GPU 2.14 s, queue+CPU 4.88 s)
That split tells you what you actually need to know. If GPU is ~2 s and queue+CPU is ~5 s, the compute is fine and you're waiting for hardware. If GPU is ~6 s, the model itself is the cost.
What changed:
cell_sizes(masks) — one np.bincount pass returning every cell's pixel count — now feeds rec_min_size, filter_mask_by_size, filter_mask_by_maxsize, and the log line. Previously each recomputed the same thing by rescanning the whole mask once per cell. Filtering became a lookup-table remap instead of a per-cell loop.
Equivalence verified against the original implementations across six mask fixtures and five threshold settings each:
typical 430 cells cells= 430 thr= 49 rec_min= 49 OK
dense 900 cells cells= 900 thr= 13 rec_min= 13 OK
sparse 20 cells cells= 20 thr= 113 rec_min= 113 OK
empty mask cells= 0 thr= 1 rec_min= 0 OK
single cell cells= 1 thr= 253 rec_min= 253 OK
gaps in ids cells= 55 thr= 81 rec_min= 81 OK
renumbered contiguous 1..N: True dtype=int32
ALL EQUIVALENT
Identical arrays, identical removal counts, including empty masks, thresholds of 0, thresholds larger than every c…
three changes:
1. The minimum-size message now states what was used, not what's recommended:
Minimum size filter applied: 142 px — auto, the 25th percentile of THIS image. Recomputed per image, so it differs between photos. Set the slider to a fixed value for reproducible counts.
With a manual value it says applied: 200 px — fixed value from the slider. (Auto would have used 142 px.) With the filter off it says so plainly. The point about per-image variability is now on screen where whoever is counting will see it — which should make your decision on point 2 easier, since you'll see the number move between photos.
2. Segmentation time appears in three places: the segmentation info box (Segmentation time: 3.42 s at the top), appended to Analysis Results after viability, and in the Summary tab as a per-tab column plus mean and total:
Tab Total Live Dead Viab % Confl % Seg s
--------------------------------------------------------
1 74 67 7 90…