Mentions légales du service

Skip to content
Snippets Groups Projects
Commit adfba6be authored by Tomofumi Yuki's avatar Tomofumi Yuki
Browse files

extended SSIMEvaluatorForFiles to support multiple snapshots

parent ab065e4f
No related branches found
No related tags found
1 merge request!4Develop
......@@ -19,11 +19,11 @@ public class SSIMEvaluatorForFiles {
Path path1 = Paths.get("/Users/tyuki/projects/GeCoS/gecos-float2fix/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/outputs/nlm/2018-09-12-10:54:32/exploration/simulations/ref/profiling-files");
Path path2 = Paths.get("/Users/tyuki/projects/GeCoS/gecos-float2fix/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/outputs/nlm/2018-09-12-10:54:32/exploration/simulations/sol1/profiling-files");
double ssim = evaluate(384, 512, path1, path2);
double ssim = evaluate(384, 512, path1, path2, 1);
System.out.println(ssim);
}
private static double evaluate(int H, int W, Path dir1, Path dir2) {
private static double evaluate(int H, int W, Path dir1, Path dir2, int nbSims) {
try {
Map<Integer, ProfilingInfo<? extends Number>> variablesInfo1 = new ProfilingInfoParser(dir1).retrieve();
......@@ -35,12 +35,17 @@ public class SSIMEvaluatorForFiles {
ProfilingInfo<? extends Number> profilingInfo1 = variablesInfo1.values().iterator().next();
ProfilingInfo<? extends Number> profilingInfo2 = variablesInfo2.values().iterator().next();
double ssim = 1.0;
for (int i = 0; i < nbSims; i++) {
Number[] array1 = profilingInfo1.getSnapshot(i);
Number[] array2 = profilingInfo2.getSnapshot(i);
SSIMEvaluator ssimEval = new SSIMEvaluator(W, H, array1, array2);
ssim = Math.min(ssim, ssimEval.evaluate());
}
Number[] array1 = profilingInfo1.getSnapshot(0);
Number[] array2 = profilingInfo2.getSnapshot(0);
SSIMEvaluator ssimEval = new SSIMEvaluator(W, H, array1, array2);
return ssimEval.evaluate();
return ssim;
} catch(Exception e) {
e.printStackTrace();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment