Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
6c8017a5
Unverified
Commit
6c8017a5
authored
Jul 11, 2022
by
Sylvain Gugger
Committed by
GitHub
Jul 11, 2022
Browse files
Fix image segmentation and object detection pipeline tests (#18100)
parent
b0520f59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
14 deletions
+12
-14
tests/pipelines/test_pipelines_image_segmentation.py
tests/pipelines/test_pipelines_image_segmentation.py
+6
-7
tests/pipelines/test_pipelines_object_detection.py
tests/pipelines/test_pipelines_object_detection.py
+6
-7
No files found.
tests/pipelines/test_pipelines_image_segmentation.py
View file @
6c8017a5
...
@@ -147,7 +147,6 @@ class ImageSegmentationPipelineTests(unittest.TestCase, metaclass=PipelineTestCa
...
@@ -147,7 +147,6 @@ class ImageSegmentationPipelineTests(unittest.TestCase, metaclass=PipelineTestCa
pass
pass
@
require_torch
@
require_torch
@
unittest
.
skip
(
"Test is broken, fix me please!"
)
def
test_small_model_pt
(
self
):
def
test_small_model_pt
(
self
):
model_id
=
"hf-internal-testing/tiny-detr-mobilenetsv3-panoptic"
model_id
=
"hf-internal-testing/tiny-detr-mobilenetsv3-panoptic"
...
@@ -165,12 +164,12 @@ class ImageSegmentationPipelineTests(unittest.TestCase, metaclass=PipelineTestCa
...
@@ -165,12 +164,12 @@ class ImageSegmentationPipelineTests(unittest.TestCase, metaclass=PipelineTestCa
[
[
{
{
"score"
:
0.004
,
"score"
:
0.004
,
"label"
:
"LABEL_
0
"
,
"label"
:
"LABEL_
215
"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
},
},
{
{
"score"
:
0.004
,
"score"
:
0.004
,
"label"
:
"LABEL_
0
"
,
"label"
:
"LABEL_
215
"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
},
},
],
],
...
@@ -193,24 +192,24 @@ class ImageSegmentationPipelineTests(unittest.TestCase, metaclass=PipelineTestCa
...
@@ -193,24 +192,24 @@ class ImageSegmentationPipelineTests(unittest.TestCase, metaclass=PipelineTestCa
[
[
{
{
"score"
:
0.004
,
"score"
:
0.004
,
"label"
:
"LABEL_
0
"
,
"label"
:
"LABEL_
215
"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
},
},
{
{
"score"
:
0.004
,
"score"
:
0.004
,
"label"
:
"LABEL_
0
"
,
"label"
:
"LABEL_
215
"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
},
},
],
],
[
[
{
{
"score"
:
0.004
,
"score"
:
0.004
,
"label"
:
"LABEL_
0
"
,
"label"
:
"LABEL_
215
"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
},
},
{
{
"score"
:
0.004
,
"score"
:
0.004
,
"label"
:
"LABEL_
0
"
,
"label"
:
"LABEL_
215
"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
"mask"
:
"34eecd16bbfb0f476083ef947d81bf66"
,
},
},
],
],
...
...
tests/pipelines/test_pipelines_object_detection.py
View file @
6c8017a5
...
@@ -105,7 +105,6 @@ class ObjectDetectionPipelineTests(unittest.TestCase, metaclass=PipelineTestCase
...
@@ -105,7 +105,6 @@ class ObjectDetectionPipelineTests(unittest.TestCase, metaclass=PipelineTestCase
pass
pass
@
require_torch
@
require_torch
@
unittest
.
skip
(
"Test is broken, fix me please!"
)
def
test_small_model_pt
(
self
):
def
test_small_model_pt
(
self
):
model_id
=
"hf-internal-testing/tiny-detr-mobilenetsv3"
model_id
=
"hf-internal-testing/tiny-detr-mobilenetsv3"
...
@@ -118,8 +117,8 @@ class ObjectDetectionPipelineTests(unittest.TestCase, metaclass=PipelineTestCase
...
@@ -118,8 +117,8 @@ class ObjectDetectionPipelineTests(unittest.TestCase, metaclass=PipelineTestCase
self
.
assertEqual
(
self
.
assertEqual
(
nested_simplify
(
outputs
,
decimals
=
4
),
nested_simplify
(
outputs
,
decimals
=
4
),
[
[
{
"score"
:
0.3
432
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
60
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
376
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
59
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
432
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
60
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
376
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
59
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
],
],
)
)
...
@@ -135,12 +134,12 @@ class ObjectDetectionPipelineTests(unittest.TestCase, metaclass=PipelineTestCase
...
@@ -135,12 +134,12 @@ class ObjectDetectionPipelineTests(unittest.TestCase, metaclass=PipelineTestCase
nested_simplify
(
outputs
,
decimals
=
4
),
nested_simplify
(
outputs
,
decimals
=
4
),
[
[
[
[
{
"score"
:
0.3
432
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
60
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
376
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
59
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
432
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
60
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
376
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
59
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
],
],
[
[
{
"score"
:
0.3
432
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
60
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
376
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
59
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
432
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
60
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
{
"score"
:
0.3
376
,
"label"
:
"LABEL_0"
,
"box"
:
{
"xmin"
:
1
59
,
"ymin"
:
120
,
"xmax"
:
480
,
"ymax"
:
359
}},
],
],
],
],
)
)
...
...
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