对算法输入参数非法情况进行过滤

This commit is contained in:
zhengxuan.zhang
2026-04-20 11:13:40 +08:00
parent 1c6c2ac675
commit e0a7af6226
5 changed files with 208 additions and 24 deletions
@@ -68,7 +68,7 @@ public class SuperResolutionProcessor : ImageProcessorBase
public override Image<Gray, byte> Process(Image<Gray, byte> inputImage)
{
string model = GetParameter<string>("Model");
int scale = int.Parse(GetParameter<string>("Scale"));
int scale = GetParameter<int>("Scale");
// 查找模型文件
string modelPath = FindModelFile(model, scale);
@@ -316,4 +316,4 @@ public class SuperResolutionProcessor : ImageProcessorBase
_logger.Warning("Model file not found: {Model}_x{Scale}.onnx", model, scale);
return string.Empty;
}
}
}