{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Dynamic U-Net" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This module builds a dynamic [U-Net](https://arxiv.org/abs/1505.04597) from any backbone pretrained on ImageNet, automatically inferring the intermediate sizes." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "from fastai.gen_doc.nbdoc import *\n", "from fastai.vision.models.unet import * " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![U-Net architecture](imgs/u-net-architecture.png)\n", "\n", "This is the original U-Net. The difference here is that the left part is a pretrained model." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [ { "data": { "text/markdown": [ "
class
DynamicUnet
[source][test]DynamicUnet
(**`encoder`**:[`Module`](https://pytorch.org/docs/stable/nn.html#torch.nn.Module), **`n_classes`**:`int`, **`blur`**:`bool`=***`False`***, **`blur_final`**=***`True`***, **`self_attention`**:`bool`=***`False`***, **`y_range`**:`OptRange`=***`None`***, **`last_cross`**:`bool`=***`True`***, **`bottle`**:`bool`=***`False`***, **\\*\\*`kwargs`**) :: [`SequentialEx`](/layers.html#SequentialEx)\n",
"\n",
"class
UnetBlock
[source][test]UnetBlock
(**`up_in_c`**:`int`, **`x_in_c`**:`int`, **`hook`**:[`Hook`](/callbacks.hooks.html#Hook), **`final_div`**:`bool`=***`True`***, **`blur`**:`bool`=***`False`***, **`leaky`**:`float`=***`None`***, **`self_attention`**:`bool`=***`False`***, **\\*\\*`kwargs`**) :: [`Module`](https://pytorch.org/docs/stable/nn.html#torch.nn.Module)\n",
"\n",
"No tests found for UnetBlock
. To contribute a test please refer to this guide and this discussion.
forward
[source][test]forward
(**`up_in`**:`Tensor`) → `Tensor`\n",
"\n",
"No tests found for forward
. To contribute a test please refer to this guide and this discussion.