1. Packages
  2. Google Cloud Native
  3. API Docs
  4. vision
  5. vision/v1
  6. ReferenceImage

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

google-native.vision/v1.ReferenceImage

Explore with Pulumi AI

google-native logo

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

    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=[{
            "normalized_vertices": [{
                "x": 0,
                "y": 0,
            }],
            "vertices": [{
                "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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ReferenceImage resource accepts the following input properties:

    ProductId string
    Uri string
    The Google Cloud Storage URI of the reference image. The URI must start with gs://.
    BoundingPolys List<Pulumi.GoogleNative.Vision.V1.Inputs.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
    ReferenceImageId string
    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 /.
    ProductId string
    Uri string
    The Google Cloud Storage URI of the reference image. The URI must start with gs://.
    BoundingPolys []BoundingPolyArgs
    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
    ReferenceImageId string
    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 /.
    productId String
    uri String
    The Google Cloud Storage URI of the reference image. The URI must start with gs://.
    boundingPolys 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
    referenceImageId String
    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 /.
    productId string
    uri string
    The Google Cloud Storage URI of the reference image. The URI must start with gs://.
    boundingPolys 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
    referenceImageId string
    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[BoundingPolyArgs]
    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_id str
    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 /.
    productId String
    uri String
    The Google Cloud Storage URI of the reference image. The URI must start with gs://.
    boundingPolys 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
    referenceImageId String
    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

    NormalizedVertices []NormalizedVertex
    The bounding polygon normalized vertices.
    Vertices []Vertex
    The bounding polygon vertices.
    normalizedVertices List<NormalizedVertex>
    The bounding polygon normalized vertices.
    vertices List<Vertex>
    The bounding polygon vertices.
    normalizedVertices 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.
    normalizedVertices List<Property Map>
    The bounding polygon normalized vertices.
    vertices List<Property Map>
    The bounding polygon vertices.

    BoundingPolyResponse, BoundingPolyResponseArgs

    NormalizedVertices []NormalizedVertexResponse
    The bounding polygon normalized vertices.
    Vertices []VertexResponse
    The bounding polygon vertices.
    normalizedVertices List<NormalizedVertexResponse>
    The bounding polygon normalized vertices.
    vertices List<VertexResponse>
    The bounding polygon vertices.
    normalizedVertices NormalizedVertexResponse[]
    The bounding polygon normalized vertices.
    vertices VertexResponse[]
    The bounding polygon vertices.
    normalized_vertices Sequence[NormalizedVertexResponse]
    The bounding polygon normalized vertices.
    vertices Sequence[VertexResponse]
    The bounding polygon vertices.
    normalizedVertices List<Property Map>
    The bounding polygon normalized vertices.
    vertices List<Property Map>
    The bounding polygon vertices.

    NormalizedVertex, NormalizedVertexArgs

    X double
    X coordinate.
    Y double
    Y coordinate.
    X float64
    X coordinate.
    Y float64
    Y coordinate.
    x Double
    X coordinate.
    y Double
    Y coordinate.
    x number
    X coordinate.
    y number
    Y coordinate.
    x float
    X coordinate.
    y float
    Y coordinate.
    x Number
    X coordinate.
    y Number
    Y coordinate.

    NormalizedVertexResponse, NormalizedVertexResponseArgs

    X double
    X coordinate.
    Y double
    Y coordinate.
    X float64
    X coordinate.
    Y float64
    Y coordinate.
    x Double
    X coordinate.
    y Double
    Y coordinate.
    x number
    X coordinate.
    y number
    Y coordinate.
    x float
    X coordinate.
    y float
    Y coordinate.
    x Number
    X coordinate.
    y Number
    Y coordinate.

    Vertex, VertexArgs

    X int
    X coordinate.
    Y int
    Y coordinate.
    X int
    X coordinate.
    Y int
    Y coordinate.
    x Integer
    X coordinate.
    y Integer
    Y coordinate.
    x number
    X coordinate.
    y number
    Y coordinate.
    x int
    X coordinate.
    y int
    Y coordinate.
    x Number
    X coordinate.
    y Number
    Y coordinate.

    VertexResponse, VertexResponseArgs

    X int
    X coordinate.
    Y int
    Y coordinate.
    X int
    X coordinate.
    Y int
    Y coordinate.
    x Integer
    X coordinate.
    y Integer
    Y coordinate.
    x number
    X coordinate.
    y number
    Y coordinate.
    x int
    X coordinate.
    y int
    Y coordinate.
    x Number
    X coordinate.
    y Number
    Y coordinate.

    Package Details

    Repository
    Google Cloud Native pulumi/pulumi-google-native
    License
    Apache-2.0
    google-native logo

    Google Cloud Native is in preview. Google Cloud Classic is fully supported.

    Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi