forked from wang-xinyu/tensorrtx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
34 lines (31 loc) · 952 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "psenet.h"
int main(int argc, char** argv)
{
PSENet psenet(1200, 640, 0.90, 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;
}
}