@@ -38,7 +38,7 @@ static std::string not_found_str
38
38
39
39
static std::string squeez_repo = " ../examples/trt/squeezenet_ssd_trt/" ;
40
40
static std::string refinedet_repo = " ../examples/trt/faces_512/" ;
41
- static std::string age_repo = " ../examples/trt/age_real /" ;
41
+ static std::string squeezv1_repo = " ../examples/trt/squeezenet_v1 /" ;
42
42
static std::string resnet_onnx_repo = " ../examples/trt/resnet_onnx_trt/" ;
43
43
static std::string cyclegan_onnx_repo
44
44
= " ../examples/trt/cyclegan_resnet_attn_onnx_trt/" ;
@@ -97,22 +97,22 @@ TEST(tensorrtapi, service_predict_best)
97
97
{
98
98
// create service
99
99
JsonAPI japi;
100
- std::string sname = " age " ;
100
+ std::string sname = " imagenet " ;
101
101
std::string jstr
102
102
= " {\" mllib\" :\" tensorrt\" ,\" description\" :\" age_classif\" ,\" type\" :"
103
103
" \" supervised\" ,\" model\" :{\" repository\" :\" "
104
- + age_repo
104
+ + squeezv1_repo
105
105
+ " \" },\" parameters\" :{\" input\" :{\" connector\" :\" image\" ,\" height\" :"
106
- " 224 ,\" width\" :224 },\" mllib\" :{\" datatype\" :\" fp32\" ,"
106
+ " 227 ,\" width\" :227 },\" mllib\" :{\" datatype\" :\" fp32\" ,"
107
107
" \" maxBatchSize\" :1,\" maxWorkspaceSize\" :256,"
108
108
" \" tensorRTEngineFile\" :\" TRTengine\" ,\" gpuid\" :0}}}" ;
109
109
std::string joutstr = japi.jrender (japi.service_create (sname, jstr));
110
110
ASSERT_EQ (created_str, joutstr);
111
111
112
112
// predict
113
113
std::string jpredictstr
114
- = " {\" service\" :\" age \" ,\" parameters\" :{\" input\" :{\" height\" :224 ,"
115
- " \" width\" :224 },\" output\" :{\" best\" :2}},\" data\" :[\" "
114
+ = " {\" service\" :\" imagenet \" ,\" parameters\" :{\" input\" :{\" height\" :227 ,"
115
+ " \" width\" :227 },\" output\" :{\" best\" :2}},\" data\" :[\" "
116
116
+ squeez_repo + " face.jpg\" ]}" ;
117
117
joutstr = japi.jrender (japi.service_predict (jpredictstr));
118
118
JDoc jd;
@@ -122,20 +122,18 @@ TEST(tensorrtapi, service_predict_best)
122
122
ASSERT_EQ (200 , jd[" status" ][" code" ]);
123
123
ASSERT_TRUE (jd[" body" ][" predictions" ].IsArray ());
124
124
ASSERT_EQ (2 , jd[" body" ][" predictions" ][0 ][" classes" ].Size ());
125
- std::string age
125
+ std::string cls
126
126
= jd[" body" ][" predictions" ][0 ][" classes" ][0 ][" cat" ].GetString ();
127
- ASSERT_TRUE (age == " 29 " );
128
- std::cout << " looking for " << age_repo << " TRTengine_arch"
127
+ ASSERT_TRUE (cls == " n04357314 sunscreen, sunblock, sun blocker " );
128
+ std::cout << " looking for " << squeezv1_repo << " TRTengine_arch"
129
129
<< get_trt_archi () << " _bs1" << std::endl;
130
- ASSERT_TRUE (fileops::file_exists (age_repo + " TRTengine_arch"
130
+ ASSERT_TRUE (fileops::file_exists (squeezv1_repo + " TRTengine_arch"
131
131
+ get_trt_archi () + " _bs1" ));
132
- /* ASSERT_TRUE(!fileops::remove_file(age_repo, "net_tensorRT.proto"));
133
- ASSERT_TRUE(!fileops::remove_file(age_repo, "TRTengine_bs_bs1"));*/
134
132
jstr = " {\" clear\" :\" lib\" }" ;
135
133
joutstr = japi.jrender (japi.service_delete (sname, jstr));
136
134
ASSERT_EQ (ok_str, joutstr);
137
- ASSERT_TRUE (!fileops::file_exists (age_repo + " net_tensorRT.proto" ));
138
- ASSERT_TRUE (!fileops::file_exists (age_repo + " TRTengine_arch"
135
+ ASSERT_TRUE (!fileops::file_exists (squeezv1_repo + " net_tensorRT.proto" ));
136
+ ASSERT_TRUE (!fileops::file_exists (squeezv1_repo + " TRTengine_arch"
139
137
+ get_trt_archi () + " _bs1" ));
140
138
}
141
139
0 commit comments