Update README.md
Browse files
README.md
CHANGED
@@ -46,20 +46,16 @@ inputs = processor(
|
|
46 |
return_tensors="pt",
|
47 |
)
|
48 |
|
49 |
-
# Remove Patch Offsets from inputs — only used later for post-processing.
|
50 |
-
patch_offsets = inputs.pop("patch_offsets")
|
51 |
-
|
52 |
with torch.inference_mode():
|
53 |
outputs = model(**inputs)
|
54 |
|
55 |
# Prepare the original image size in the format (height, width)
|
56 |
-
|
57 |
|
58 |
# Post-process the model outputs to get final segmentation prediction
|
59 |
preds = processor.post_process_semantic_segmentation(
|
60 |
outputs,
|
61 |
-
|
62 |
-
original_image_sizes=original_image_sizes,
|
63 |
)
|
64 |
|
65 |
# Visualize the segmentation mask
|
|
|
46 |
return_tensors="pt",
|
47 |
)
|
48 |
|
|
|
|
|
|
|
49 |
with torch.inference_mode():
|
50 |
outputs = model(**inputs)
|
51 |
|
52 |
# Prepare the original image size in the format (height, width)
|
53 |
+
target_sizes = [(image.height, image.width)]
|
54 |
|
55 |
# Post-process the model outputs to get final segmentation prediction
|
56 |
preds = processor.post_process_semantic_segmentation(
|
57 |
outputs,
|
58 |
+
target_sizes=target_sizes,
|
|
|
59 |
)
|
60 |
|
61 |
# Visualize the segmentation mask
|