Dump intermediate results to PNG images.
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -1,8 +1,9 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include "Options.hpp"
|
||||
#include "Simulator.hpp"
|
||||
#include "utils.hpp"
|
||||
#include "PNGDumper.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace fmri;
|
||||
@@ -12,10 +13,15 @@ int main(int argc, char *const argv[]) {
|
||||
|
||||
Options options = Options::parse(argc, argv);
|
||||
vector<string> labels;
|
||||
if (options.labels() != "") {
|
||||
if (!options.labels().empty()) {
|
||||
labels = read_vector<string>(options.labels());
|
||||
}
|
||||
|
||||
unique_ptr<PNGDumper> pngDumper;
|
||||
if (!options.imageDump().empty()) {
|
||||
pngDumper.reset(new PNGDumper(options.imageDump()));
|
||||
}
|
||||
|
||||
Simulator simulator(options.model(), options.weights(), options.means());
|
||||
|
||||
for (const auto &image : options.inputs()) {
|
||||
@@ -33,6 +39,10 @@ int main(int argc, char *const argv[]) {
|
||||
} else {
|
||||
LOG(INFO) << "Best result: " << *(resultRow.data(), resultRow.data() + resultRow.numEntries()) << endl;
|
||||
}
|
||||
|
||||
for (auto& layer : res) {
|
||||
pngDumper->dump(layer);
|
||||
}
|
||||
}
|
||||
|
||||
google::ShutdownGoogleLogging();
|
||||
|
||||
Reference in New Issue
Block a user