Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencil_reco
Commits
2a9333ca
Commit
2a9333ca
authored
Nov 12, 2020
by
Stephan Seitz
Browse files
Autoformat
parent
daa70961
Pipeline
#27930
failed with stage
in 60 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/test_superresolution.py
View file @
2a9333ca
...
...
@@ -52,6 +52,7 @@ def test_torch_simple(constant_h):
x
,
y
=
pystencils
.
fields
(
'x,y: float32[2d]'
)
h
=
pystencils
.
fields
(
'h0,h1,h2,h3,h4,h5,h6,h7: float32[2d]'
)
@
crazy
def
move
(
x
,
y
):
A
=
sympy
.
Matrix
([[
h
[
0
].
center
,
h
[
1
].
center
,
h
[
2
].
center
],
...
...
@@ -59,7 +60,6 @@ def test_torch_simple(constant_h):
[
h
[
6
].
center
,
h
[
7
].
center
,
1
]])
return
{
y
.
center
:
x
.
interpolated_access
(
ProjectiveMatrix
(
A
)
@
pystencils
.
x_vector
(
2
))
}
if
constant_h
:
...
...
@@ -129,7 +129,7 @@ def test_warp():
for
_
in
range
(
NUM_LENNAS
))
scale_transform
(
lr_warp_vectors
[
0
],
warp_vectors
[
0
],
10
).
compile
()().
forward
(
input_field
=
lr_warp_vectors
[
0
],
output_field
=
warp_vectors
[
0
])
output_field
=
warp_vectors
[
0
])
# for i in range(len(warp_vectors)):
# scale(lr_warp_vectors[i], warp_vectors[i], 10)
...
...
@@ -157,7 +157,6 @@ def test_to_polar():
lenna_file
=
join
(
dirname
(
__file__
),
"test_data"
,
"lenna.png"
)
lenna
=
skimage
.
io
.
imread
(
lenna_file
,
as_gray
=
True
).
astype
(
np
.
float32
)
hr
,
lr
=
pystencils
.
fields
(
'hr, lr: float32[2d]'
)
hr
.
set_coordinate_origin_to_field_center
()
...
...
@@ -165,6 +164,7 @@ def test_to_polar():
lr
.
coordinate_transform
=
lambda
x
:
sympy
.
Matrix
((
x
.
norm
(),
sympy
.
atan2
(
*
x
)
/
sympy
.
pi
*
500
))
def
test_polar_transform
():
x
,
y
=
pystencils
.
fields
(
'x, y: float32[2d]'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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