Download README.md from LiangLabUMB/CellposeCellCounter_GroundTruth: direct link, hf CLI and curl.
- Browser
- Download file 2.76 kB
-
https://huggingface.co/spaces/LiangLabUMB/CellposeCellCounter_GroundTruth/resolve/main/README.md
- Command line
-
hf download hf://spaces/LiangLabUMB/CellposeCellCounter_GroundTruth/README.md
-
curl -L -o README.md https://huggingface.co/spaces/LiangLabUMB/CellposeCellCounter_GroundTruth/resolve/main/README.md
A newer version of the Gradio SDK is available: 6.31.0
title: Hemocytometer Ground Truth
emoji: 🎯
colorFrom: blue
colorTo: yellow
sdk: gradio
sdk_version: 5.35.0
app_file: app.py
pinned: false
Hemocytometer ground truth
Annotation tool for building ground-truth counts of the 4×4 hemocytometer block. Two tabs: Single image and 4 squares.
Single image
- Upload one photo.
- Click the 4 corners of the 4×4 block (any order). Drag a handle to adjust it.
- Segment. The block is warped to an upright square (≤1024 px) and segmented with the fine-tuned hemocytometer Cellpose-SAM model.
- Correct the count (see below).
4 squares
- Upload the four square images at once. They are sorted by filename into Square 1–4.
- Set each block: click its 4 corners, or press ⌖ Auto and click the block centre to auto-detect the grid. Drag any handle to adjust.
- Segment all 4. One GPU call per square, as in the main counter. The time from the click until all four squares are ready to annotate is recorded (end-to-end), along with the server's own time.
- Correct each square on the large canvas below. Switch squares with the buttons or keys 1–4; edits on each square are kept when you switch.
- Copy the results row (or Copy with header the first time) and paste it into a
spreadsheet. Columns:
timestamp, files, model_sq1, corrected_sq1, … model_sq4, corrected_sq4, mean_corrected, seg_time_s, server_time_s, min_size_px. Model is what Cellpose counted (after min size and exclusion); corrected is your ground truth. The table also shows the count error, (model − corrected) / corrected.
Correcting the count
- click a cell → remove it (false positive); click again → restore
- click empty space → add a dot (false negative)
- click a dot → delete it
- Shift+click → always add a dot, even on top of a cell (e.g. two cells merged into one mask)
- Ctrl+Z / Ctrl+Shift+Z undo / redo · Space (hold) hide outlines · F fit
- mouse wheel zooms, drag pans
The total is the count of detected objects, minus objects below the min size, minus objects touching the left or bottom 1% exclusion zones, minus removed, plus added dots.
Everything after segmentation runs in the browser, so clicks are instant. The page keeps nothing: copy the results row (or write the count down) before uploading the next image.
Files
app.py (server), gt_canvas.js (annotation canvas), corner_canvas.js (4-corner
canvases in the 4-squares tab), grid_seeded.py (grid auto-detection, a copy of the
main app's), requirements.txt.
Set hardware to ZeroGPU in the Space settings. To use local weights instead of the
Hub file, set CPCC_LOCAL_MODEL=/path/to/weights.npy.