Created
July 2, 2021 09:51
-
-
Save Innov-Plus/5c91bd87112e1948f164e4cd7375dcdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <input_parser.h> | |
| #include <thread> | |
| #include <klepsydra/onnx/onnx_dnn_importer.h> | |
| #include <iostream> | |
| int main(int argc, char **argv) { | |
| InputData inputData; | |
| InputParser::getConfFileFromParams(argc, argv, inputData); | |
| std::shared_ptr<kpsr::ai::DeepNeuralNetworkFactory> factory = | |
| kpsr::ai::OnnxDNNImporter::createDNNFactory(inputData.onnModelFile, | |
| inputData.configurationFile); | |
| std::shared_ptr<kpsr::ai::DeepNeuralNetwork> kpsrNetwork = factory->getDNN(); | |
| size_t processedImageCounter = 0; | |
| kpsrNetwork->setCallback( | |
| [&](const unsigned long &id, const kpsr::ai::F32AlignedVector &output) { | |
| processedImageCounter++; | |
| std::cout << "Processed " << processedImageCounter << std::endl; | |
| }); | |
| kpsr::ai::F32AlignedVector inputVector(120 * 120 * 3, 0.f); | |
| kpsrNetwork->predict(inputVector); | |
| while (processedImageCounter < (100)) { | |
| std::this_thread::sleep_for(std::chrono::seconds(1)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment