You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/literate/projective/gallery.md
+11-25Lines changed: 11 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -36,10 +36,7 @@ image = Image(imagedata)
36
36
apply(tfm, image) |> itemdata
37
37
```
38
38
39
-
Now let's say we want to train a light house detector and have a bounding box
40
-
for the light house. We can use the [`BoundingBox`](#) item to represent it.
41
-
It takes the two corners of the bounding rectangle as the first argument. As
42
-
the second argument we have to pass the size of the corresponding image.
39
+
Now let's say we want to train a light house detector and have a bounding box for the light house. We can use the [`BoundingBox`](#) item to represent it. It takes the two corners of the bounding rectangle as the first argument. As the second argument we have to pass the size of the corresponding image.
If we apply transformations like translation and cropping
56
-
to the image, then the same transformations have to be applied to the bounding
57
-
box. Otherwise, the bounding box will no longer match up with the light house.
52
+
If we apply transformations like translation and cropping to the image, then the same transformations have to be applied to the bounding box. Otherwise, the bounding box will no longer match up with the light house.
58
53
59
-
Another problem can occur with stochastic transformations like [`RandomResizeCrop`](#).
60
-
If we apply it separately to the image and the bounding box, they will be cropped from
61
-
slightly different locations:
54
+
Another problem can occur with stochastic transformations like [`RandomResizeCrop`](#). If we apply it separately to the image and the bounding box, they will be cropped from slightly different locations:
62
55
63
56
{cell=main}
64
57
```julia
@@ -68,22 +61,18 @@ showitems((
68
61
apply(tfm, bbox)
69
62
))
70
63
```
71
-
Instead, pass a tuple of the items to a single `apply` call so the same
72
-
random state will be used for both image and bounding box:
64
+
Instead, pass a tuple of the items to a single `apply` call so the same random state will be used for both image and bounding box:
73
65
74
66
{cell=main}
75
67
```julia
76
68
apply(tfm, (image, bbox)) |> showitems
77
69
```
78
-
!!! info "3D Projective dimensions"
79
-
80
-
We'll use a 2-dimensional [`Image`](#) and [`BoundingBox`](#) here, but you can apply
81
-
most projective transformations to any spatial item (including [`Keypoints`](#),
82
-
[`MaskBinary`](#) and [`MaskMulti`](#)) in 3 dimensions.
83
70
84
-
Of course, you have to create a 3-dimensional transformation, i.e.
85
-
`CenterCrop((128, 128, 128))` instead of `CenterCrop((128, 128))`.
71
+
!!! info "3D Projective dimensions"
86
72
73
+
We'll use a 2-dimensional [`Image`](#) and [`BoundingBox`](#) here, but you can apply most projective transformations to any spatial item (including [`Keypoints`](#), [`MaskBinary`](#) and [`MaskMulti`](#)) in 3 dimensions.
74
+
75
+
Of course, you have to create a 3-dimensional transformation, i.e. `CenterCrop((128, 128, 128))` instead of `CenterCrop((128, 128))`.
87
76
88
77
## Gallery
89
78
{cell=main style="display:none;" result=false}
@@ -110,8 +99,7 @@ end
110
99
111
100
### [`RandomResizeCrop`](#)`(sz)`
112
101
113
-
Resizes the sides so that one of them is no longer than `sz` and
114
-
crops a region of size `sz`*from a random location*.
102
+
Resizes the sides so that one of them is no longer than `sz` and crops a region of size `sz`*from a random location*.
0 commit comments