Skip to content

Commit

Permalink
Adding new/updated blue_team_unet2d-zerocostdL4mic_0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Scaramir committed Mar 21, 2024
1 parent aa3d20c commit 7564123
Show file tree
Hide file tree
Showing 6 changed files with 426 additions and 0 deletions.
Binary file modified album_catalog_index.db
Binary file not shown.
8 changes: 8 additions & 0 deletions solutions/blue_team/unet2d-zerocostdL4mic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2024-03-21

177 changes: 177 additions & 0 deletions solutions/blue_team/unet2d-zerocostdL4mic/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
absl-py==2.1.0
aiofiles==22.1.0
aiosqlite==0.20.0
album-runner @ file:///home/conda/feedstock_root/build_artifacts/album-runner_1678835528483/work
anyio==4.3.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asciitree==0.3.3
asttokens==2.4.1
astunparse==1.6.3
attrs==23.2.0
Babel==2.14.0
beautifulsoup4==4.12.3
bioimageio.core==0.5.9
bioimageio.spec==0.4.9.post5
bleach==6.1.0
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==2.0.12
click==8.1.7
colorama==0.4.6
comm==0.2.2
contourpy==1.2.0
cycler==0.12.1
data==0.4
debugpy==1.8.1
decorator==5.1.1
defusedxml==0.7.1
entrypoints==0.4
exceptiongroup==1.2.0
executing==2.0.1
fasteners==0.19
fastjsonschema==2.19.1
flatbuffers==24.3.7
fonttools==4.50.0
fpdf2==2.7.4
fqdn==1.5.1
funcsigs==1.0.2
future==0.18.3
gast==0.4.0
google==2.0.3
google-auth==2.28.2
google-auth-oauthlib==1.0.0
google-pasta==0.2.0
grpcio==1.62.1
h5py==3.10.0
idna==3.6
imageio==2.34.0
ipykernel==6.29.3
ipython==8.22.2
ipython-genutils==0.2.0
ipywidgets==8.1.0
isoduration==20.11.0
jax==0.4.25
jedi==0.19.1
Jinja2==3.1.3
joblib==1.3.2
json5==0.9.24
jsonpointer==2.4
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter-events==0.10.0
jupyter-ydoc==0.2.5
jupyter_client==7.4.9
jupyter_core==5.7.2
jupyter_server==2.13.0
jupyter_server_fileid==0.9.1
jupyter_server_terminals==0.5.3
jupyter_server_ydoc==0.6.1
jupyterlab==3.6.0
jupyterlab_pygments==0.3.0
jupyterlab_server==2.24.0
jupyterlab_widgets==3.0.10
keras==2.12.0
kiwisolver==1.4.5
libclang==18.1.1
Markdown==3.6
MarkupSafe==2.1.5
marshmallow==3.21.1
marshmallow-jsonschema==0.13.0
marshmallow-union==0.1.15.post1
matplotlib==3.7.1
matplotlib-inline==0.1.6
mistune==3.0.2
ml-dtypes==0.3.2
nbclassic==1.0.0
nbclient==0.10.0
nbconvert==7.16.2
nbformat==5.9.2
nest-asyncio==1.6.0
networkx==3.2.1
notebook==6.5.6
notebook_shim==0.2.4
numcodecs==0.12.1
numexpr==2.8.4
numpy==1.22.4
oauthlib==3.2.2
opt-einsum==3.3.0
overrides==7.7.0
packaging==24.0
pandas==1.5.3
pandocfilters==1.5.1
parso==0.8.3
pathlib==1.0.1
Pillow==8.4.0
platformdirs==4.2.0
prometheus_client==0.20.0
prompt-toolkit==3.0.43
protobuf==4.25.3
psutil==5.9.8
PTable==0.9.2
pure-eval==0.2.2
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.17.2
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pytz==2024.1
PyWavelets==1.5.0
pywin32==306
pywinpty==2.0.13
PyYAML==6.0.1
pyzmq==24.0.1
referencing==0.34.0
requests==2.28.0
requests-oauthlib==1.4.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.0
rsa==4.9
ruamel.yaml==0.18.6
ruamel.yaml.clib==0.2.8
scikit-image==0.19.3
scikit-learn==1.2.2
scipy==1.10.1
Send2Trash==1.8.2
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
stack-data==0.6.3
tensorboard==2.12.3
tensorboard-data-server==0.7.2
tensorflow==2.12.0
tensorflow-estimator==2.12.0
tensorflow-intel==2.12.0
tensorflow-io-gcs-filesystem==0.31.0
termcolor==2.4.0
terminado==0.18.1
threadpoolctl==3.3.0
tifffile==2023.7.4
tinycss2==1.2.1
tomli==2.0.1
tornado==6.4
tqdm==4.65.0
traitlets==5.14.2
typer==0.9.0
types-python-dateutil==2.9.0.20240316
typing_extensions==4.10.0
unzip==1.0.0
uri-template==1.3.0
urllib3==1.26.18
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.7.0
Werkzeug==3.0.1
wget==3.2
widgetsnbextension==4.0.10
wrapt==1.14.1
xarray==2023.12.0
y-py==0.6.2
ypy-websocket==0.8.4
zarr==2.15.0
149 changes: 149 additions & 0 deletions solutions/blue_team/unet2d-zerocostdL4mic/solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
from album.runner.api import setup
from pathlib import Path


