Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
80f29a25
Unverified
Commit
80f29a25
authored
Aug 14, 2023
by
amyeroberts
Committed by
GitHub
Aug 14, 2023
Browse files
MaskFormer post_process_instance_segmentation bug fix convert out side of loop (#25497)
Bug fix - convert out side of loop
parent
ee7d6694
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/transformers/models/mask2former/image_processing_mask2former.py
...ormers/models/mask2former/image_processing_mask2former.py
+4
-3
src/transformers/models/maskformer/image_processing_maskformer.py
...sformers/models/maskformer/image_processing_maskformer.py
+4
-3
No files found.
src/transformers/models/mask2former/image_processing_mask2former.py
View file @
80f29a25
...
@@ -1026,6 +1026,7 @@ class Mask2FormerImageProcessor(BaseImageProcessor):
...
@@ -1026,6 +1026,7 @@ class Mask2FormerImageProcessor(BaseImageProcessor):
)
)
current_segment_id
+=
1
current_segment_id
+=
1
instance_maps
.
append
(
pred_masks
[
j
])
instance_maps
.
append
(
pred_masks
[
j
])
# Return segmentation map in run-length encoding (RLE) format
# Return segmentation map in run-length encoding (RLE) format
if
return_coco_annotation
:
if
return_coco_annotation
:
segmentation
=
convert_segmentation_to_rle
(
segmentation
)
segmentation
=
convert_segmentation_to_rle
(
segmentation
)
...
...
src/transformers/models/maskformer/image_processing_maskformer.py
View file @
80f29a25
...
@@ -1081,6 +1081,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
...
@@ -1081,6 +1081,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
)
)
current_segment_id
+=
1
current_segment_id
+=
1
instance_maps
.
append
(
pred_masks
[
j
])
instance_maps
.
append
(
pred_masks
[
j
])
# Return segmentation map in run-length encoding (RLE) format
# Return segmentation map in run-length encoding (RLE) format
if
return_coco_annotation
:
if
return_coco_annotation
:
segmentation
=
convert_segmentation_to_rle
(
segmentation
)
segmentation
=
convert_segmentation_to_rle
(
segmentation
)
...
...
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