Google Cloud Native is in preview. Google Cloud Classic is fully supported.
google-native.vision/v1.ReferenceImage
Explore with Pulumi AI
Google Cloud Native is in preview. Google Cloud Classic is fully supported.
Creates and returns a new ReferenceImage resource. The bounding_poly
field is optional. If bounding_poly
is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product’s product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Create ReferenceImage Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ReferenceImage(name: string, args: ReferenceImageArgs, opts?: CustomResourceOptions);
@overload
def ReferenceImage(resource_name: str,
args: ReferenceImageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ReferenceImage(resource_name: str,
opts: Optional[ResourceOptions] = None,
product_id: Optional[str] = None,
uri: Optional[str] = None,
bounding_polys: Optional[Sequence[BoundingPolyArgs]] = None,
location: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
reference_image_id: Optional[str] = None)
func NewReferenceImage(ctx *Context, name string, args ReferenceImageArgs, opts ...ResourceOption) (*ReferenceImage, error)
public ReferenceImage(string name, ReferenceImageArgs args, CustomResourceOptions? opts = null)
public ReferenceImage(String name, ReferenceImageArgs args)
public ReferenceImage(String name, ReferenceImageArgs args, CustomResourceOptions options)
type: google-native:vision/v1:ReferenceImage
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ReferenceImageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ReferenceImageArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ReferenceImageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ReferenceImageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ReferenceImageArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var referenceImageResource = new GoogleNative.Vision.V1.ReferenceImage("referenceImageResource", new()
{
ProductId = "string",
Uri = "string",
BoundingPolys = new[]
{
new GoogleNative.Vision.V1.Inputs.BoundingPolyArgs
{
NormalizedVertices = new[]
{
new GoogleNative.Vision.V1.Inputs.NormalizedVertexArgs
{
X = 0,
Y = 0,
},
},
Vertices = new[]
{
new GoogleNative.Vision.V1.Inputs.VertexArgs
{
X = 0,
Y = 0,
},
},
},
},
Location = "string",
Name = "string",
Project = "string",
ReferenceImageId = "string",
});
example, err := vision.NewReferenceImage(ctx, "referenceImageResource", &vision.ReferenceImageArgs{
ProductId: pulumi.String("string"),
Uri: pulumi.String("string"),
BoundingPolys: vision.BoundingPolyArray{
&vision.BoundingPolyArgs{
NormalizedVertices: vision.NormalizedVertexArray{
&vision.NormalizedVertexArgs{
X: pulumi.Float64(0),
Y: pulumi.Float64(0),
},
},
Vertices: vision.VertexArray{
&vision.VertexArgs{
X: pulumi.Int(0),
Y: pulumi.Int(0),
},
},
},
},
Location: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
ReferenceImageId: pulumi.String("string"),
})
var referenceImageResource = new ReferenceImage("referenceImageResource", ReferenceImageArgs.builder()
.productId("string")
.uri("string")
.boundingPolys(BoundingPolyArgs.builder()
.normalizedVertices(NormalizedVertexArgs.builder()
.x(0)
.y(0)
.build())
.vertices(VertexArgs.builder()
.x(0)
.y(0)
.build())
.build())
.location("string")
.name("string")
.project("string")
.referenceImageId("string")
.build());
reference_image_resource = google_native.vision.v1.ReferenceImage("referenceImageResource",
product_id="string",
uri="string",
bounding_polys=[google_native.vision.v1.BoundingPolyArgs(
normalized_vertices=[google_native.vision.v1.NormalizedVertexArgs(
x=0,
y=0,
)],
vertices=[google_native.vision.v1.VertexArgs(
x=0,
y=0,
)],
)],
location="string",
name="string",
project="string",
reference_image_id="string")
const referenceImageResource = new google_native.vision.v1.ReferenceImage("referenceImageResource", {
productId: "string",
uri: "string",
boundingPolys: [{
normalizedVertices: [{
x: 0,
y: 0,
}],
vertices: [{
x: 0,
y: 0,
}],
}],
location: "string",
name: "string",
project: "string",
referenceImageId: "string",
});
type: google-native:vision/v1:ReferenceImage
properties:
boundingPolys:
- normalizedVertices:
- x: 0
"y": 0
vertices:
- x: 0
"y": 0
location: string
name: string
productId: string
project: string
referenceImageId: string
uri: string
ReferenceImage Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ReferenceImage resource accepts the following input properties:
- Product
Id string - Uri string
- The Google Cloud Storage URI of the reference image. The URI must start with
gs://
. - Bounding
Polys List<Pulumi.Google Native. Vision. V1. Inputs. Bounding Poly> - Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
- Location string
- Name string
- The resource name of the reference image. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
. This field is ignored when creating a reference image. - Project string
- Reference
Image stringId - A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character
/
.
- Product
Id string - Uri string
- The Google Cloud Storage URI of the reference image. The URI must start with
gs://
. - Bounding
Polys []BoundingPoly Args - Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
- Location string
- Name string
- The resource name of the reference image. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
. This field is ignored when creating a reference image. - Project string
- Reference
Image stringId - A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character
/
.
- product
Id String - uri String
- The Google Cloud Storage URI of the reference image. The URI must start with
gs://
. - bounding
Polys List<BoundingPoly> - Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
- location String
- name String
- The resource name of the reference image. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
. This field is ignored when creating a reference image. - project String
- reference
Image StringId - A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character
/
.
- product
Id string - uri string
- The Google Cloud Storage URI of the reference image. The URI must start with
gs://
. - bounding
Polys BoundingPoly[] - Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
- location string
- name string
- The resource name of the reference image. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
. This field is ignored when creating a reference image. - project string
- reference
Image stringId - A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character
/
.
- product_
id str - uri str
- The Google Cloud Storage URI of the reference image. The URI must start with
gs://
. - bounding_
polys Sequence[BoundingPoly Args] - Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
- location str
- name str
- The resource name of the reference image. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
. This field is ignored when creating a reference image. - project str
- reference_
image_ strid - A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character
/
.
- product
Id String - uri String
- The Google Cloud Storage URI of the reference image. The URI must start with
gs://
. - bounding
Polys List<Property Map> - Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
- location String
- name String
- The resource name of the reference image. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
. This field is ignored when creating a reference image. - project String
- reference
Image StringId - A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character
/
.
Outputs
All input properties are implicitly available as output properties. Additionally, the ReferenceImage resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Supporting Types
BoundingPoly, BoundingPolyArgs
- Normalized
Vertices List<Pulumi.Google Native. Vision. V1. Inputs. Normalized Vertex> - The bounding polygon normalized vertices.
- Vertices
List<Pulumi.
Google Native. Vision. V1. Inputs. Vertex> - The bounding polygon vertices.
- Normalized
Vertices []NormalizedVertex - The bounding polygon normalized vertices.
- Vertices []Vertex
- The bounding polygon vertices.
- normalized
Vertices List<NormalizedVertex> - The bounding polygon normalized vertices.
- vertices List<Vertex>
- The bounding polygon vertices.
- normalized
Vertices NormalizedVertex[] - The bounding polygon normalized vertices.
- vertices Vertex[]
- The bounding polygon vertices.
- normalized_
vertices Sequence[NormalizedVertex] - The bounding polygon normalized vertices.
- vertices Sequence[Vertex]
- The bounding polygon vertices.
- normalized
Vertices List<Property Map> - The bounding polygon normalized vertices.
- vertices List<Property Map>
- The bounding polygon vertices.
BoundingPolyResponse, BoundingPolyResponseArgs
- Normalized
Vertices List<Pulumi.Google Native. Vision. V1. Inputs. Normalized Vertex Response> - The bounding polygon normalized vertices.
- Vertices
List<Pulumi.
Google Native. Vision. V1. Inputs. Vertex Response> - The bounding polygon vertices.
- Normalized
Vertices []NormalizedVertex Response - The bounding polygon normalized vertices.
- Vertices
[]Vertex
Response - The bounding polygon vertices.
- normalized
Vertices List<NormalizedVertex Response> - The bounding polygon normalized vertices.
- vertices
List<Vertex
Response> - The bounding polygon vertices.
- normalized
Vertices NormalizedVertex Response[] - The bounding polygon normalized vertices.
- vertices
Vertex
Response[] - The bounding polygon vertices.
- normalized_
vertices Sequence[NormalizedVertex Response] - The bounding polygon normalized vertices.
- vertices
Sequence[Vertex
Response] - The bounding polygon vertices.
- normalized
Vertices List<Property Map> - The bounding polygon normalized vertices.
- vertices List<Property Map>
- The bounding polygon vertices.
NormalizedVertex, NormalizedVertexArgs
NormalizedVertexResponse, NormalizedVertexResponseArgs
Vertex, VertexArgs
VertexResponse, VertexResponseArgs
Package Details
- Repository
- Google Cloud Native pulumi/pulumi-google-native
- License
- Apache-2.0
Google Cloud Native is in preview. Google Cloud Classic is fully supported.