26 std::vector<float>
Run(
std::vector<std::vector<float>>
const& inp2d)
const override;
28 int samples = -1)
const override;
31 std::unique_ptr<keras::KerasModel>
m;
56 mf::LogInfo(
"PointIdAlgKeras") <<
"Keras model loaded.";
59 mf::LogError(
"PointIdAlgKeras") <<
"File name extension not supported.";
73 if (
stat(fileName, &buffer) == 0) { fname_out =
fileName; }
85 std::vector<std::vector<std::vector<float>>> inp3d;
86 inp3d.push_back(inp2d);
90 return m->compute_output(&sample);
94 std::vector<std::vector<float>>
98 if ((samples == 0) || inps.empty() || inps.front().empty() || inps.front().front().empty()) {
99 return std::vector<std::vector<float>>();
102 if ((samples == -1) || (samples > (
long long int)inps.size())) { samples = inps.size(); }
104 std::vector<std::vector<float>> out;
106 for (
long long int s = 0;
s < samples; ++
s) {
107 std::vector<std::vector<std::vector<float>>> inp3d;
108 inp3d.push_back(inps[
s]);
112 out.push_back(
m->compute_output(sample));
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
virtual void set_data(std::vector< std::vector< std::vector< float > > > const &)
DataProviderAlg(const fhicl::ParameterSet &pset)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
virtual void set_data(std::vector< std::vector< std::vector< float > > > const &d)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string find_file(std::string const &filename) const