Commit c9c51418 authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Resolve "Experiments for the paper"

parent 4b2d8aa6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ public class BatchSimilarityGroundTruth {
     * @param args Input arguments 
     * @throws IOException on IO error
     */
    public static void main(String[] args) throws IOException, ClassNotFoundException, Exception {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        List<Path> faces = Files.list(new File(DATA_DIR).toPath())
                .filter(f -> f.toString().endsWith(".obj"))
                .sorted()
+52 −0
Original line number Diff line number Diff line
package cz.fidentis.analyst.gui.app.tools;

import cz.fidentis.analyst.face.HumanFace;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Radek Oslejsek
 */
public class DatasetStats {

    private static final String DATA_DIR = "../analyst-data-antropologie/_ECA";
    private static final int MAX_SAMPLES = 100;

    public static void main(String[] args) throws IOException {
        List<Path> faces = Files.list(new File(DATA_DIR).toPath())
                .filter(f -> f.toString().endsWith(".obj"))
                .sorted()
                .limit(MAX_SAMPLES)
                .collect(Collectors.toList());


        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < faces.size(); i++) {
            HumanFace face = new HumanFace(faces.get(i).toFile());
            long n = face.getMeshModel().getNumVertices();
            //if (n > 100000) {
                System.out.println(face.getShortName());
            //}
            min = Math.min(min, n);
            max = Math.max(max, n);
            sum += n;
            list.add(n);
        }

        list.sort(Long::compareTo);

        System.out.println("MIN: " + min);
        System.out.println("MAX: " + max);
        System.out.println("AVG: " + sum/faces.size());
        System.out.println("MED: " + list.get(list.size()/2));
    }
}