mirror of
https://github.com/ClovertaTheTrilobita/cellpose-web.git
synced 2026-04-01 23:14:50 +00:00
initial commit
This commit is contained in:
commit
070ec98400
10 changed files with 62 additions and 0 deletions
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal 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
|
||||||
8
.idea/cellpose-web-backend.iml
Normal file
8
.idea/cellpose-web-backend.iml
Normal 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>
|
||||||
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
Normal 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
7
.idea/misc.xml
Normal 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
8
.idea/modules.xml
Normal 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
6
.idea/vcs.xml
Normal 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
15
cp_run.py
Normal 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
BIN
img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 604 KiB |
BIN
img_output_cp_masks.png
Normal file
BIN
img_output_cp_masks.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
4
main.py
Normal file
4
main.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
import cp_run
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
cp_run.test()
|
||||||
Loading…
Reference in a new issue