\brief Initializes members of the params struct using the command line args
| 332 | //! \brief Initializes members of the params struct using the command line args |
| 333 | //! |
| 334 | samplesCommon::OnnxSampleParams initializeSampleParams(const samplesCommon::Args& args) |
| 335 | { |
| 336 | samplesCommon::OnnxSampleParams params; |
| 337 | if (args.dataDirs.empty()) // Use default directories if user hasn't provided directory paths |
| 338 | { |
| 339 | params.dataDirs.push_back("data/mnist/"); |
| 340 | params.dataDirs.push_back("data/samples/mnist/"); |
| 341 | } |
| 342 | else // Use the data directory provided by the user |
| 343 | { |
| 344 | params.dataDirs = args.dataDirs; |
| 345 | } |
| 346 | params.onnxFileName = "mnist.onnx"; |
| 347 | params.inputTensorNames.push_back("Input3"); |
| 348 | params.outputTensorNames.push_back("Plus214_Output_0"); |
| 349 | params.dlaCore = args.useDLACore; |
| 350 | params.int8 = args.runInInt8; |
| 351 | params.fp16 = args.runInFp16; |
| 352 | |
| 353 | return params; |
| 354 | } |
| 355 | |
| 356 | //! |
| 357 | //! \brief Prints the help information for running this sample |