@@ -17,6 +17,7 @@ def _test_build_spec(
1717 add_deepimagej_config = False ,
1818 use_original_covers = False ,
1919 use_absoloute_arch_path = False ,
20+ training_data = None ,
2021):
2122 from bioimageio .core .build_spec import build_model
2223
@@ -115,6 +116,8 @@ def _test_build_spec(
115116 kwargs ["pixel_sizes" ] = [{"x" : 5.0 , "y" : 5.0 }]
116117 if use_original_covers :
117118 kwargs ["covers" ] = resolve_source (model_spec .covers , root )
119+ if training_data is not None :
120+ kwargs ["training_data" ] = training_data
118121
119122 build_model (** kwargs )
120123 assert out_path .exists ()
@@ -193,6 +196,21 @@ def test_build_spec_deepimagej(unet2d_nuclei_broad_model, tmp_path):
193196 _test_build_spec (unet2d_nuclei_broad_model , tmp_path / "model.zip" , "torchscript" , add_deepimagej_config = True )
194197
195198
199+ def test_build_spec_training_data1 (unet2d_nuclei_broad_model , tmp_path ):
200+ training_data = {"id" : "ilastik/stradist_dsb_training_data" }
201+ _test_build_spec (unet2d_nuclei_broad_model , tmp_path / "model.zip" , "torchscript" , training_data = training_data )
202+
203+
204+ def test_build_spec_training_data2 (unet2d_nuclei_broad_model , tmp_path ):
205+ training_data = {
206+ "type" : "dataset" ,
207+ "name" : "nucleus-training-data" ,
208+ "description" : "stardist nucleus training data" ,
209+ "source" : "https://github.com/stardist/stardist/releases/download/0.1.0/dsb2018.zip" ,
210+ }
211+ _test_build_spec (unet2d_nuclei_broad_model , tmp_path / "model.zip" , "torchscript" , training_data = training_data )
212+
213+
196214def test_build_spec_deepimagej_keras (unet2d_keras , tmp_path ):
197215 _test_build_spec (
198216 unet2d_keras , tmp_path / "model.zip" , "keras_hdf5" , add_deepimagej_config = True , tensorflow_version = "1.12"
0 commit comments