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
renzhc
diffusers_dcu
Commits
994360f7
Unverified
Commit
994360f7
authored
Feb 07, 2024
by
Dhruv Nair
Committed by
GitHub
Feb 06, 2024
Browse files
Fix last IP Adapter test (#6875)
update
parent
e6a48db6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py
...pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py
+2
-5
No files found.
tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py
View file @
994360f7
...
@@ -235,8 +235,7 @@ class IPAdapterSDIntegrationTests(IPAdapterNightlyTestsMixin):
...
@@ -235,8 +235,7 @@ class IPAdapterSDIntegrationTests(IPAdapterNightlyTestsMixin):
inputs
=
self
.
get_dummy_inputs
()
inputs
=
self
.
get_dummy_inputs
()
images
=
pipeline
(
**
inputs
).
images
images
=
pipeline
(
**
inputs
).
images
image_slice
=
images
[
0
,
:
3
,
:
3
,
-
1
].
flatten
()
image_slice
=
images
[
0
,
:
3
,
:
3
,
-
1
].
flatten
()
expected_slice
=
np
.
array
([
0.1704
,
0.1296
,
0.1272
,
0.2212
,
0.1514
,
0.1479
,
0.4172
,
0.4263
,
0.4360
])
expected_slice
=
np
.
array
([
0.1958
,
0.1475
,
0.1396
,
0.2412
,
0.1658
,
0.1533
,
0.3997
,
0.4055
,
0.4128
])
max_diff
=
numpy_cosine_similarity_distance
(
image_slice
,
expected_slice
)
max_diff
=
numpy_cosine_similarity_distance
(
image_slice
,
expected_slice
)
assert
max_diff
<
5e-4
assert
max_diff
<
5e-4
...
@@ -276,9 +275,7 @@ class IPAdapterSDIntegrationTests(IPAdapterNightlyTestsMixin):
...
@@ -276,9 +275,7 @@ class IPAdapterSDIntegrationTests(IPAdapterNightlyTestsMixin):
inputs
[
"ip_adapter_image"
]
=
[
ip_adapter_image
,
[
ip_adapter_image
]
*
2
]
inputs
[
"ip_adapter_image"
]
=
[
ip_adapter_image
,
[
ip_adapter_image
]
*
2
]
images
=
pipeline
(
**
inputs
).
images
images
=
pipeline
(
**
inputs
).
images
image_slice
=
images
[
0
,
:
3
,
:
3
,
-
1
].
flatten
()
image_slice
=
images
[
0
,
:
3
,
:
3
,
-
1
].
flatten
()
expected_slice
=
np
.
array
(
expected_slice
=
np
.
array
([
0.1704
,
0.1296
,
0.1272
,
0.2212
,
0.1514
,
0.1479
,
0.4172
,
0.4263
,
0.4360
])
[
0.5234375
,
0.53515625
,
0.5629883
,
0.57128906
,
0.59521484
,
0.62109375
,
0.57910156
,
0.6201172
,
0.6508789
]
)
max_diff
=
numpy_cosine_similarity_distance
(
image_slice
,
expected_slice
)
max_diff
=
numpy_cosine_similarity_distance
(
image_slice
,
expected_slice
)
assert
max_diff
<
5e-4
assert
max_diff
<
5e-4
...
...
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