Fix typos
Browse files
README.md
CHANGED
|
@@ -47,19 +47,19 @@ processor = OneFormerProcessor.from_pretrained("shi-labs/oneformer_ade20k_swin_l
|
|
| 47 |
model = OneFormerForUniversalSegmentation.from_pretrained("shi-labs/oneformer_ade20k_swin_large")
|
| 48 |
|
| 49 |
# Semantic Segmentation
|
| 50 |
-
semantic_inputs = processor(images=image, ["semantic"] return_tensors="pt")
|
| 51 |
semantic_outputs = model(**semantic_inputs)
|
| 52 |
# pass through image_processor for postprocessing
|
| 53 |
predicted_semantic_map = processor.post_process_semantic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]
|
| 54 |
|
| 55 |
# Instance Segmentation
|
| 56 |
-
instance_inputs = processor(images=image, ["instance"] return_tensors="pt")
|
| 57 |
instance_outputs = model(**instance_inputs)
|
| 58 |
# pass through image_processor for postprocessing
|
| 59 |
predicted_instance_map = processor.post_process_instance_segmentation(outputs, target_sizes=[image.size[::-1]])[0]["segmentation"]
|
| 60 |
|
| 61 |
# Panoptic Segmentation
|
| 62 |
-
panoptic_inputs = processor(images=image, ["panoptic"] return_tensors="pt")
|
| 63 |
panoptic_outputs = model(**panoptic_inputs)
|
| 64 |
# pass through image_processor for postprocessing
|
| 65 |
predicted_semantic_map = processor.post_process_panoptic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]["segmentation"]
|
|
|
|
| 47 |
model = OneFormerForUniversalSegmentation.from_pretrained("shi-labs/oneformer_ade20k_swin_large")
|
| 48 |
|
| 49 |
# Semantic Segmentation
|
| 50 |
+
semantic_inputs = processor(images=image, task_inputs=["semantic"], return_tensors="pt")
|
| 51 |
semantic_outputs = model(**semantic_inputs)
|
| 52 |
# pass through image_processor for postprocessing
|
| 53 |
predicted_semantic_map = processor.post_process_semantic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]
|
| 54 |
|
| 55 |
# Instance Segmentation
|
| 56 |
+
instance_inputs = processor(images=image, task_inputs=["instance"], return_tensors="pt")
|
| 57 |
instance_outputs = model(**instance_inputs)
|
| 58 |
# pass through image_processor for postprocessing
|
| 59 |
predicted_instance_map = processor.post_process_instance_segmentation(outputs, target_sizes=[image.size[::-1]])[0]["segmentation"]
|
| 60 |
|
| 61 |
# Panoptic Segmentation
|
| 62 |
+
panoptic_inputs = processor(images=image, task_inputs=["panoptic"], return_tensors="pt")
|
| 63 |
panoptic_outputs = model(**panoptic_inputs)
|
| 64 |
# pass through image_processor for postprocessing
|
| 65 |
predicted_semantic_map = processor.post_process_panoptic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]["segmentation"]
|