Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
dcbfd93d
Unverified
Commit
dcbfd93d
authored
Sep 22, 2023
by
Maria Khalusova
Committed by
GitHub
Sep 22, 2023
Browse files
[doc] fixed indices in obj detection example (#26343)
fixed indexes in obj detection example
parent
c3ecf2d9
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 @
dcbfd93d
...
@@ -136,8 +136,8 @@ To get an even better understanding of the data, visualize an example in the dat
...
@@ -136,8 +136,8 @@ To get an even better understanding of the data, visualize an example in the dat
>>>
label2id
=
{
v
:
k
for
k
,
v
in
id2label
.
items
()}
>>>
label2id
=
{
v
:
k
for
k
,
v
in
id2label
.
items
()}
>>>
for
i
in
range
(
len
(
annotations
[
"id"
])):
>>>
for
i
in
range
(
len
(
annotations
[
"id"
])):
...
box
=
annotations
[
"bbox"
][
i
-
1
]
...
box
=
annotations
[
"bbox"
][
i
]
...
class_idx
=
annotations
[
"category"
][
i
-
1
]
...
class_idx
=
annotations
[
"category"
][
i
]
...
x
,
y
,
w
,
h
=
tuple
(
box
)
...
x
,
y
,
w
,
h
=
tuple
(
box
)
...
draw
.
rectangle
((
x
,
y
,
x
+
w
,
y
+
h
),
outline
=
"red"
,
width
=
1
)
...
draw
.
rectangle
((
x
,
y
,
x
+
w
,
y
+
h
),
outline
=
"red"
,
width
=
1
)
...
draw
.
text
((
x
,
y
),
id2label
[
class_idx
],
fill
=
"white"
)
...
draw
.
text
((
x
,
y
),
id2label
[
class_idx
],
fill
=
"white"
)
...
...
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