对算法输入参数非法情况进行过滤
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user