@@ -111,44 +111,44 @@ void rootToOnnx(std::string infile, std::string outfile, std::string key)
111111/// Upload the ONNX model to CCDB from an ONNX file
112112/// !!! Adjust the metadata, path and validity !!!
113113void uploadToCCDBFromONNX (std ::string onnxFile ,
114- const std ::map < std ::string , std ::string > & metadata ,
115- // { // some example metadata entries
116- // "nnCCDBLayerType": "FC",
117- // "nnCCDBWithMomentum": "0",
118- // "inputDType": "FP16",
119- // "nnCCDBInteractionRate": "500",
120- // "outputDType": "FP16",
121- // "nnCCDBEvalType": "regression_c1",
122- // "nnCCDBBeamType": "pp",
123- // "partName": "blob",
124- // "quality": "3"
125- // }
126- long tsMin /* = 1 */ ,
127- long tsMax /* = 4108971600000 */ ,
128- std ::string ccdbPath /* = "Users/c/csonnabe/TPC/Clusterization" */ ,
129- std ::string objname /* = "net_regression_r1.root" */ ,
130- std ::string ccdbUrl /* = "http://alice-ccdb.cern.ch" */ )
114+ const std ::map < std ::string , std ::string > & metadata ,
115+ // { // some example metadata entries
116+ // "nnCCDBLayerType": "FC",
117+ // "nnCCDBWithMomentum": "0",
118+ // "inputDType": "FP16",
119+ // "nnCCDBInteractionRate": "500",
120+ // "outputDType": "FP16",
121+ // "nnCCDBEvalType": "regression_c1",
122+ // "nnCCDBBeamType": "pp",
123+ // "partName": "blob",
124+ // "quality": "3"
125+ // }
126+ long tsMin /* = 1 */ ,
127+ long tsMax /* = 4108971600000 */ ,
128+ std ::string ccdbPath /* = "Users/c/csonnabe/TPC/Clusterization" */ ,
129+ std ::string objname /* = "net_regression_r1.root" */ ,
130+ std ::string ccdbUrl /* = "http://alice-ccdb.cern.ch" */ )
131131{
132132 readOnnxModelFromFile (onnxFile );
133133
134134 o2 ::ccdb ::CcdbApi api ;
135135 api .init (ccdbUrl );
136136
137137 // build full CCDB path including filename
138- const std ::string fullPath = ccdbPath ;//.back() == '/' ? (ccdbPath + objname) : (ccdbPath + "/" + objname);
138+ const std ::string fullPath = ccdbPath ; //.back() == '/' ? (ccdbPath + objname) : (ccdbPath + "/" + objname);
139139
140140 api .storeAsTFileAny (& serializer , fullPath , metadata , tsMin , tsMax );
141141}
142142
143143/// Upload the ONNX model to CCDB from a ROOT file
144144/// !!! Adjust the metadata, path and validity !!!
145145void uploadToCCDBFromROOT (std ::string rootFile ,
146- const std ::map < std ::string , std ::string > & metadata ,
147- long tsMin /* = 1 */ ,
148- long tsMax /* = 4108971600000 */ ,
149- std ::string ccdbPath /* = "Users/c/csonnabe/TPC/Clusterization" */ ,
150- std ::string objname /* = "net_regression_r1.root" */ ,
151- std ::string ccdbUrl /* = "http://alice-ccdb.cern.ch" */ )
146+ const std ::map < std ::string , std ::string > & metadata ,
147+ long tsMin /* = 1 */ ,
148+ long tsMax /* = 4108971600000 */ ,
149+ std ::string ccdbPath /* = "Users/c/csonnabe/TPC/Clusterization" */ ,
150+ std ::string objname /* = "net_regression_r1.root" */ ,
151+ std ::string ccdbUrl /* = "http://alice-ccdb.cern.ch" */ )
152152{
153153 // read ROOT file, extract ORTRootSerializer object and upload via storeAsTFileAny
154154 TFile inRootFile (rootFile .c_str ());
@@ -170,23 +170,23 @@ void uploadToCCDBFromROOT(std::string rootFile,
170170 api .init (ccdbUrl );
171171
172172 // build full CCDB path including filename
173- const std ::string fullPath = ccdbPath ;//.back() == '/' ? (ccdbPath + objname) : (ccdbPath + "/" + objname);
173+ const std ::string fullPath = ccdbPath ; //.back() == '/' ? (ccdbPath + objname) : (ccdbPath + "/" + objname);
174174
175175 api .storeAsTFileAny (& serializer , fullPath , metadata , tsMin , tsMax );
176176
177177 inRootFile .Close ();
178178}
179179
180180void convert_onnx_to_root_serialized (const std ::string & onnxFile ,
181- const std ::string & rootFile ,
182- int mode = 0 ,
183- int ccdbUpload = 0 ,
184- const std ::string & metadataStr = "nnCCDBLayerType=FC/nnCCDBWithMomentum=0/inputDType=FP16/nnCCDBInteractionRate=500/outputDType=FP16/nnCCDBEvalType=regression_c1/nnCCDBBeamType=pp/partName=blob/quality=3" ,
185- long tsMin = 1 ,
186- long tsMax = 4108971600000 ,
187- std ::string ccdbPath = "Users/c/csonnabe/TPC/Clusterization" ,
188- std ::string objname = "net_regression_r1.root" ,
189- std ::string ccdbUrl = "http://alice-ccdb.cern.ch" )
181+ const std ::string & rootFile ,
182+ int mode = 0 ,
183+ int ccdbUpload = 0 ,
184+ const std ::string & metadataStr = "nnCCDBLayerType=FC/nnCCDBWithMomentum=0/inputDType=FP16/nnCCDBInteractionRate=500/outputDType=FP16/nnCCDBEvalType=regression_c1/nnCCDBBeamType=pp/partName=blob/quality=3" ,
185+ long tsMin = 1 ,
186+ long tsMax = 4108971600000 ,
187+ std ::string ccdbPath = "Users/c/csonnabe/TPC/Clusterization" ,
188+ std ::string objname = "net_regression_r1.root" ,
189+ std ::string ccdbUrl = "http://alice-ccdb.cern.ch" )
190190{
191191 // parse metadataStr of the form key=value/key2=value2/...
192192 std ::map < std ::string , std ::string > metadata ;
@@ -206,12 +206,12 @@ void convert_onnx_to_root_serialized(const std::string& onnxFile,
206206 start = sep + 1 ;
207207 }
208208
209- if (ccdbUpload == 0 ){
209+ if (ccdbUpload == 0 ) {
210210 if (mode == 0 )
211211 onnxToRoot (onnxFile , rootFile , o2 ::ccdb ::CcdbApi ::CCDBOBJECT_ENTRY );
212212 else if (mode == 1 )
213213 rootToOnnx (rootFile , onnxFile , o2 ::ccdb ::CcdbApi ::CCDBOBJECT_ENTRY );
214- } else if (ccdbUpload == 1 ){
214+ } else if (ccdbUpload == 1 ) {
215215 if (mode == 0 )
216216 uploadToCCDBFromROOT (rootFile , metadata , tsMin , tsMax , ccdbPath , objname , ccdbUrl );
217217 else if (mode == 1 )
0 commit comments