env_file = """channels:
- conda-forge
- nvidia
- anaconda
- defaults
dependencies:
- python=3.10
- cudatoolkit=11.2.2
- cudnn=8.1.0
- pip
- pkg-config
- pip:
- unzip
- GitPython
- PTable==0.9.2
- Pillow==8.4.0
- bioimageio.core==0.5.9
- data==0.4
- fpdf2==2.7.4
- future==0.18.3
- google==2.0.3
- matplotlib==3.7.1
- numexpr==2.8.4
- numpy==1.22.4
- pandas==1.5.3
- pathlib==1.0.1
- pip==23.1.2
- requests==2.28.0
- scikit-image==0.19.3
- scikit-learn==1.2.2
- scipy==1.10.1
- tensorflow==2.12.0
- tifffile==2023.7.4
- tqdm==4.65.0
- wget==3.2
- zarr==2.15.0
- nbformat==5.9.2
- ipywidgets==8.1.0
- jupyterlab==3.6.0
name: dl4miceverywhere
"""


def install():
from album.runner.api import get_app_path
from git import Repo
import subprocess
import requests
import shutil
import os

# Clone the DL4MicEverywhere repository
clone_url = "https://github.com/HenriquesLab/DL4MicEverywhere"
to = get_app_path().joinpath("DL4MicEverywhere")
Repo.clone_from(clone_url, to)
assert (to.exists())

# Download the notebook that will execute the solution
notebook_name = "U-Net_2D_ZeroCostDL4Mic.ipynb"
notebook_url = f"https://raw.githubusercontent.com/HenriquesLab/ZeroCostDL4Mic/master/Colab_notebooks/{notebook_name}"

notebook_path = get_app_path().joinpath(notebook_name)
notebook_path.parent.mkdir(parents=True, exist_ok=True)

response = requests.get(notebook_url)
response.raise_for_status()

with open(notebook_path, 'wb') as notebook_file:
notebook_file.write(response.content)

assert notebook_path.exists(), "Notebook download failed"

# Convert the notebook to its colabless form
subprocess.run(["python", ".tools/notebook_autoconversion/transform.py", "-p", f"{get_app_path()}", "-n", f"{notebook_name}", "-s", "1.1.", "1.2.", "2.", "6.3."], cwd=to)
subprocess.run(["mv", get_app_path().joinpath(f"colabless_{notebook_name}"), get_app_path().joinpath(f"{notebook_name}")])

# Remove the cloned DL4MicEverywhere repository
if os.name == 'nt':
os.system(f'rmdir /s /q "{to}"')
else:
shutil.rmtree(to) # rmtree has no permission to do this on Windows

def run():
from album.runner.api import get_args, get_app_path
import subprocess
import os

# Fetch arguments and paths
args = get_args()
app_path = get_app_path()

# Path to the downloaded notebook
notebook_path = app_path.joinpath("U-Net_2D_ZeroCostDL4Mic.ipynb")

# Ensure the notebook exists
assert notebook_path.exists(), f"Notebook {notebook_path} does not exist"

# Output path for running the notebook
output_path = args.path
os.makedirs(output_path, exist_ok=True)
print(f"Saving output to {output_path}")

# Set the LD_LIBRARY_PATH to allow TensorFlow to find the CUDA libraries
os.environ["LD_LIBRARY_PATH"] = f"{os.environ['LD_LIBRARY_PATH']}:{os.environ['CONDA_PREFIX']}/lib"

# Optionally, launch the Jupyter notebook to show the results
subprocess.run(["jupyter", "lab", str(notebook_path)], cwd=str(output_path))


