35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
//
|
|
// Created by Zhou Xiang on 10/6/21.
|
|
//
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include "AbstractInferencer.h"
|
|
#include "KplusPlatform.h"
|
|
#include "KplusInferencerPImpl.h"
|
|
|
|
using std::unique_ptr;
|
|
|
|
|
|
int main() {
|
|
using dynasty::inferencer::kplus::Inferencer;
|
|
static std::string scpu_fw_path_520 = "res/KL520/kdp2_fw_scpu.bin";
|
|
static std::string ncpu_fw_path_520 = "res/KL520/kdp2_fw_ncpu.bin";
|
|
static std::string model_file_path_520 = "res/KL520/fdfr.nef";
|
|
auto platform =
|
|
Inferencer<float>::GetKplusPlatform();
|
|
|
|
if(!platform->isInitialized()) {
|
|
platform->initialize("KL520",model_file_path_520, scpu_fw_path_520, ncpu_fw_path_520);
|
|
}
|
|
|
|
auto builder = Inferencer<float>::GetBuilder()->WithDeviceGroup(platform->getDeviceGroup())
|
|
->WithNef(platform->getNeFDesc())
|
|
->WithProduct(platform->getProduct())
|
|
->WithModelId(32);
|
|
|
|
dynasty::inferencer::InferencerUniquePtr<float> inferencer = builder->Build();
|
|
|
|
inferencer->Inference("res/input_config_kplus.json");
|
|
} |