@@ -56,95 +56,102 @@ namespace {
5656using namespace ::viam::sdk;
5757using namespace ::viam::sdktests;
5858
59- const struct MLModelService ::metadata test_metadata{
59+
60+
61+
62+ const struct MLModelService ::metadata test_metadata {
6063 // `name`
6164 " my model" ,
6265
63- // `type`
64- " magic" ,
66+ // `type`
67+ " magic" ,
6568
66- // `description`,
67- " Convolutional neural network ..." ,
69+ // `description`,
70+ " Convolutional neural network ..." ,
6871
69- // `inputs`
70- {{
72+ // `inputs`
73+ {{
7174
72- // `name`
73- " input1" ,
75+ // `name`
76+ " input1" ,
7477
75- // `description`
76- " the first input" ,
78+ // `description`
79+ " the first input" ,
7780
78- // `data_type`
79- MLModelService::tensor_info::data_types::k_float32,
81+ // `data_type`
82+ MLModelService::tensor_info::data_types::k_float32,
8083
81- // `shape`
82- {640 , 480 , -1 },
84+ // `shape`
85+ {640 , 480 , -1 },
8386
84- // `associated_files`
85- {{// `name`
86- " path/to/file1.1" ,
87+ // `associated_files`
88+ {{// `name`
89+ " path/to/file1.1" ,
8790
88- // `description`
89- " i1f1" ,
91+ // `description`
92+ " i1f1" ,
9093
91- // `label_type`
92- MLModelService::tensor_info::file::k_label_type_tensor_value},
93- {" path/to/file1.2" , " i1f2" , MLModelService::tensor_info::file::k_label_type_tensor_axis}},
94+ // `label_type`
95+ MLModelService::tensor_info::file::k_label_type_tensor_value},
96+ {" path/to/file1.2" ,
97+ " i1f2" ,
98+ MLModelService::tensor_info::file::k_label_type_tensor_axis}},
9499
95- // `extra`
96- ProtoStruct{{" foo" , ProtoValue{" bar" }}}},
100+ // `extra`
101+ ProtoStruct{{" foo" , ProtoValue{" bar" }}}},
97102
98- {" input2" ,
99- " the second input" ,
100- MLModelService::tensor_info::data_types::k_int32,
101- {4096 , 2160 , 3 , -1 },
102- {{" path/to/file2.1" , " i2f1" , MLModelService::tensor_info::file::k_label_type_tensor_axis},
103- {" path/to/file2.2" , " i2f2" , MLModelService::tensor_info::file::k_label_type_tensor_value}},
104- ProtoStruct{{" bar" , ProtoValue{false }}}}},
103+ {" input2" ,
104+ " the second input" ,
105+ MLModelService::tensor_info::data_types::k_int32,
106+ {4096 , 2160 , 3 , -1 },
107+ {{" path/to/file2.1" , " i2f1" , MLModelService::tensor_info::file::k_label_type_tensor_axis},
108+ {" path/to/file2.2" ,
109+ " i2f2" ,
110+ MLModelService::tensor_info::file::k_label_type_tensor_value}},
111+ ProtoStruct{{" bar" , ProtoValue{false }}}}},
105112
106- // `outputs`
107- {{
113+ // `outputs`
114+ {{
108115
109- // `name`
110- " output1" ,
116+ // `name`
117+ " output1" ,
111118
112- // `description`
113- " the first output" ,
119+ // `description`
120+ " the first output" ,
114121
115- // `data_type`
116- MLModelService::tensor_info::data_types::k_int32,
122+ // `data_type`
123+ MLModelService::tensor_info::data_types::k_int32,
117124
118- // `shape`
119- {-1 , -1 },
125+ // `shape`
126+ {-1 , -1 },
120127
121- // `associated_files`
122- {{// `name`
123- " path/to/output_file1.1" ,
128+ // `associated_files`
129+ {{// `name`
130+ " path/to/output_file1.1" ,
124131
125- // `description`
126- " o1f1" ,
132+ // `description`
133+ " o1f1" ,
127134
128- // `label_type`
129- MLModelService::tensor_info::file::k_label_type_tensor_axis},
130- {" path/to/output_file1.2" ,
131- " o1f2" ,
132- MLModelService::tensor_info::file::k_label_type_tensor_value}},
135+ // `label_type`
136+ MLModelService::tensor_info::file::k_label_type_tensor_axis},
137+ {" path/to/output_file1.2" ,
138+ " o1f2" ,
139+ MLModelService::tensor_info::file::k_label_type_tensor_value}},
133140
134- // `extra`
135- ProtoStruct{{" baz" , ProtoValue{}}}},
141+ // `extra`
142+ ProtoStruct{{" baz" , ProtoValue{}}}},
136143
137- {" output2" ,
138- " the second output" ,
139- MLModelService::tensor_info::data_types::k_float32,
140- {-1 , -1 , 4 },
141- {{" path/to/output_file2.1" ,
142- " o2f1" ,
143- MLModelService::tensor_info::file::k_label_type_tensor_axis},
144- {" path/to/output_file2.2" ,
145- " o2f2" ,
146- MLModelService::tensor_info::file::k_label_type_tensor_value}},
147- ProtoStruct{{" quux" , ProtoValue{3.14 }}}}},
144+ {" output2" ,
145+ " the second output" ,
146+ MLModelService::tensor_info::data_types::k_float32,
147+ {-1 , -1 , 4 },
148+ {{" path/to/output_file2.1" ,
149+ " o2f1" ,
150+ MLModelService::tensor_info::file::k_label_type_tensor_axis},
151+ {" path/to/output_file2.2" ,
152+ " o2f2" ,
153+ MLModelService::tensor_info::file::k_label_type_tensor_value}},
154+ ProtoStruct{{" quux" , ProtoValue{3.14 }}}}},
148155};
149156
150157BOOST_AUTO_TEST_SUITE (test_mock_mlmodel)
0 commit comments