Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SemiSmoothNewton.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Hilb
SemiSmoothNewton.jl
Commits
30e85623
Commit
30e85623
authored
6 months ago
by
Andreas Langer
Browse files
Options
Downloads
Patches
Plain Diff
duration for optical again included
parent
b1e43968
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/run_experiments.jl
+16
-13
16 additions, 13 deletions
scripts/run_experiments.jl
with
16 additions
and
13 deletions
scripts/run_experiments.jl
+
16
−
13
View file @
30e85623
...
@@ -1441,7 +1441,7 @@ function inpaint(ctx)
...
@@ -1441,7 +1441,7 @@ function inpaint(ctx)
k_refine
>
N_refine
&&
break
k_refine
>
N_refine
&&
break
println
(
"refine ..."
)
println
(
"refine ..."
)
#estimate_res!(st)
#estimate_res!(st)
marked_cells
=
Set
(
mark
(
st
;
theta
=
0.
5
))
marked_cells
=
Set
(
mark
(
st
;
theta
=
0.
99
))
## EXPERIMENTAL: mark according to projection error
## EXPERIMENTAL: mark according to projection error
#g_err = compute_local_error(st.g, g_arr)
#g_err = compute_local_error(st.g, g_arr)
...
@@ -1490,13 +1490,12 @@ function experiment_inpaint_adaptive(ctx)
...
@@ -1490,13 +1490,12 @@ function experiment_inpaint_adaptive(ctx)
g_arr
=
loadimg
(
joinpath
(
ctx
.
indir
,
"input.png"
))
g_arr
=
loadimg
(
joinpath
(
ctx
.
indir
,
"input.png"
))
mask_arr
=
loadimg
(
joinpath
(
ctx
.
indir
,
"mask.png"
))
mask_arr
=
loadimg
(
joinpath
(
ctx
.
indir
,
"mask.png"
))
mesh
=
init_grid
(
g_arr
;)
mesh
=
init_grid
(
g_arr
;)
for
coarsen
in
0
:
15
for
coarsen
in
7
params
=
(
params
=
(
name
=
"test"
,
name
=
"test"
,
n_refine
=
coarsen
,
n_refine
=
coarsen
,
#
estimator = :
primal_
dual,
estimator
=
:
resi
dual
,
g_arr
,
mask_arr
,
mesh
,
g_arr
,
mask_arr
,
mesh
,
#alpha1 = 0.2, alpha2 = 8., lambda = 1.,
alpha1
=
0.
,
alpha2
=
50.
,
lambda
=
1.
,
alpha1
=
0.
,
alpha2
=
50.
,
lambda
=
1.
,
beta
=
1e-5
,
S
=
Operators
.
SIdentity
(),
beta
=
1e-5
,
S
=
Operators
.
SIdentity
(),
gamma1
=
1e-4
,
gamma2
=
1e-4
,
gamma1
=
1e-4
,
gamma2
=
1e-4
,
...
@@ -1509,7 +1508,8 @@ function experiment_inpaint_adaptive(ctx)
...
@@ -1509,7 +1508,8 @@ function experiment_inpaint_adaptive(ctx)
params
.
beta
,
params
.
S
,
params
.
beta
,
params
.
S
,
width
=
size
(
g_arr
,
1
),
height
=
size
(
g_arr
,
2
))
width
=
size
(
g_arr
,
1
),
height
=
size
(
g_arr
,
2
))
ctx
(
inpaint
,
"s-identity_alpha1_
$
(round(Int, params.alpha1))_alpha2_
$
(round(Int, params.alpha2))_coarse_
$
(params.n_refine)"
;
params
...
)
#ctx(inpaint, "s-identity_alpha1_$(round(Int, params.alpha1))_alpha2_$(round(Int, params.alpha2))_coarse_$(params.n_refine)"; params...)
ctx
(
inpaint
,
"s-identity_alpha1_
$
(round(Int, params.alpha1))_alpha2_
$
(round(Int, params.alpha2))_coarse_
$
(params.n_refine)_pd"
;
params
...
,
estimator
=
:
primal_dual
)
end
end
end
end
...
@@ -1555,6 +1555,7 @@ function experiment_inpaint_denoise(ctx)
...
@@ -1555,6 +1555,7 @@ function experiment_inpaint_denoise(ctx)
end
end
function
optflow
(
ctx
)
function
optflow
(
ctx
)
duration
=
@elapsed
begin
size
(
ctx
.
params
.
imgf0
)
==
size
(
ctx
.
params
.
imgf1
)
||
size
(
ctx
.
params
.
imgf0
)
==
size
(
ctx
.
params
.
imgf1
)
||
throw
(
ArgumentError
(
"non-matching image sizes"
))
throw
(
ArgumentError
(
"non-matching image sizes"
))
...
@@ -1562,6 +1563,7 @@ function optflow(ctx)
...
@@ -1562,6 +1563,7 @@ function optflow(ctx)
project_image!
(
f
,
img
)
=
project_image!
(
f
,
img
)
=
ctx
.
params
.
n_refine
==
0
?
ctx
.
params
.
n_refine
==
0
?
interpolate!
(
f
,
x
->
evaluate_bilinear
(
img
,
x
))
:
# fine mesh
interpolate!
(
f
,
x
->
evaluate_bilinear
(
img
,
x
))
:
# fine mesh
#project_l2_pixel!(f, img) # My change (AL) 2023 10 05
project_l2_lagrange!
(
f
,
img
)
# coarse adaptive mesh
project_l2_lagrange!
(
f
,
img
)
# coarse adaptive mesh
...
@@ -1690,7 +1692,7 @@ function optflow(ctx)
...
@@ -1690,7 +1692,7 @@ function optflow(ctx)
end
end
end
end
#CSV.write(joinpath(ctx.outdir, "energies.csv"), df)
#CSV.write(joinpath(ctx.outdir, "energies.csv"), df)
end
#end @elapsed
u_sampled
=
sample
(
st
.
u
)
u_sampled
=
sample
(
st
.
u
)
saveimg
(
joinpath
(
ctx
.
outdir
,
"f0.png"
),
to_img
(
imgf0
))
saveimg
(
joinpath
(
ctx
.
outdir
,
"f0.png"
),
to_img
(
imgf0
))
saveimg
(
joinpath
(
ctx
.
outdir
,
"f1.png"
),
to_img
(
imgf1
))
saveimg
(
joinpath
(
ctx
.
outdir
,
"f1.png"
),
to_img
(
imgf1
))
...
@@ -1712,7 +1714,7 @@ function optflow(ctx)
...
@@ -1712,7 +1714,7 @@ function optflow(ctx)
st
.
alpha1
,
st
.
alpha2
,
st
.
lambda
,
st
.
beta
,
st
.
gamma1
,
st
.
gamma2
,
ctx
.
params
.
Schoice
,
st
.
alpha1
,
st
.
alpha2
,
st
.
lambda
,
st
.
beta
,
st
.
gamma1
,
st
.
gamma2
,
ctx
.
params
.
Schoice
,
width
=
size
(
u_sampled
,
2
),
height
=
size
(
u_sampled
,
3
),
width
=
size
(
u_sampled
,
2
),
height
=
size
(
u_sampled
,
3
),
endpoint_error_mean
,
endpoint_error_stddev
,
endpoint_error_mean
,
endpoint_error_stddev
,
angular_error_mean
,
angular_error_stddev
,
angular_error_mean
,
angular_error_stddev
,
duration
)
)
return
st
return
st
end
end
...
@@ -1734,6 +1736,7 @@ function experiment_optflow_middlebury_all_benchmarks(ctx)
...
@@ -1734,6 +1736,7 @@ function experiment_optflow_middlebury_all_benchmarks(ctx)
ctx
(
experiment_optflow_middlebury
,
example
;
ctx
(
experiment_optflow_middlebury
,
example
;
alpha1
=
10.
,
alpha2
=
0.
,
lambda
=
1.
,
beta
=
1e-5
,
alpha1
=
10.
,
alpha2
=
0.
,
lambda
=
1.
,
beta
=
1e-5
,
gamma1
=
1e-4
,
gamma2
=
1e-4
,
Schoice
=
:
nabla
,
newton_max_iters
=
30
)
gamma1
=
1e-4
,
gamma2
=
1e-4
,
Schoice
=
:
nabla
,
newton_max_iters
=
30
)
break
end
end
end
end
...
@@ -1745,14 +1748,14 @@ function experiment_optflow_middlebury_warping_comparison(ctx)
...
@@ -1745,14 +1748,14 @@ function experiment_optflow_middlebury_warping_comparison(ctx)
end
end
function
experiment_optflow_middlebury_warping_comparison_adaptive
(
ctx
)
function
experiment_optflow_middlebury_warping_comparison_adaptive
(
ctx
)
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"vanilla"
;
#
ctx(experiment_optflow_middlebury_all_benchmarks, "vanilla";
warp
=
false
,
refine
=
false
,
n_refine
=
0
)
#
warp = false, refine = false, n_refine = 0)
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"warping"
;
#
ctx(experiment_optflow_middlebury_all_benchmarks, "warping";
warp
=
true
,
refine
=
false
,
n_refine
=
0
)
#
warp = true, refine = false, n_refine = 0)
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"adaptive-warping"
;
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"adaptive-warping"
;
warp
=
true
,
refine
=
true
,
n_refine
=
6
)
warp
=
true
,
refine
=
true
,
n_refine
=
6
)
#
ctx(experiment_optflow_middlebury_all_benchmarks, "adaptive-warping";
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"adaptive-warping
-pd
"
;
#
warp = true, refine = true, n_refine = 6, estimator = :
resi
dual)
warp
=
true
,
refine
=
true
,
n_refine
=
6
,
estimator
=
:
primal_
dual
)
end
end
function
experiment_optflow_schoice
(
ctx
)
function
experiment_optflow_schoice
(
ctx
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment