in awstreamer/gst_plugins/mxnet/src/ImageProcessor.cpp [20:42]
void ImageProcessor::setParam(const std::string &key, std::any val) {
if (key == "model-file") {
this->model_file = std::any_cast<std::string>(val);
GST_INFO("Loading model: %s", this->model_file.c_str());
LoadCheckpoint(this->model_file, epoch, &net, &args, &auxs, ctx);
} else if (key == "class-file") {
this->class_file = std::any_cast<std::string>(val);
GST_INFO("Class file: %s", this->class_file.c_str());
this->class_names = LoadClassNames(this->class_file);
} else if (key == "device-type") {
this->device_type = std::any_cast<std::string>(val);
GST_INFO("Device type: %s", this->device_type.c_str());
if (this->device_type == "gpu") {
// Parse GPU index from the name
ctx = Context::gpu(gpu);
}
} else if (key == "image-size") {
this->image_size = std::any_cast<int>(val);
GST_INFO("Image size: %d", this->image_size);
min_size = this->image_size;
max_size = this->image_size;
}
}