forked from pierotofy/OpenSplat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevaluation.hpp
More file actions
48 lines (41 loc) · 1.42 KB
/
evaluation.hpp
File metadata and controls
48 lines (41 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef EVALUATION_H
#define EVALUATION_H
#include <vector>
#include <string>
#include <random>
#include <nlohmann/json.hpp>
#include "input_data.hpp"
#include "model.hpp"
struct EvalGroup{
float meanPSNR = 0.0f;
float meanSSIM = 0.0f;
float meanL1 = 0.0f;
float mainLoss = 0.0f;
float meanVarLap = 0.0f; // Variance of Laplacian
float meanTenengrad = 0.0f; // Tenengrad focus metric
};
struct EvalSnapshot{
size_t iter; // absolute iteration number
float percent; // percent progress (0-100)
EvalGroup train;
EvalGroup test;
};
// Deterministic alphabetical split: everyNth frame goes to test.
void splitCameras(const std::vector<Camera>& all,
std::vector<Camera>& train,
std::vector<Camera>& test,
size_t everyN = 10);
// Evaluate model on camera sets. Uses 10 % random subset of train for speed.
EvalSnapshot evaluate(Model& model,
std::vector<Camera>& train,
std::vector<Camera>& test,
size_t iter,
size_t maxIter,
float ssimWeight,
size_t rngSeed = 42);
// Persist snapshots to <scene>_eval.json.
void saveEval(const std::vector<EvalSnapshot>& snapshots,
const std::vector<Camera>& train,
const std::vector<Camera>& test,
const std::string& baseScenePath);
#endif