initial commit

This commit is contained in:
ClovertaTheTrilobita 2025-09-16 18:09:08 +03:00
commit 070ec98400
10 changed files with 62 additions and 0 deletions

8
.idea/.gitignore vendored Normal file
View file

@ -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

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="cellpose" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
.idea/misc.xml Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.12 (cellpose-web-backend)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="cellpose" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/cellpose-web-backend.iml" filepath="$PROJECT_DIR$/.idea/cellpose-web-backend.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

15
cp_run.py Normal file
View file

@ -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)

BIN
img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 KiB

BIN
img_output_cp_masks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

4
main.py Normal file
View file

@ -0,0 +1,4 @@
import cp_run
if __name__ == "__main__":
cp_run.test()