Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/export_notebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
- name: Output artifact URL
run: echo "Artifact URL is https://nightly.link/HenriquesLab/ZeroCostDL4Mic/actions/runs/${{ github. run_id }}/${{ inputs.notebook_name }}.zip"
- name: Stage the ZIP file into BioImage.IO
run: python3 Tools/stage_bmz_notebook.py --id "zero/${{ inputs.notebook_name }}" --url "https://nightly.link/HenriquesLab/ZeroCostDL4Mic/actions/runs/${{ github. run_id }}/${{ inputs.notebook_name }}.zip" # --token "${{ secrets.GITHUB_TOKEN }}"
run: python3 Tools/stage_bmz_notebook.py --id "${{ inputs.notebook_name }}" --url "https://nightly.link/HenriquesLab/ZeroCostDL4Mic/actions/runs/${{ github. run_id }}/${{ inputs.notebook_name }}.zip" # --token "${{ secrets.GITHUB_TOKEN }}"
env:
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
120 changes: 61 additions & 59 deletions Tools/parser_dicts_variables.py
Original file line number Diff line number Diff line change
@@ -1,65 +1,67 @@
dict_manifest_to_version = {
'Notebook_Augmentor_ZeroCostDL4Mic': 'Augmentor' ,
'Notebook_CARE_2D_ZeroCostDL4Mic': 'CARE (2D)' ,
'Notebook_CARE_3D_ZeroCostDL4Mic': 'CARE (3D)' ,
'Notebook_Cellpose_2D_ZeroCostDL4Mic': 'Cellpose' ,
'Notebook_CycleGAN_2D_ZeroCostDL4Mic': 'CycleGAN' ,
'Notebook_DFCAN_ZeroCostDL4Mic': 'DFCAN 2D' ,
'Notebook_DRMIME_ZeroCostDL4Mic': 'DRMIME' ,
'Notebook_DecoNoising_2D_ZeroCostDL4Mic': 'DecoNoising' ,
'Notebook_Deep-STORM_2D_ZeroCostDL4Mic': 'Deep-STORM' ,
'Notebook_Deep-STORM_2D_ZeroCostDL4Mic_DeepImageJ': 'Deep-STORM BioimageIO' ,
'Notebook_DenoiSeg_2D_ZeroCostDL4Mic': 'DenoiSeg' ,
'Notebook_Detectron2_ZeroCostDL4Mic': 'Detectron 2D' ,
'Notebook_EmbedSeg_2D_ZeroCostDL4Mic': 'EmbedSeg 2D' ,
'Notebook_Interactive_Segmentation_Kaibu_2D_ZeroCostDL4Mic': 'Kaibu' ,
'Notebook_MaskRCNN_ZeroCostDL4Mic': 'MaskRCNN' ,
'Notebook_Noise2Void_2D_ZeroCostDL4Mic': 'Noise2Void (2D)' ,
'Notebook_Noise2Void_3D_ZeroCostDL4Mic': 'Noise2Void (3D)' ,
'Notebook_Quality_Control_ZeroCostDL4Mic': 'Quality_control' ,
'Notebook_RCAN_3D_ZeroCostDL4Mic': '3D RCAN' ,
'Notebook_RetinaNet_ZeroCostDL4Mic': 'RetinaNet' ,
'Notebook_SplineDist_2D_ZeroCostDL4Mic': 'SplineDist (2D)' ,
'Notebook_StarDist_2D_ZeroCostDL4Mic': 'StarDist 2D' ,
'Notebook_StarDist_3D_ZeroCostDL4Mic': 'StarDist 3D' ,
'Notebook_U-Net_2D_ZeroCostDL4Mic': 'U-Net (2D)',
'Notebook_U-Net_2D_multilabel_ZeroCostDL4Mic': 'U-Net (2D) multilabel',
'Notebook_U-Net_3D_ZeroCostDL4Mic': 'U-Net (3D)' ,
'Notebook_YOLOv2_ZeroCostDL4Mic': 'YOLOv2' ,
'Notebook_fnet_2D_ZeroCostDL4Mic': 'fnet (2D)' ,
'Notebook_fnet_3D_ZeroCostDL4Mic': 'fnet (3D)' ,
'Notebook_pix2pix_2D_ZeroCostDL4Mic': 'pix2pix' ,
'WGAN_ZeroCostDL4Mic.ipynb': 'WGAN 2D',
}
'light-swimsuit': 'Augmentor',
'fun-high-heels': 'CARE (2D)',
'opalescent-ribbon': 'CARE (3D)',
'polished-t-shirt': 'Cellpose',
'flattering-bikini': 'CycleGAN',
'mesmerizing-shoe': 'DFCAN 2D',
'playful-scarf': 'Diffusion model for SMLM',
'irresistible-swimsuit': 'DRMIME',
'flexible-helmet': 'DecoNoising',
'inspiring-sandal': 'Deep-STORM',
'silky-shorts': 'Deep-STORM BioimageIO',
'smooth-safety-vest': 'DenoiSeg',
'convenient-t-shirt': 'Detectron 2D',
'smooth-graduation-hat': 'EmbedSeg 2D',
'timeless-running-shirt': 'Kaibu',
'regal-ribbon': 'MaskRCNN',
'brisk-scarf': 'Noise2Void (2D)',
'cozy-hiking-boot': 'Noise2Void (3D)',
'lively-t-shirt': 'Quality_control',
'striking-necktie': '3D RCAN',
'convenient-purse': 'RetinaNet',
'uplifting-backpack': 'SplineDist (2D)',
'exciting-backpack': 'StarDist 2D',
'cheerful-cap': 'StarDist 3D',
'resplendent-ribbon': 'U-Net (2D)',
'whimsical-helmet': 'U-Net (2D) multilabel',
'joyful-top-hat': 'U-Net (3D)',
'bold-shorts': 'YOLOv2',
'limited-edition-crown': 'fnet (2D)',
'authoritative-ballet-shoes': 'fnet (3D)',
'fluid-glasses': 'pix2pix',
'slinky-bikini': 'WGAN 2D'
}

