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
d2feb545
Unverified
Commit
d2feb545
authored
May 01, 2024
by
amyeroberts
Committed by
GitHub
May 01, 2024
Browse files
Fix image segmentation example - don't reopen image (#30481)
Fix image segmentation example - don't repoen image
parent
6e0cba3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
docs/source/en/tasks/semantic_segmentation.md
docs/source/en/tasks/semantic_segmentation.md
+5
-5
No files found.
docs/source/en/tasks/semantic_segmentation.md
View file @
d2feb545
...
@@ -115,7 +115,7 @@ In instance segmentation, the goal is not to classify every pixel, but to predic
...
@@ -115,7 +115,7 @@ In instance segmentation, the goal is not to classify every pixel, but to predic
```
python
```
python
instance_segmentation
=
pipeline
(
"image-segmentation"
,
"facebook/mask2former-swin-large-cityscapes-instance"
)
instance_segmentation
=
pipeline
(
"image-segmentation"
,
"facebook/mask2former-swin-large-cityscapes-instance"
)
results
=
instance_segmentation
(
Image
.
open
(
image
)
)
results
=
instance_segmentation
(
image
)
results
results
```
```
...
@@ -148,7 +148,7 @@ Panoptic segmentation combines semantic segmentation and instance segmentation,
...
@@ -148,7 +148,7 @@ Panoptic segmentation combines semantic segmentation and instance segmentation,
```
python
```
python
panoptic_segmentation
=
pipeline
(
"image-segmentation"
,
"facebook/mask2former-swin-large-cityscapes-panoptic"
)
panoptic_segmentation
=
pipeline
(
"image-segmentation"
,
"facebook/mask2former-swin-large-cityscapes-panoptic"
)
results
=
panoptic_segmentation
(
Image
.
open
(
image
)
)
results
=
panoptic_segmentation
(
image
)
results
results
```
```
As you can see below, we have more classes. We will later illustrate to see that every pixel is classified into one of the classes.
As you can see below, we have more classes. We will later illustrate to see that every pixel is classified into one of the classes.
...
...
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