Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
1c1aec2e
Unverified
Commit
1c1aec2e
authored
Jun 19, 2024
by
linlin
Committed by
GitHub
Jun 19, 2024
Browse files
Update object_detection.md (#31488)
Define MAX_SIZE before it is used.
parent
83259e40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
docs/source/en/tasks/object_detection.md
docs/source/en/tasks/object_detection.md
+2
-2
No files found.
docs/source/en/tasks/object_detection.md
View file @
1c1aec2e
...
@@ -204,6 +204,8 @@ Instantiate the image processor from the same checkpoint as the model you want t
...
@@ -204,6 +204,8 @@ Instantiate the image processor from the same checkpoint as the model you want t
```
py
```
py
>>>
from
transformers
import
AutoImageProcessor
>>>
from
transformers
import
AutoImageProcessor
>>>
MAX_SIZE
=
IMAGE_SIZE
>>>
image_processor
=
AutoImageProcessor
.
from_pretrained
(
>>>
image_processor
=
AutoImageProcessor
.
from_pretrained
(
...
MODEL_NAME
,
...
MODEL_NAME
,
...
do_resize
=
True
,
...
do_resize
=
True
,
...
@@ -225,8 +227,6 @@ and it uses the exact same dataset as an example. Apply some geometric and color
...
@@ -225,8 +227,6 @@ and it uses the exact same dataset as an example. Apply some geometric and color
```
py
```
py
>>>
import
albumentations
as
A
>>>
import
albumentations
as
A
>>>
max_size
=
IMAGE_SIZE
>>>
train_augment_and_transform
=
A
.
Compose
(
>>>
train_augment_and_transform
=
A
.
Compose
(
...
[
...
[
...
A
.
Perspective
(
p
=
0.1
),
...
A
.
Perspective
(
p
=
0.1
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment