I have many models with different input sizes. Is there a way that I can get the input size programmatically so that I don't need to modify the hardcoded size every time?
Thanks in advance.
I have many models with different input sizes. Is there a way that I can get the input size programmatically so that I don't need to modify the hardcoded size every time?
Thanks in advance.
Yes, you can:
MLFeatureDescription* inputFeatureDescription = model.modelDescription.inputDescriptionsByName[@"input"];
MLImageConstraint* imageConstraints = inputFeatureDescription.imageConstraint;
CGSize inputSize = CGSizeMake(imageConstraints.pixelsWide, imageConstraints.pixelsHigh);
You have to adjust the name of the input, tough.
Yes, you can:
MLFeatureDescription* inputFeatureDescription = model.modelDescription.inputDescriptionsByName[@"input"];
MLImageConstraint* imageConstraints = inputFeatureDescription.imageConstraint;
CGSize inputSize = CGSizeMake(imageConstraints.pixelsWide, imageConstraints.pixelsHigh);
You have to adjust the name of the input, tough.