diff --git a/11_midlevel_data.ipynb b/11_midlevel_data.ipynb index f953c6b..90234d5 100644 --- a/11_midlevel_data.ipynb +++ b/11_midlevel_data.ipynb @@ -950,7 +950,7 @@ "source": [ "If we didn't care about showing our objects at all, we could directly create one transform to completely preprocess that list of files. We will want to look at those images though, so we need to create a custom type. When you call the `show` method on a `TfmdLists` or a `Datasets` object, it will decode items until it reaches a type that contains a `show` method and use it to show the object. That `show` method gets passed a `ctx`, which could be a `matplotlib` axis for images, or a row of a DataFrame for texts.\n", "\n", - "Here we create a `SiameseImage` object that subclasses `Tuple` and is intended to contain three things: two images, and a Boolean that's `True` if the images are of the same breed. We also implement the special `show` method, such that it concatenates the two images with a black line in the middle. Don't worry too much about the part that is in the `if` test (which is to show the `SiameseImage` when the images are Python images, not tensors); the important part is in the last three lines:" + "Here we create a `SiameseImage` object that subclasses `fastuple` and is intended to contain three things: two images, and a Boolean that's `True` if the images are of the same breed. We also implement the special `show` method, such that it concatenates the two images with a black line in the middle. Don't worry too much about the part that is in the `if` test (which is to show the `SiameseImage` when the images are Python images, not tensors); the important part is in the last three lines:" ] }, { @@ -959,7 +959,7 @@ "metadata": {}, "outputs": [], "source": [ - "class SiameseImage(Tuple):\n", + "class SiameseImage(fastuple):\n", " def show(self, ctx=None, **kwargs): \n", " img1,img2,same_breed = self\n", " if not isinstance(img1, Tensor):\n", @@ -1038,7 +1038,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The important thing with transforms that we saw before is that they dispatch over tuples or their subclasses. That's precisely why we chose to subclass `Tuple` in this instance—this way we can apply any transform that works on images to our `SiameseImage` and it will be applied on each image in the tuple:" + "The important thing with transforms that we saw before is that they dispatch over tuples or their subclasses. That's precisely why we chose to subclass `fastuple` in this instance—this way we can apply any transform that works on images to our `SiameseImage` and it will be applied on each image in the tuple:" ] }, { @@ -1307,4 +1307,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/15_arch_details.ipynb b/15_arch_details.ipynb index edc94a1..90caabc 100644 --- a/15_arch_details.ipynb +++ b/15_arch_details.ipynb @@ -266,7 +266,7 @@ "path = untar_data(URLs.PETS)\n", "files = get_image_files(path/\"images\")\n", "\n", - "class SiameseImage(Tuple):\n", + "class SiameseImage(fastuple):\n", " def show(self, ctx=None, **kwargs): \n", " img1,img2,same_breed = self\n", " if not isinstance(img1, Tensor):\n", @@ -813,4 +813,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file