duan8/psenet/main.cpp
weiwei zhou cd277360e2
create psenet project with weight from tensorflow (#321)
* create psenet

create psenet with weight from tensorflow

* delete some useless code

* repalce tab with 4 blanks
2020-12-04 22:32:27 +08:00

37 lines
932 B
C++

#include "psenet.h"
int main(int argc, char **argv)
{
PSENet psenet(1600, 0.9, 6, 4);
if (argc == 2 && std::string(argv[1]) == "-s")
{
std::cout << "Serializling Engine" << std::endl;
psenet.serializeEngine();
return 0;
}
else if (argc == 2 && std::string(argv[1]) == "-d")
{
psenet.init();
std::vector<std::string> files;
for (int i = 0; i < 10; i++)
{
files.emplace_back("test.jpg");
}
for (auto file : files)
{
std::cout << "Detect " << file << std::endl;
psenet.detect(file);
}
return 0;
}
else
{
std::cerr << "arguments not right!" << std::endl;
std::cerr << "./psenet -s // serialize model to plan file" << std::endl;
std::cerr << "./psenet -d // deserialize plan file and run inference" << std::endl;
return -1;
}
}