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
4eea25b4
Unverified
Commit
4eea25b4
authored
May 11, 2023
by
Sylvain Gugger
Committed by
GitHub
May 11, 2023
Browse files
Fix image segmentation tool test (#23306)
parent
662751b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tests/tools/test_image_segmentation.py
tests/tools/test_image_segmentation.py
+2
-2
No files found.
tests/tools/test_image_segmentation.py
View file @
4eea25b4
...
@@ -44,10 +44,10 @@ class ImageSegmentationToolTester(unittest.TestCase, ToolTesterMixin):
...
@@ -44,10 +44,10 @@ class ImageSegmentationToolTester(unittest.TestCase, ToolTesterMixin):
def
test_exact_match_kwarg
(
self
):
def
test_exact_match_kwarg
(
self
):
image
=
Image
.
open
(
Path
(
get_tests_dir
(
"fixtures/tests_samples/COCO"
))
/
"000000039769.png"
).
resize
((
512
,
512
))
image
=
Image
.
open
(
Path
(
get_tests_dir
(
"fixtures/tests_samples/COCO"
))
/
"000000039769.png"
).
resize
((
512
,
512
))
result
=
self
.
tool
(
image
=
image
,
prompt
=
"cat"
)
result
=
self
.
tool
(
image
=
image
,
label
=
"cat"
)
self
.
assertTrue
(
isinstance
(
result
,
Image
.
Image
))
self
.
assertTrue
(
isinstance
(
result
,
Image
.
Image
))
def
test_exact_match_kwarg_remote
(
self
):
def
test_exact_match_kwarg_remote
(
self
):
image
=
Image
.
open
(
Path
(
get_tests_dir
(
"fixtures/tests_samples/COCO"
))
/
"000000039769.png"
).
resize
((
512
,
512
))
image
=
Image
.
open
(
Path
(
get_tests_dir
(
"fixtures/tests_samples/COCO"
))
/
"000000039769.png"
).
resize
((
512
,
512
))
result
=
self
.
remote_tool
(
image
=
image
,
prompt
=
"cat"
)
result
=
self
.
remote_tool
(
image
=
image
,
label
=
"cat"
)
self
.
assertTrue
(
isinstance
(
result
,
Image
.
Image
))
self
.
assertTrue
(
isinstance
(
result
,
Image
.
Image
))
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