Method and apparatus for obtaining product training images, and non-transitory computer-readable storage medium
AssigneeBeijing Baidu Netcom Science Technology Co., Ltd.
InventorKaibing Chen
Life of this patent
Estimating the term…
Abstract
The present disclosure provides a method and an apparatus for obtaining product training images, and a storage medium. The method includes: obtaining product images on each of product webpages in an e-commerce website, and determining a product feature vector of each product image on the product webpage; dividing the product images on the product webpage, and determining a target image set of the product webpage according to an image dividing result; classifying target image sets of the product webpages according to the average product feature vector to obtain at least one type of image set; and generating the product training images according to the at least one type of image set.
Claims13
A method for obtaining product training images, comprising:
- obtaining product images on each of product webpages in an e-commerce website, and determining a product feature vector of each product image on the product webpage;
- for each product webpage, according to the product feature vector of each product image on the product webpage, dividing the product images on the product webpage into at least one image set of the product webpage, and determining a target image set of the product webpage with the largest number of product images from the at least one image set;
- determining an average product feature vector of the target image set according to product feature vectors of the product images in the target image set of the product webpage;
- classifying target image sets of the product webpages according to the average product feature vector to obtain at least one type of image set;
- and
- generating the product training images according to the at least one type of image set, wherein according to the product feature vector of each product image on the product webpage, dividing the product images on the product webpage into at least one image set of the product webpage, comprises:
- determining a difference degree between two product feature vectors according to the product feature vector of each product image on the product webpage;
- randomly selecting a product feature vector from product feature vectors of the product images as a first reference feature vector;
- obtaining a target product feature vector with a difference degree from the first reference feature vector that is less than a first difference degree threshold;
- determining the target product feature vector as the first reference feature vector, and continuing to obtain a target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold, until there is no target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold;
- adding the target product image corresponding to the target product feature vector into one image set;
- and
- if there are ungrouped product images in the product images on the product webpage, randomly selecting a product feature vector from product feature vectors corresponding to the ungrouped product images as the first reference feature vector, and continuing to obtain a target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold until there is no target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold.
An apparatus for obtaining product training images, comprising:
- one or more processors;
- a memory storing instructions executable by the one or more processors;
- wherein the one or more processors are configured to:
- obtain product images on each of product webpages in an e-commerce website;
- determine a product feature vector of each product image on the product webpage;
- for each product webpage, according to the product feature vector of each product image on the product webpage, divide the product images on the product webpage into at least one image set of the product webpage, and determine a target image set of the product webpage with the largest number of product images from the at least one image set;
- determine an average product feature vector of the target image set according to product feature vectors of the product images in the target image set of the product webpage;
- classify target image sets of the product webpages according to the average product feature vector to obtain at least one type of image set;
- and
- generate the product training images according to the at least one type of image set, wherein the one or more processors are configured to:
- determine a difference degree between two product feature vectors according to the product feature vector of each product image on the product webpage;
- randomly select a product feature vector from product feature vectors of the product images as a first reference feature vector;
- obtain a target product feature vector with a difference degree from the first reference feature vector that is less than a first difference degree threshold;
- determine the target product feature vector as the first reference feature vector and continue to obtain a target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold, until there is no target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold;
- add the target product image corresponding to the target product feature vector into one image set;
- and
- if there are ungrouped product images in the product images on the product webpage, randomly select a product feature vector from product feature vectors corresponding to the ungrouped product images as the first reference feature vector, and continue to obtain a target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold until there is no target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold.
A non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, a method for obtaining product training images is implemented, and the method comprises:
- obtaining product images on each of product webpages in an e-commerce website, and determining a product feature vector of each product image on the product webpage;
- for each product webpage, according to the product feature vector of each product image on the product webpage, dividing the product images on the product webpage into at least one image set of the product webpage, and determining a target image set of the product webpage with the largest number of product images from the at least one image set;
- determining an average product feature vector of the target image set according to product feature vectors of the product images in the target image set of the product webpage;
- classifying target image sets of the product webpages according to the average product feature vector to obtain at least one type of image set;
- and
- generating the product training images according to the at least one type of image set, wherein according to the product feature vector of each product image on the product webpage, dividing the product images on the product webpage into at least one image set of the product webpage, comprises:
- determining a difference degree between two product feature vectors according to the product feature vector of each product image on the product webpage;
- randomly selecting a product feature vector from product feature vectors of the product images as a first reference feature vector;
- obtaining a target product feature vector with a difference degree from the first reference feature vector that is less than a first difference degree threshold;
- determining the target product feature vector as the first reference feature vector, and continuing to obtain a target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold, until there is no target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold;
- adding the target product image corresponding to the target product feature vector into one image set;
- and
- if there are ungrouped product images in the product images on the product webpage, randomly selecting a product feature vector from product feature vectors corresponding to the ungrouped product images as the first reference feature vector, and continuing to obtain a target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold until there is no target product feature vector with a difference degree from the first reference feature vector that is less than the first difference degree threshold.
Dependencies are inferred from the claim text.