Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modelzoo Export #71

Closed
tibuch opened this issue Mar 9, 2020 · 3 comments · Fixed by #80
Closed

Modelzoo Export #71

tibuch opened this issue Mar 9, 2020 · 3 comments · Fixed by #80
Assignees

Comments

@tibuch
Copy link
Collaborator

tibuch commented Mar 9, 2020

Export models according to the modelzoo specifications.

  • modelzoo.yml
@frauzufall
Copy link

frauzufall commented Mar 9, 2020

Here's how it looks like in Fiji (and we want to be somewhat compatible with that, at least the location of mean and stddev for normalization needs to be the same):

name: YOUR MODEL NAME HERE
description: YOUR DESCRIPTION HERE
cite:
  text: |-
    Buchholz, T. et al. - Content-aware image restoration for electron microscopy. 
    Methods in Cell Biology, Volume 152 p.277-289, ISSN 0091-679X (2019)
  doi: https://doi.org/10.1016/bs.mch.2019.05.001
authors: [YOUR NAMES HERE]
documentation: README.md
test_input: ./test_input.tif
test_output: ./test_output.tif
covers: [./thumbnail.png]
tags: [denoising, unet2d, n2v]
license: BSD 3
format_version: 0.1.0
language: java
framework: tensorflow
source: de.csbdresden.n2v.train.N2VPrediction
inputs:
- name: raw
  axes: byxc
  data_type: float32
  data_range: [-inf, inf]
  shape:
    min: [1, 4, 4, 1]
    step: [1, 4, 4, 0]
outputs:
- name: denoised
  axes: byxc
  data_type: float32
  data_range: [-inf, inf]
  halo: [0, 32, 32, 0]
  shape:
    reference_input: raw
    scale: [1, 1, 1, 1]
    offset: [0, 0, 0, 0]
training:
  source: de.csbdresden.n2v.train.N2VTraining
  kwargs: {batchDimLength: 180, batchSize: 64, trainDimensions: 2, neighborhoodRadius: 5, numEpochs: 100,
    numStepsPerEpoch: 300, patchDimLength: 60, stepsFinished: 30000}
prediction:
  preprocess:
    spec: de.csbdresden.n2v.predict.N2VPrediction::preprocess
    kwargs: {mean: 41498.87, stdDev: 15007.021}
  weights: {source: https://github.com/bioimage-io/fiji-bioimage-io/releases/download/v0.1.0/n2v-sem-demo.zip}
  postprocess:
    spec: de.csbdresden.n2v.predict.N2VPrediction::postprocess
    kwargs: {mean: 41498.87, stdDev: 15007.021}
  dependencies: ./dependencies.yaml

@turekg turekg self-assigned this Jun 17, 2020
@turekg turekg linked a pull request Jun 17, 2020 that will close this issue
@uschmidt83
Copy link

Hi, are model exports according to the modelzoo specifications already supported in Fiji (or anywhere else)?

We talked about this a while ago, but haven't heard anything recently. It's a coincidence that I just saw this issue.

Best,
Uwe

@frauzufall
Copy link

@uschmidt83 yes, it's currently being implemented here and I recently added a reader and writer for the spec to imagej-modelzoo (see howto). I just talked to @maweigert yesterday about having a meeting with you two after the NEUBIAS course next week to plan integrating this into CSBDeep as well.

tibuch added a commit that referenced this issue Jun 24, 2020
* Add ModelZoo comfort export, see Issue #71.

* Add test and sample tzw compressed file, see Issue #44 and specify version of tifffile so it handles LZW compressed files.

* Update requirements. See Issue #82.

* Update README.md

Co-authored-by: tibuch <tibuch@mpi-cbg.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants