commit 070ec98400b543f0b7f0008f7118661df37e2500 Author: ClovertaTheTrilobita Date: Tue Sep 16 18:09:08 2025 +0300 initial commit diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/cellpose-web-backend.iml b/.idea/cellpose-web-backend.iml new file mode 100644 index 0000000..3c7d613 --- /dev/null +++ b/.idea/cellpose-web-backend.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..451702c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..89ae0ac --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cp_run.py b/cp_run.py new file mode 100644 index 0000000..75c6dd6 --- /dev/null +++ b/cp_run.py @@ -0,0 +1,15 @@ +from cellpose import models +from cellpose.io import imread, save_masks + +def test(): + model = models.CellposeModel(gpu=True) + files = ['img.png'] + imgs = [imread(f) for f in files] + masks, flows, styles = model.eval( + imgs, flow_threshold=0.4, cellprob_threshold=0.0 + ) + + + for img, mask, flow, name in zip(imgs, masks, flows, files): + out = name.rsplit('.', 1)[0] + "_output" + save_masks(imgs, mask, flow, out, png=True) diff --git a/img.png b/img.png new file mode 100644 index 0000000..a6ab9fd Binary files /dev/null and b/img.png differ diff --git a/img_output_cp_masks.png b/img_output_cp_masks.png new file mode 100644 index 0000000..7b4bd11 Binary files /dev/null and b/img_output_cp_masks.png differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..87ab091 --- /dev/null +++ b/main.py @@ -0,0 +1,4 @@ +import cp_run + +if __name__ == "__main__": + cp_run.test()