|
10 | 10 | }, |
11 | 11 | { |
12 | 12 | "cell_type": "code", |
13 | | - "execution_count": 1, |
| 13 | + "execution_count": null, |
14 | 14 | "id": "c72ba149", |
15 | 15 | "metadata": {}, |
16 | 16 | "outputs": [], |
|
29 | 29 | }, |
30 | 30 | { |
31 | 31 | "cell_type": "code", |
32 | | - "execution_count": 2, |
| 32 | + "execution_count": null, |
33 | 33 | "id": "74613461", |
34 | 34 | "metadata": {}, |
35 | 35 | "outputs": [], |
|
52 | 52 | }, |
53 | 53 | { |
54 | 54 | "cell_type": "code", |
55 | | - "execution_count": 3, |
| 55 | + "execution_count": null, |
56 | 56 | "id": "2de51dae", |
57 | 57 | "metadata": {}, |
58 | 58 | "outputs": [], |
59 | 59 | "source": [ |
60 | | - "# rdf_url = \"https://sandbox.zenodo.org/record/881989/files/rdf.yaml\"\n", |
61 | | - "rdf_url = \"https://sandbox.zenodo.org/record/881989/files/rdf.yaml?download=1\"\n", |
62 | | - "rdf_doi = \"10.5072/zenodo.881940\"\n", |
| 60 | + "rdf_url = \"https://sandbox.zenodo.org/record/933830/files/rdf.yaml\"\n", |
| 61 | + "\n", |
| 62 | + "rdf_doi = \"10.5072/zenodo.933830\"\n", |
| 63 | + "\n", |
63 | 64 | "rdf_path = \"/home/pape/Downloads/dsb-nuclei-boundarymodelnew_pytorch_state_dict.zip\"" |
64 | 65 | ] |
65 | 66 | }, |
66 | 67 | { |
67 | 68 | "cell_type": "code", |
68 | | - "execution_count": 4, |
| 69 | + "execution_count": null, |
69 | 70 | "id": "ce884f8c", |
70 | 71 | "metadata": {}, |
71 | 72 | "outputs": [], |
72 | 73 | "source": [ |
73 | 74 | "# load model from link to rdf.yaml\n", |
74 | | - "# TODO does not work yet\n", |
75 | | - "# model_resource = bioimageio.core.load_resource_description(rdf_url)" |
| 75 | + "model_resource = bioimageio.core.load_resource_description(rdf_url)" |
76 | 76 | ] |
77 | 77 | }, |
78 | 78 | { |
79 | 79 | "cell_type": "code", |
80 | | - "execution_count": 5, |
| 80 | + "execution_count": null, |
81 | 81 | "id": "c1230b2d", |
82 | 82 | "metadata": {}, |
83 | 83 | "outputs": [], |
84 | 84 | "source": [ |
85 | | - "# TODO does not work yet\n", |
86 | | - "# model_resource = bioimageio.core.load_resource_description(rdf_doi)" |
| 85 | + "# load model from doi\n", |
| 86 | + "model_resource = bioimageio.core.load_resource_description(rdf_doi)" |
87 | 87 | ] |
88 | 88 | }, |
89 | 89 | { |
90 | 90 | "cell_type": "code", |
91 | | - "execution_count": 6, |
| 91 | + "execution_count": null, |
92 | 92 | "id": "8329315c", |
93 | 93 | "metadata": {}, |
94 | 94 | "outputs": [], |
|
108 | 108 | }, |
109 | 109 | { |
110 | 110 | "cell_type": "code", |
111 | | - "execution_count": 8, |
| 111 | + "execution_count": null, |
112 | 112 | "id": "f59b1b15", |
113 | 113 | "metadata": {}, |
114 | 114 | "outputs": [], |
|
118 | 118 | }, |
119 | 119 | { |
120 | 120 | "cell_type": "code", |
121 | | - "execution_count": 9, |
| 121 | + "execution_count": null, |
122 | 122 | "id": "808e2ca7", |
123 | 123 | "metadata": {}, |
124 | 124 | "outputs": [], |
|
139 | 139 | }, |
140 | 140 | { |
141 | 141 | "cell_type": "code", |
142 | | - "execution_count": 10, |
| 142 | + "execution_count": null, |
143 | 143 | "id": "4f235e9a", |
144 | 144 | "metadata": {}, |
145 | | - "outputs": [ |
146 | | - { |
147 | | - "name": "stderr", |
148 | | - "output_type": "stream", |
149 | | - "text": [ |
150 | | - "/home/pape/Work/software/conda/miniconda3/envs/bio-core-dev/lib/python3.7/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /tmp/pip-req-build-xi8rb33b/c10/core/TensorImpl.h:1156.)\n", |
151 | | - " return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)\n" |
152 | | - ] |
153 | | - } |
154 | | - ], |
| 145 | + "outputs": [], |
155 | 146 | "source": [ |
156 | 147 | "prediction = predict_numpy(model_resource, input_image)\n", |
157 | 148 | "show_images(input_image, prediction, names=[\"image\", \"prediction\"])" |
158 | 149 | ] |
159 | 150 | }, |
160 | 151 | { |
161 | 152 | "cell_type": "code", |
162 | | - "execution_count": 11, |
| 153 | + "execution_count": null, |
163 | 154 | "id": "58f6c459", |
164 | 155 | "metadata": {}, |
165 | 156 | "outputs": [], |
|
178 | 169 | }, |
179 | 170 | { |
180 | 171 | "cell_type": "code", |
181 | | - "execution_count": 12, |
| 172 | + "execution_count": null, |
182 | 173 | "id": "879618df", |
183 | 174 | "metadata": {}, |
184 | 175 | "outputs": [], |
|
198 | 189 | }, |
199 | 190 | { |
200 | 191 | "cell_type": "code", |
201 | | - "execution_count": 13, |
| 192 | + "execution_count": null, |
202 | 193 | "id": "5962d73a", |
203 | 194 | "metadata": {}, |
204 | | - "outputs": [ |
205 | | - { |
206 | | - "name": "stderr", |
207 | | - "output_type": "stream", |
208 | | - "text": [ |
209 | | - "invalid local relative path: documentation.md\n" |
210 | | - ] |
211 | | - } |
212 | | - ], |
| 195 | + "outputs": [], |
213 | 196 | "source": [ |
214 | 197 | "# create a new model with different post-processing\n", |
215 | 198 | "from bioimageio.core.build_spec import build_model\n", |
|
265 | 248 | }, |
266 | 249 | { |
267 | 250 | "cell_type": "code", |
268 | | - "execution_count": 14, |
| 251 | + "execution_count": null, |
269 | 252 | "id": "e0616547", |
270 | 253 | "metadata": {}, |
271 | 254 | "outputs": [], |
|
285 | 268 | }, |
286 | 269 | { |
287 | 270 | "cell_type": "code", |
288 | | - "execution_count": 16, |
| 271 | + "execution_count": null, |
289 | 272 | "id": "482a64bb", |
290 | 273 | "metadata": {}, |
291 | | - "outputs": [ |
292 | | - { |
293 | | - "name": "stderr", |
294 | | - "output_type": "stream", |
295 | | - "text": [ |
296 | | - "invalid local relative path: ./documentation.md\n" |
297 | | - ] |
298 | | - } |
299 | | - ], |
| 274 | + "outputs": [], |
300 | 275 | "source": [ |
301 | 276 | "from bioimageio.core.weight_converter.torch import convert_weights_to_pytorch_script\n", |
302 | 277 | "from bioimageio.core.build_spec import add_weights\n", |
|
309 | 284 | }, |
310 | 285 | { |
311 | 286 | "cell_type": "code", |
312 | | - "execution_count": 17, |
| 287 | + "execution_count": null, |
313 | 288 | "id": "b15dd990", |
314 | 289 | "metadata": {}, |
315 | 290 | "outputs": [], |
|
321 | 296 | }, |
322 | 297 | { |
323 | 298 | "cell_type": "code", |
324 | | - "execution_count": 18, |
| 299 | + "execution_count": null, |
325 | 300 | "id": "2aa9db23", |
326 | 301 | "metadata": {}, |
327 | | - "outputs": [ |
328 | | - { |
329 | | - "name": "stderr", |
330 | | - "output_type": "stream", |
331 | | - "text": [ |
332 | | - "invalid local relative path: ./documentation.md\n" |
333 | | - ] |
334 | | - }, |
335 | | - { |
336 | | - "data": { |
337 | | - "text/plain": [ |
338 | | - "'another_model.zip'" |
339 | | - ] |
340 | | - }, |
341 | | - "execution_count": 18, |
342 | | - "metadata": {}, |
343 | | - "output_type": "execute_result" |
344 | | - } |
345 | | - ], |
| 302 | + "outputs": [], |
346 | 303 | "source": [ |
347 | 304 | "# saving model packages\n", |
348 | 305 | "bioimageio.core.export_resource_package(new_model2_raw, output_path=\"another_model.zip\")" |
|
0 commit comments