Sun, 21 Apr 2024 19:26:50 +0300
added stable interval for denoising
20
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
1 | __precompile__() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
2 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
3 | module PlotResults |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
4 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
5 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
6 | ######################## |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
7 | # Load external modules |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
8 | ######################## |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
9 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
10 | using DelimitedFiles, CSV, DataFrames |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
11 | using PlotlyJS |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
12 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
13 | export fv_plot, ssim_plot, psnr_plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
14 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
15 | global mystart = 38 |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
16 | global myend = 75 |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
17 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
18 | function fv_plot(name :: String, save_plot::Bool=true) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
19 | save_path = "./img/$(name)256x256_pdps_known_fv_plot.html" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
20 | ################################################# |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
21 | orig = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
22 | ################################################# |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
23 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
24 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
25 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_proximal") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
26 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
27 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
28 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
29 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
30 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
31 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
32 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
33 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
34 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
35 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
36 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
37 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
38 | Y = Float64.(data[mystart:myend, :function_value]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
39 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
40 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
41 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
42 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
43 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
44 | line_color=line_color, line_dash="dot", name="proxi") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
45 | push!(orig, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
46 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
47 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
48 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
49 | identity = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
50 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
51 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
52 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
53 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_primalonly") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
54 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
55 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
56 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
57 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
58 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
59 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
60 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
61 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
62 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
63 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
64 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
65 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
66 | Y = Float64.(data[mystart:myend, :function_value]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
67 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
68 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
69 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
70 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
71 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
72 | line_color=line_color, line_dash="dashdot", name="primo") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
73 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
74 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
75 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
76 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
77 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
78 | adhoc = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
79 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
80 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
81 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
82 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_greedy") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
83 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
84 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
85 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
86 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
87 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
88 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
89 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
90 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
91 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
92 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
93 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
94 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
95 | Y = Float64.(data[mystart:myend, :function_value]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
96 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
97 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
98 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
99 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
100 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
101 | line_color=line_color, line_dash="dash", name="greed Ï„") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
102 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
103 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
104 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
105 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
106 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
107 | rotation = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
108 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
109 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
110 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
111 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_rotation") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
112 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
113 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
114 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
115 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
116 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
117 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
118 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
119 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
120 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
121 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
122 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
123 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
124 | Y = Float64.(data[mystart:myend, :function_value]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
125 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
126 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
127 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
128 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
129 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
130 | line_color=line_color, line_dash="longdashdot", name="rotat") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
131 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
132 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
133 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
134 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
135 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
136 | affine = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
137 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
138 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
139 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
140 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_dualscaling") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
141 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
142 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
143 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
144 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
145 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
146 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
147 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
148 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
149 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
150 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
151 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
152 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
153 | Y = Float64.(data[mystart:myend, :function_value]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
154 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
155 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
156 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
157 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
158 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
159 | line_color=line_color, line_dash="solid", name="dusca") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
160 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
161 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
162 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
163 | layout = Layout(legend_title_text="Function values") # Set legend title |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
164 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
165 | if save_plot && !isempty(save_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
166 | plotlyjs = plot([orig;identity;adhoc;rotation;affine], layout) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
167 | open(save_path, "w") do io |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
168 | PlotlyBase.to_html(io, plotlyjs.plot) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
169 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
170 | elseif save_plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
171 | println("Please provide a valid save path.") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
172 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
173 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
174 | return plot([orig;identity;adhoc;rotation;affine],layout) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
175 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
176 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
177 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
178 | ######################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
179 | # FUNCTION FOR SSIM |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
180 | ######################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
181 | function ssim_plot(name :: String, save_plot::Bool=true) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
182 | save_path = "./img/$(name)256x256_pdps_known_ssim_plot.html" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
183 | ################################################# |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
184 | orig = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
185 | ################################################# |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
186 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
187 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
188 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_proximal") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
189 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
190 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
191 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
192 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
193 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
194 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
195 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
196 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
197 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
198 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
199 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
200 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
201 | Y = Float64.(data[mystart:myend, :ssim]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
202 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
203 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
204 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
205 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
206 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
207 | line_color=line_color, line_dash="dot", name="proxi") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
208 | push!(orig, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
209 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
210 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
211 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
212 | identity = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
213 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
214 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
215 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
216 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_primalonly") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
217 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
218 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
219 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
220 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
221 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
222 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
223 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
224 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
225 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
226 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
227 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
228 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
229 | Y = Float64.(data[mystart:myend, :ssim]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
230 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
231 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
232 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
233 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
234 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
235 | line_color=line_color, line_dash="dashdot", name="primo") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
236 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
237 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
238 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
239 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
240 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
241 | adhoc = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
242 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
243 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
244 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
245 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_greedy") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
246 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
247 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
248 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
249 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
250 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
251 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
252 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
253 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
254 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
255 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
256 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
257 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
258 | Y = Float64.(data[mystart:myend, :ssim]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
259 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
260 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
261 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
262 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
263 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
264 | line_color=line_color, line_dash="dash", name="greed") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
265 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
266 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
267 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
268 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
269 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
270 | rotation = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
271 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
272 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
273 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
274 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_rotation") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
275 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
276 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
277 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
278 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
279 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
280 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
281 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
282 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
283 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
284 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
285 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
286 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
287 | Y = Float64.(data[mystart:myend, :ssim]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
288 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
289 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
290 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
291 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
292 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
293 | line_color=line_color, line_dash="longdashdot", name="rotat") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
294 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
295 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
296 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
297 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
298 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
299 | affine = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
300 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
301 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
302 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
303 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_dualscaling") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
304 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
305 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
306 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
307 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
308 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
309 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
310 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
311 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
312 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
313 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
314 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
315 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
316 | Y = Float64.(data[mystart:myend, :ssim]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
317 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
318 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
319 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
320 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
321 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
322 | line_color=line_color, line_dash="solid", name="dusca") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
323 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
324 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
325 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
326 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
327 | zerodual = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
328 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
329 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
330 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
331 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_zerodual") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
332 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
333 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
334 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
335 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
336 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
337 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
338 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
339 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
340 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
341 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
342 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
343 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
344 | Y = Float64.(data[mystart:myend, :ssim]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
345 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
346 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
347 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
348 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
349 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
350 | line_color=line_color, line_dash="longdash", name="zerod") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
351 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
352 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
353 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
354 | layout = Layout(yaxis_type="log", legend_title_text="SSIM") # Set legend title |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
355 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
356 | if save_plot && !isempty(save_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
357 | plotlyjs = plot([orig;identity;adhoc;rotation;affine;zerodual], layout) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
358 | open(save_path, "w") do io |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
359 | PlotlyBase.to_html(io, plotlyjs.plot) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
360 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
361 | elseif save_plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
362 | println("Please provide a valid save path.") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
363 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
364 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
365 | return plot([orig;identity;adhoc;rotation;affine;zerodual],layout) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
366 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
367 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
368 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
369 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
370 | ######################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
371 | # FUNCTION FOR PSNR |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
372 | ######################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
373 | function psnr_plot(name :: String, save_plot::Bool=true) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
374 | save_path = "./img/$(name)256x256_pdps_known_psnr_plot.html" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
375 | ################################################# |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
376 | orig = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
377 | ################################################# |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
378 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
379 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
380 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_proximal") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
381 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
382 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
383 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
384 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
385 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
386 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
387 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
388 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
389 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
390 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
391 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
392 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
393 | Y = Float64.(data[mystart:myend, :psnr]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
394 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
395 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
396 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
397 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
398 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
399 | line_color=line_color, line_dash="dot", name="proxi") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
400 | push!(orig, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
401 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
402 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
403 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
404 | identity = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
405 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
406 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
407 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
408 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_primalonly") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
409 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
410 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
411 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
412 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
413 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
414 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
415 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
416 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
417 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
418 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
419 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
420 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
421 | Y = Float64.(data[mystart:myend, :psnr]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
422 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
423 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
424 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
425 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
426 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
427 | line_color=line_color, line_dash="dashdot", name="primo") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
428 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
429 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
430 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
431 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
432 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
433 | adhoc = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
434 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
435 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
436 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
437 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_greedy") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
438 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
439 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
440 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
441 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
442 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
443 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
444 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
445 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
446 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
447 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
448 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
449 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
450 | Y = Float64.(data[mystart:myend, :psnr]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
451 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
452 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
453 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
454 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
455 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
456 | line_color=line_color, line_dash="dash", name="greed") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
457 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
458 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
459 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
460 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
461 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
462 | rotation = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
463 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
464 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
465 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
466 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_rotation") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
467 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
468 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
469 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
470 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
471 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
472 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
473 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
474 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
475 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
476 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
477 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
478 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
479 | Y = Float64.(data[mystart:myend, :psnr]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
480 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
481 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
482 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
483 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
484 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
485 | line_color=line_color, line_dash="longdashdot", name="rotat") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
486 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
487 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
488 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
489 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
490 | affine = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
491 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
492 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
493 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
494 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_dualscaling") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
495 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
496 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
497 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
498 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
499 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
500 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
501 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
502 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
503 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
504 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
505 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
506 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
507 | Y = Float64.(data[mystart:myend, :psnr]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
508 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
509 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
510 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
511 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
512 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
513 | line_color=line_color, line_dash="solid", name="dusca") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
514 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
515 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
516 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
517 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
518 | zerodual = Vector{GenericTrace{Dict{Symbol, Any}}}() |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
519 | ##################################################### |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
520 | directory_path = "./img/" |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
521 | files = readdir(directory_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
522 | filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_zerodual") && endswith(file, "0.txt"), files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
523 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
524 | # Define an array of line styles and colors |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
525 | # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
526 | line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
527 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
528 | for (index,file) in enumerate(filtered_files) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
529 | filename = directory_path*file |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
530 | #data = readdlm(filename, '\t', skipstart=1) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
531 | data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
532 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
533 | # Extract the columns you want to plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
534 | X = Int64.(data[mystart:myend,:iter]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
535 | Y = Float64.(data[mystart:myend, :psnr]) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
536 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
537 | #line_style = line_styles[i] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
538 | line_color = line_colors[index] |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
539 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
540 | trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}", |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
541 | line_color=line_color, line_dash="longdash", name="zerod") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
542 | push!(identity, trace) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
543 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
544 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
545 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
546 | layout = Layout(yaxis_type="log", legend_title_text="PSNR") # Set legend title |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
547 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
548 | if save_plot && !isempty(save_path) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
549 | plotlyjs = plot([orig;identity;adhoc;rotation;affine; zerodual], layout) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
550 | open(save_path, "w") do io |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
551 | PlotlyBase.to_html(io, plotlyjs.plot) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
552 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
553 | elseif save_plot |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
554 | println("Please provide a valid save path.") |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
555 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
556 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
557 | return plot([orig;identity;adhoc;rotation;affine;zerodual],layout) |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
558 | end |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
559 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
560 | |
7d3a75b875fa
added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff
changeset
|
561 | end # Module |