---
title: MLImageSizeConstraint
framework: coreml
role: symbol
role_heading: Class
path: coreml/mlimagesizeconstraint
---

# MLImageSizeConstraint

A list or range of sizes that augment an image constraint’s default size.

## Declaration

```swift
class MLImageSizeConstraint
```

## Overview

Overview You use an MLImageSizeConstraint to express what image sizes of an image feature a model will accept as input or produce as output. Use type to determine which properties describe what image sizes the model’s image feature expects as input or produces as output. If type is: MLImageSizeConstraintType.range, the image feature accepts any image that has a width in pixelsWideRange and a height in pixelsHighRange. MLImageSizeConstraintType.enumerated, the image feature accepts any image size listed in enumeratedImageSizes. MLImageSizeConstraintType.unspecified, the MLImageSizeConstraint instance is not configured and should be ignored. Instead, use the image feature’s default image size constraint, defined by pixelsWide and pixelsHigh.

## Topics

### Determining relevant constraints

- [type](coreml/mlimagesizeconstraint/type.md)
- [MLImageSizeConstraintType](coreml/mlimagesizeconstrainttype.md)

### Accessing the image size ranges

- [pixelsWideRange](coreml/mlimagesizeconstraint/pixelswiderange.md)
- [pixelsHighRange](coreml/mlimagesizeconstraint/pixelshighrange.md)

### Accessing the enumerated image sizes

- [enumeratedImageSizes](coreml/mlimagesizeconstraint/enumeratedimagesizes.md)
- [MLImageSize](coreml/mlimagesize.md)

### Initializers

- [init(coder:)](coreml/mlimagesizeconstraint/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Inspecting acceptable sizes

- [sizeConstraint](coreml/mlimageconstraint/sizeconstraint.md)
