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