mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 02:31:11 +06:00
Fix image segmentation example - don't reopen image (#30481)
Fix image segmentation example - don't repoen image
This commit is contained in:
parent
6e0cba3cec
commit
d2feb54591
@ -115,7 +115,7 @@ In instance segmentation, the goal is not to classify every pixel, but to predic
|
||||
|
||||
```python
|
||||
instance_segmentation = pipeline("image-segmentation", "facebook/mask2former-swin-large-cityscapes-instance")
|
||||
results = instance_segmentation(Image.open(image))
|
||||
results = instance_segmentation(image)
|
||||
results
|
||||
```
|
||||
|
||||
@ -148,7 +148,7 @@ Panoptic segmentation combines semantic segmentation and instance segmentation,
|
||||
|
||||
```python
|
||||
panoptic_segmentation = pipeline("image-segmentation", "facebook/mask2former-swin-large-cityscapes-panoptic")
|
||||
results = panoptic_segmentation(Image.open(image))
|
||||
results = panoptic_segmentation(image)
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user