dict_dl4miceverywhere_to_manifest = {
'CARE_2D_DL4Mic': 'Notebook_CARE_2D_ZeroCostDL4Mic',
'CARE_3D_DL4Mic': 'Notebook_CARE_3D_ZeroCostDL4Mic',
'Cellpose_2D_DL4Mic': 'Notebook_Cellpose_2D_ZeroCostDL4Mic',
'CycleGAN_DL4Mic': 'Notebook_CycleGAN_2D_ZeroCostDL4Mic',
'DFCAN_DL4Mic': 'Notebook_DFCAN_ZeroCostDL4Mic',
'DRMIME_2D_DL4Mic': 'Notebook_DRMIME_ZeroCostDL4Mic',
'DecoNoising_2D_DL4Mic': 'Notebook_DecoNoising_2D_ZeroCostDL4Mic',
'Deep-STORM_2D_DL4Mic': 'Notebook_Deep-STORM_2D_ZeroCostDL4Mic',
'DenoiSeg_DL4Mic': 'Notebook_DenoiSeg_2D_ZeroCostDL4Mic',
'Detectron2_2D_DL4Mic': 'Notebook_Detectron2_ZeroCostDL4Mic',
'Embedseg_DL4Mic': 'Notebook_EmbedSeg_2D_ZeroCostDL4Mic',
'MaskRCNN_DL4Mic': 'Notebook_MaskRCNN_ZeroCostDL4Mic',
'Noise2Void_2D_DL4Mic': 'Notebook_Noise2Void_2D_ZeroCostDL4Mic',
'Noise2Void_3D_DL4Mic': 'Notebook_Noise2Void_3D_ZeroCostDL4Mic',
'3D-RCAN_DL4Mic': 'Notebook_RCAN_3D_ZeroCostDL4Mic',
'RetinaNet_DL4Mic': 'Notebook_RetinaNet_ZeroCostDL4Mic',
'SplineDist_2D_DL4Mic': 'Notebook_SplineDist_2D_ZeroCostDL4Mic',
'StarDist_2D_DL4Mic': 'Notebook_StarDist_2D_ZeroCostDL4Mic',
'StarDist_3D_DL4Mic': 'Notebook_StarDist_3D_ZeroCostDL4Mic',
'U-Net_2D_DL4Mic': 'Notebook_U-Net_2D_ZeroCostDL4Mic',
'U-Net_2D_Multilabel_DL4Mic': 'Notebook_U-Net_2D_multilabel_ZeroCostDL4Mic',
'U-Net_3D_DL4Mic': 'Notebook_U-Net_3D_ZeroCostDL4Mic',
'YOLOv2_DL4Mic': 'Notebook_YOLOv2_ZeroCostDL4Mic',
'fnet_2D_DL4Mic': 'Notebook_fnet_2D_ZeroCostDL4Mic',
'fnet_3D_DL4Mic': 'Notebook_fnet_3D_ZeroCostDL4Mic',
'pix2pix_DL4Mic': 'Notebook_pix2pix_2D_ZeroCostDL4Mic',
'WGAN_DL4Mic': 'WGAN_ZeroCostDL4Mic.ipynb',
'CARE_2D_DL4Mic': 'fun-high-heels',
'CARE_3D_DL4Mic': 'opalescent-ribbon',
'Cellpose_2D_DL4Mic': 'polished-t-shirt',
'CycleGAN_DL4Mic': 'flattering-bikini',
'DFCAN_DL4Mic': 'mesmerizing-shoe',
'Diffusion_SMLM_DL4Mic': 'playful-scarf',
'DRMIME_2D_DL4Mic': 'irresistible-swimsuit',
'DecoNoising_2D_DL4Mic': 'flexible-helmet',
'Deep-STORM_2D_DL4Mic': 'inspiring-sandal',
'DenoiSeg_DL4Mic': 'smooth-safety-vest',
'Detectron2_2D_DL4Mic': 'convenient-t-shirt',
'Embedseg_DL4Mic': 'smooth-graduation-hat',
'MaskRCNN_DL4Mic': 'regal-ribbon',
'Noise2Void_2D_DL4Mic': 'brisk-scarf',
'Noise2Void_3D_DL4Mic': 'cozy-hiking-boot',
'3D-RCAN_DL4Mic': 'striking-necktie',
'RetinaNet_DL4Mic': 'convenient-purse',
'SplineDist_2D_DL4Mic': 'uplifting-backpack',
'StarDist_2D_DL4Mic': 'exciting-backpack',
'StarDist_3D_DL4Mic': 'cheerful-cap',
'U-Net_2D_DL4Mic': 'resplendent-ribbon',
'U-Net_2D_Multilabel_DL4Mic': 'whimsical-helmet',
'U-Net_3D_DL4Mic': 'joyful-top-hat',
'YOLOv2_DL4Mic': 'bold-shorts',
'fnet_2D_DL4Mic': 'limited-edition-crown',
'fnet_3D_DL4Mic': 'authoritative-ballet-shoes',
'pix2pix_DL4Mic': 'fluid-glasses',
'WGAN_DL4Mic': 'slinky-bikini'
}

