Method: projects.locations.products.referenceImages.create
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Membuat dan menampilkan resource ReferenceImage baru.
Kolom boundingPoly
bersifat opsional. Jika boundingPoly
tidak ditentukan, sistem akan mencoba mendeteksi wilayah yang diinginkan dalam gambar yang kompatibel dengan productCategory pada produk induk. Jika ditentukan, deteksi SELALU dilewati. Sistem mengonversi poligon menjadi persegi panjang yang tidak diputar.
Perhatikan bahwa pipeline akan mengubah ukuran gambar jika resolusi gambar terlalu besar untuk diproses (di atas 50 MP).
Kemungkinan error:
- Menampilkan INVALID_ARGUMENT jika imageUri tidak ada atau lebih dari 4.096 karakter.
- Menampilkan INVALID_ARGUMENT jika produk tidak ada.
- Menampilkan INVALID_ARGUMENT jika boundingPoly tidak disediakan, dan tidak ada yang kompatibel dengan productCategory produk induk yang terdeteksi.
- Menampilkan INVALID_ARGUMENT jika boundingPoly berisi lebih dari 10 poligon.
Permintaan HTTP
POST https://vision.googleapis.com/v1/{parent=projects/*/locations/*/products/*}/referenceImages
URL menggunakan sintaks gRPC Transcoding.
Parameter jalur
Parameter |
parent |
string
Wajib. Nama resource produk membuat gambar referensi. Format adalahprojects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID .
|
Parameter kueri
Parameter |
referenceImageId |
string
ID resource yang disediakan pengguna untuk ReferenceImage yang akan ditambahkan. Jika disetel, server akan mencoba menggunakan nilai ini sebagai ID resource. Jika sudah digunakan, kesalahan akan ditampilkan dengan kode ALREADY_EXISTS. Maksimum 128 karakter. Teks tidak boleh berisi karakter / .
|
Isi permintaan
Isi permintaan memuat instance ReferenceImage
.
Isi respons
Jika berhasil, isi respons memuat instance ReferenceImage
yang baru dibuat.
Cakupan Otorisasi
Memerlukan salah satu cakupan OAuth berikut:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/cloud-vision
Untuk mengetahui informasi selengkapnya, lihat Ringkasan Autentikasi.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-30 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-30 UTC."],[],[],null,["# Method: projects.locations.products.referenceImages.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n\nCreates and returns a new ReferenceImage resource.\n\nThe `boundingPoly` field is optional. If `boundingPoly` is not specified, the system will try to detect regions of interest in the image that are compatible with the productCategory on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.\n\nNote that the pipeline will resize the image if the image resolution is too large to process (above 50MP).\n\nPossible errors:\n\n- Returns INVALID_ARGUMENT if the imageUri is missing or longer than 4096 characters.\n- Returns INVALID_ARGUMENT if the product does not exist.\n- Returns INVALID_ARGUMENT if boundingPoly is not provided, and nothing compatible with the parent product's productCategory is detected.\n- Returns INVALID_ARGUMENT if boundingPoly contains more than 10 polygons.\n\n### HTTP request\n\n`POST https://vision.googleapis.com/v1/{parent=projects/*/locations/*/products/*}/referenceImages`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body contains an instance of [ReferenceImage](/vision/product-search/docs/reference/rest/v1/projects.locations.products.referenceImages#ReferenceImage).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [ReferenceImage](/vision/product-search/docs/reference/rest/v1/projects.locations.products.referenceImages#ReferenceImage).\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `https://www.googleapis.com/auth/cloud-vision`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/)."]]