setup(
group="blue_team",
name="unet2d-zerocostdL4mic",
version="0.1.0",
album_api_version="0.5.1",
title="U-Net 2D",
description="2D binary segmentation. U-Net is an encoder-decoder architecture originally used for image segmentation. The first half of the U-Net architecture is a downsampling convolutional neural network which acts as a feature extractor from input images. The other half upsamples these results and restores an image by combining results from downsampling with the upsampled images. Note - visit the ZeroCostDL4Mic wiki to check the original publications this network is based on and make sure you cite these.",
documentation="https://raw.githubusercontent.com/HenriquesLab/ZeroCostDL4Mic/master/BioimageModelZoo/README.md",
covers=[],
cite=[{
"text": "von Chamier, L., Laine, R.F., Jukkala, J. et al. Democratising deep learning for microscopy with ZeroCostDL4Mic. Nat Commun 12, 2276 (2021)",
"doi": "https://doi.org/10.1038/s41467-021-22518-0"
}, {
"text": "Iván Hidalgo-Cenalmor, Joanna W Pylvänäinen, Mariana G Ferreira, Craig T Russell, Ignacio Arganda-Carreras, AI4Life Consortium, Guillaume Jacquemet, Ricardo Henriques, Estibaliz Gómez-de-Mariscal. DL4MicEverywhere: Deep learning for microscopy made flexible, shareable, and reproducible. bioRxiv 2023",
"doi": "https://doi.org/10.1101/2023.11.19.567606"
}, {
"text": "Ronneberger, Olaf, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. Medical image computing and computer-assisted intervention–MICCAI 2015: 18th international conference, Munich, Germany, October 5-9, 2015, proceedings, part III 18. Springer International Publishing, 2015.",
"doi": "https://doi.org/10.48550/arXiv.1505.04597"
}, {
"text": "Falk, T., Mai, D., Bensch, R. et al. U-Net: deep learning for cell counting, detection, and morphometry. Nat Methods 16, 67–70 (2019).",
"doi": "https://doi.org/10.1038/s41592-018-0261-2"
}],
solution_creators=["DL4MicEverywhere team", "album team"],
dependencies={"environment_file": env_file},
tags=["unet", "segmentation", "colab", "notebook", "U-Net", "ZeroCostDL4Mic", "2D", "dl4miceverywhere"],
args=[
{
"name": "path",
"type": "string",
"default": ".",
"description": "What is your working path?"
}
],
run=run,
install=install,
)
52 changes: 52 additions & 0 deletions solutions/blue_team/unet2d-zerocostdL4mic/solution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
album_api_version: 0.5.1
args:
- default: .
description: What is your working path?
name: path
type: string
changelog: null
cite:
- doi: https://doi.org/10.1038/s41467-021-22518-0
text: von Chamier, L., Laine, R.F., Jukkala, J. et al. Democratising deep learning
for microscopy with ZeroCostDL4Mic. Nat Commun 12, 2276 (2021)
- doi: https://doi.org/10.1101/2023.11.19.567606
text: "Iv\xC3\xA1n Hidalgo-Cenalmor, Joanna W Pylv\xC3\xA4n\xC3\xA4inen, Mariana\
\ G Ferreira, Craig T Russell, Ignacio Arganda-Carreras, AI4Life Consortium, Guillaume\
\ Jacquemet, Ricardo Henriques, Estibaliz G\xC3\xB3mez-de-Mariscal. DL4MicEverywhere:\
\ Deep learning for microscopy made flexible, shareable, and reproducible. bioRxiv\
\ 2023"
- doi: https://doi.org/10.48550/arXiv.1505.04597
text: "Ronneberger, Olaf, Philipp Fischer, and Thomas Brox. U-net: Convolutional\
\ networks for biomedical image segmentation. Medical image computing and computer-assisted\
\ intervention\xE2\u20AC\u201CMICCAI 2015: 18th international conference, Munich,\
\ Germany, October 5-9, 2015, proceedings, part III 18. Springer International\
\ Publishing, 2015."
- doi: https://doi.org/10.1038/s41592-018-0261-2
text: "Falk, T., Mai, D., Bensch, R. et al. U-Net: deep learning for cell counting,\
\ detection, and morphometry. Nat Methods 16, 67\xE2\u20AC\u201C70 (2019)."
covers: []
description: 2D binary segmentation. U-Net is an encoder-decoder architecture originally
used for image segmentation. The first half of the U-Net architecture is a downsampling
convolutional neural network which acts as a feature extractor from input images.
The other half upsamples these results and restores an image by combining results
from downsampling with the upsampled images. Note - visit the ZeroCostDL4Mic wiki
to check the original publications this network is based on and make sure you cite
these.
documentation: https://raw.githubusercontent.com/HenriquesLab/ZeroCostDL4Mic/master/BioimageModelZoo/README.md
group: blue_team
name: unet2d-zerocostdL4mic
solution_creators:
- DL4MicEverywhere team
- album team
tags:
- unet
- segmentation
- colab
- notebook
- U-Net
- ZeroCostDL4Mic
- 2D
- dl4miceverywhere
timestamp: '2024-03-21T15:51:09.202091'
title: U-Net 2D
version: 0.1.0
Loading

0 comments on commit 7564123

Please sign in to comment.