dict_dl4miceverywhere_to_version = {dl4mic_name: dict_manifest_to_version[dict_dl4miceverywhere_to_manifest[dl4mic_name]] for dl4mic_name in dict_dl4miceverywhere_to_manifest.keys()}
140 changes: 140 additions & 0 deletions Tools/update_manifest_legacy_id.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ZeroCost manifest update\n",
"replace legacy id with bmz id\n",
"\n",
"add license to datasets"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Add License to datasets"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from ruyaml import YAML\n",
"from pathlib import Path\n",
"from bioimageio.core import load_description\n",
"\n",
"# Load the YAML file\n",
"manifest_path = Path('../manifest.bioimage.io.yaml')\n",
"\n",
"with open(manifest_path, 'r', encoding='utf8') as f:\n",
" yaml = YAML()\n",
" yaml.preserve_quotes = True\n",
" manifest = yaml.load(f)\n",
"\n",
"# Update the manifest file with the correct bioimage.io id and add license to datasets\n",
"for element in manifest['collection']:\n",
" \n",
" # Add license to datasets\n",
" if element['type'] == 'dataset':\n",
" try:\n",
" element['license']\n",
" except:\n",
" element['license'] = 'CC-BY-4.0'\n",
"\n",
"\n",
"# Save the modified YAML data back to the file\n",
"with open(manifest_path, 'w', encoding='utf8') as f:\n",
" yaml = YAML()\n",
" yaml.preserve_quotes = True\n",
" yaml.default_flow_style = False\n",
" yaml.indent(mapping=2, sequence=4, offset=2)\n",
" yaml.width = 10e10\n",
" yaml.dump(manifest, f)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Convert legacy ID to new bioimage model zoo ID"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from ruyaml import YAML\n",
"from pathlib import Path\n",
"from bioimageio.core import load_description\n",
"\n",
"# Load the YAML file\n",
"manifest_path = Path('../manifest.bioimage.io.yaml')\n",
"\n",
"with open(manifest_path, 'r', encoding='utf8') as f:\n",
" yaml = YAML()\n",
" yaml.preserve_quotes = True\n",
" manifest = yaml.load(f)\n",
"\n",
"\n",
"# Update the manifest file with the correct bioimage.io id and add license to datasets\n",
"for element in manifest['collection']:\n",
" \n",
" # Get the bioimage.io id from the app RDF file and update the manifest file\n",
" try:\n",
" app_rdf = load_description('zero/' + element['id'])\n",
" app_bmz_id = app_rdf.config['bioimageio']['nickname']\n",
" element['id'] = app_bmz_id\n",
" except:\n",
" pass\n",
"\n",
" # Update the links in the manifest file\n",
" if 'links' in element:\n",
" links=[]\n",
" for link in element['links']:\n",
" if link == 'Notebook Preview':\n",
" continue\n",
" link_rdf = load_description( 'zero/' + link )\n",
" link_bmz_id = link_rdf.config['bioimageio']['nickname']\n",
" links.append(link_bmz_id)\n",
" element['links'] = links\n",
"\n",
"\n",
"# Save the modified YAML data back to the file\n",
"with open(manifest_path, 'w', encoding='utf8') as f:\n",
" yaml = YAML()\n",
" yaml.preserve_quotes = True\n",
" yaml.default_flow_style = False\n",
" yaml.indent(mapping=2, sequence=4, offset=2)\n",
" yaml.width = 10e10\n",
" yaml.dump(manifest, f)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "zc_manifest_update",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading