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
OpenDAS
diffusers
Commits
beb59abf
Unverified
Commit
beb59abf
authored
Feb 10, 2023
by
Will Berman
Committed by
GitHub
Feb 10, 2023
Browse files
remove ddpm test_full_inference (#2291)
* remove ddpm test_full_inference * style
parent
96c2279b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
26 deletions
+0
-26
tests/pipelines/ddpm/test_ddpm.py
tests/pipelines/ddpm/test_ddpm.py
+0
-26
No files found.
tests/pipelines/ddpm/test_ddpm.py
View file @
beb59abf
...
@@ -66,32 +66,6 @@ class DDPMPipelineFastTests(unittest.TestCase):
...
@@ -66,32 +66,6 @@ class DDPMPipelineFastTests(unittest.TestCase):
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
assert
np
.
abs
(
image_from_tuple_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
assert
np
.
abs
(
image_from_tuple_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
def
test_full_inference
(
self
):
device
=
"cpu"
unet
=
self
.
dummy_uncond_unet
scheduler
=
DDPMScheduler
()
ddpm
=
DDPMPipeline
(
unet
=
unet
,
scheduler
=
scheduler
)
ddpm
.
to
(
device
)
ddpm
.
set_progress_bar_config
(
disable
=
None
)
generator
=
torch
.
Generator
(
device
=
device
).
manual_seed
(
0
)
image
=
ddpm
(
generator
=
generator
,
output_type
=
"numpy"
).
images
generator
=
torch
.
Generator
(
device
=
device
).
manual_seed
(
0
)
image_from_tuple
=
ddpm
(
generator
=
generator
,
output_type
=
"numpy"
,
return_dict
=
False
)[
0
]
image_slice
=
image
[
0
,
-
3
:,
-
3
:,
-
1
]
image_from_tuple_slice
=
image_from_tuple
[
0
,
-
3
:,
-
3
:,
-
1
]
assert
image
.
shape
==
(
1
,
32
,
32
,
3
)
expected_slice
=
np
.
array
(
[
1.0
,
3.495e-02
,
2.939e-01
,
9.821e-01
,
9.448e-01
,
6.261e-03
,
7.998e-01
,
8.9e-01
,
1.122e-02
]
)
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
assert
np
.
abs
(
image_from_tuple_slice
.
flatten
()
-
expected_slice
).
max
()
<
1e-2
def
test_inference_predict_sample
(
self
):
def
test_inference_predict_sample
(
self
):
unet
=
self
.
dummy_uncond_unet
unet
=
self
.
dummy_uncond_unet
scheduler
=
DDPMScheduler
(
prediction_type
=
"sample"
)
scheduler
=
DDPMScheduler
(
prediction_type
=
"sample"
)
...
...
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