Spaces:
Running on Zero
Running on Zero
Upload app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,10 @@ import focus_qc # v6: grid-line focus QC before segmentation (see focus_qc.py)
|
|
| 34 |
HF_REPO_ID = "LiangLabUMB/cellposecellcounter"
|
| 35 |
HF_REPO_ID2 = "LiangLabUMB/viability_model"
|
| 36 |
MODEL_OPTIONS = {
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
| 38 |
"General Model": "generalmodel.npy"
|
| 39 |
}
|
| 40 |
|
|
@@ -48,6 +51,7 @@ MODEL_OPTIONS = {
|
|
| 48 |
# deleted by someone outside the lab. generalmodel.npy here is a byte-identical
|
| 49 |
# copy of that one -- it has NOT been retrained.
|
| 50 |
MODEL_REPOS = {
|
|
|
|
| 51 |
"hemocytometer_retrained_20260825.npy": "LiangLabUMB/cellposecellcounter",
|
| 52 |
"generalmodel.npy": "LiangLabUMB/cellposecellcounter",
|
| 53 |
}
|
|
@@ -1000,7 +1004,7 @@ def run_segmentation_patched(image_np, model_filename):
|
|
| 1000 |
"""
|
| 1001 |
_t_gpu = time.perf_counter()
|
| 1002 |
h, w = image_np.shape[:2]
|
| 1003 |
-
model_path =
|
| 1004 |
if model_filename in loaded_models:
|
| 1005 |
model = loaded_models[model_filename]
|
| 1006 |
else:
|
|
|
|
| 34 |
HF_REPO_ID = "LiangLabUMB/cellposecellcounter"
|
| 35 |
HF_REPO_ID2 = "LiangLabUMB/viability_model"
|
| 36 |
MODEL_OPTIONS = {
|
| 37 |
+
# 26 Oct 2026: v6 weights (trained from cpsam on 5 cell lines, training_v2;
|
| 38 |
+
# F1 0.965 vs cpsam 0.457 on 21 test blocks). Previous: v5 weights
|
| 39 |
+
# "hemocytometer_retrained_20260825.npy" (HEK293 only), still in the repo.
|
| 40 |
+
"Hemocytometer Model": "hemocytometer_v6_20261001",
|
| 41 |
"General Model": "generalmodel.npy"
|
| 42 |
}
|
| 43 |
|
|
|
|
| 51 |
# deleted by someone outside the lab. generalmodel.npy here is a byte-identical
|
| 52 |
# copy of that one -- it has NOT been retrained.
|
| 53 |
MODEL_REPOS = {
|
| 54 |
+
"hemocytometer_v6_20261001": "LiangLabUMB/cellposecellcounter",
|
| 55 |
"hemocytometer_retrained_20260825.npy": "LiangLabUMB/cellposecellcounter",
|
| 56 |
"generalmodel.npy": "LiangLabUMB/cellposecellcounter",
|
| 57 |
}
|
|
|
|
| 1004 |
"""
|
| 1005 |
_t_gpu = time.perf_counter()
|
| 1006 |
h, w = image_np.shape[:2]
|
| 1007 |
+
model_path = resolve_model_path(HF_REPO_ID, model_filename)
|
| 1008 |
if model_filename in loaded_models:
|
| 1009 |
model = loaded_models[model_filename]
|
| 1010 |
else:
|