Data processing method and device, electronic equipment and storage medium
By performing object part detection and clustering on multiple videos, an object part sample dataset is generated, which solves the problems of low processing efficiency and poor accuracy in existing technologies and improves the recognition accuracy of the object part recognition model.
Patent Information
- Application Number
- CN202111292897.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-03
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2041-11-03
AI Technical Summary
In existing technologies, the processing efficiency of object part sample datasets is low and complex, and errors are prone to occur, affecting the recognition accuracy of object part recognition models.
By performing object part detection on multiple videos, a first image set is obtained. Local and global clustering is then performed to determine the first and second labels of the images, ultimately generating an object part sample dataset.
It improves the processing efficiency and accuracy of sample data for object parts, and enhances the recognition accuracy of the object part recognition model.
Smart Images

Figure CN116091856B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the widespread application of deep learning technology, object part recognition technology based on deep learning has developed rapidly, where each object part can uniquely identify an object. Typically, a supervised learning approach based on deep learning is used to train the object part recognition model, and then the trained model is used to identify collected object part data. Supervised learning refers to training the model using a dataset of labeled object part samples.
[0003] Under the relevant technology, the object part sample dataset is obtained as follows: a large number of sample images are obtained through formal channels, and object parts are detected on the large number of sample images. The sample images with object part data are used as object part sample data and further processed by denoising, clustering, deduplication, etc. Finally, the sample object part data after a series of processing is labeled to obtain the labeled object part sample dataset.
[0004] However, the object part sample dataset obtained by the above method has low processing efficiency and is complex and prone to errors. This results in the presence of object part sample data that does not meet the requirements after annotation, which in turn affects the training process of the object part recognition model and makes the recognition accuracy of the trained object part recognition model low. Summary of the Invention
[0005] This application provides a data processing method, apparatus, electronic device, and storage medium to improve the processing efficiency and accuracy of sample data of object parts.
[0006] On one hand, embodiments of this application provide a data processing method, including:
[0007] Multiple videos to be processed are acquired, and object part detection processing is performed on each of the multiple videos to obtain a first image set containing the object part for each of the multiple videos; wherein, the object part is used to uniquely identify the object, and different images containing the same object in the same first image set are set with the same first label;
[0008] Multiple first image sets are subjected to object part feature clustering processing to obtain multiple second image sets; wherein, each image in the same second image set is assigned the same second label;
[0009] Based on the first and second tags associated with each image, the target tags of each image are determined respectively; wherein, different images containing the same object have the same target tags.
[0010] Based on the obtained images and their corresponding target labels, a sample dataset of object parts is generated.
[0011] On one hand, embodiments of this application provide a data processing apparatus, including:
[0012] The local clustering module is used to acquire multiple videos to be processed, and to perform object part detection processing on each of the multiple videos to obtain a first image set containing the object part for each of the multiple videos; wherein, the object part is used to uniquely identify the object, and different images containing the same object in the same first image set are set with the same first label;
[0013] The global clustering module is used to perform object part feature clustering on each image in the multiple first image sets to obtain multiple second image sets; wherein each image in the same second image set is assigned the same second label;
[0014] The tag determination module is used to determine the target tag for each image based on the first tag and the second tag associated with each image; wherein different images containing the same object have the same target tag.
[0015] The sample generation module is used to generate a dataset of sample parts of an object based on the obtained images and their corresponding target labels.
[0016] In one possible embodiment, the local clustering module is further configured to:
[0017] For each of the multiple videos, perform the following operations:
[0018] Extract multiple frames of images from a video, and perform object part detection on each of the multiple frames to obtain multiple images containing the object parts;
[0019] Extract the first object part features of each of the multiple images respectively, and perform clustering processing on the multiple images based on the obtained first object part features to obtain at least one first image subset corresponding to each object;
[0020] For each of the at least one subset of first images obtained, a corresponding first label is set;
[0021] Based on the at least one subset of first images and the corresponding first tags, a first set of images corresponding to the video is generated.
[0022] In one possible embodiment, when clustering the multiple images based on the obtained multiple first object part features to obtain at least one first image subset corresponding to each object, the local clustering module is further configured to:
[0023] The object part tracking algorithm is used to aggregate adjacent and identical first object part features among the multiple first object part features to obtain multiple aggregated first feature subsequences.
[0024] Clustering is performed on the plurality of first feature subsequences to obtain at least one first feature sequence, and each first feature sequence contains the same plurality of first object part features;
[0025] For the at least one first feature sequence, perform the following operations respectively: based on multiple images corresponding to a first feature sequence, determine a subset of first images corresponding to a specific object.
[0026] In one possible embodiment, the global clustering module is further configured to:
[0027] Extract the second object region features from each of the images respectively;
[0028] The k-nearest neighbor algorithm is used to cluster the extracted features of each second object part to obtain multiple second feature sequences, each of which contains the same multiple features of the second object parts.
[0029] For each of the multiple second feature sequences, the following operations are performed: based on the multiple images corresponding to a second feature sequence, a corresponding second image set is determined, and a corresponding second label is set for the second image set.
[0030] In one possible embodiment, when the k-nearest neighbor algorithm is used to cluster the extracted features of each second object part to obtain multiple second feature sequences, the global clustering module is further used for:
[0031] The k-nearest neighbor algorithm is used to construct a k-nearest neighbor graph for the features of each of the second objects.
[0032] In the k-nearest neighbor graph, multiple graph nodes belonging to the same category are pruned to obtain the multiple second feature sequences; wherein each graph node represents a second object part feature.
[0033] In one possible embodiment, the label determination module is further configured to:
[0034] When two images are identified that have the same first label and different second labels, the same target label is set for the two images.
[0035] When it is determined that two images in each of the images have the same second label, the same target label is set for the two images.
[0036] In one possible embodiment, the sample generation module is further configured to:
[0037] The images are divided into multiple third image sets; wherein, within the same third image set, each image has the same target label;
[0038] Based on the multiple sets of third images, a sample dataset of the object parts is generated.
[0039] On one hand, embodiments of this application provide an electronic device, which includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor performs the steps of any of the above-described data processing methods.
[0040] On one hand, embodiments of this application provide a computer storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the steps of any of the above-described data processing methods.
[0041] On one hand, an embodiment of this application provides a computer program product, which includes computer instructions stored in a computer-readable storage medium; when a processor of an electronic device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, causing the electronic device to perform the steps of any of the above-described data processing methods.
[0042] Since the embodiments of this application adopt the above-described technical solution, they have at least the following technical effects:
[0043] In the solution of this application embodiment, for multiple videos to be processed, by detecting and processing the images in each video, multiple images corresponding to the same object in each video can be accurately obtained (which can be understood as local clustering). Multiple images of the same object have the same first label, thereby obtaining a first image set corresponding to each video. Then, all images in the multiple videos are clustered again (which can be understood as global clustering) to obtain multiple second image sets, each of which has a corresponding second label. Then, the first label of all images is used to verify the second label of all images, thereby further accurately obtaining different images of the same object in all images, and setting the same target label for different images of the same object.
[0044] By adopting the above scheme, a large number of images containing object parts can be obtained quickly and accurately, and the labels of each image can be determined, thereby improving the processing efficiency and accuracy of object part sample data. Thus, by using the object part sample dataset obtained in the embodiments of this application to train the object part recognition model, the recognition accuracy of the trained object part recognition model can be improved.
[0045] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a schematic diagram illustrating an application scenario of a data processing method provided in an embodiment of this application;
[0048] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0049] Figure 3 This is a schematic diagram illustrating the clustering of multiple images from a single video, as provided in an embodiment of this application.
[0050] Figure 4 This is a schematic diagram illustrating the clustering of all images provided in an embodiment of this application;
[0051] Figure 5 A flowchart illustrating another data processing method provided in this application embodiment;
[0052] Figure 6 A flowchart illustrating another data processing method provided in this application embodiment;
[0053] Figure 7 A flowchart illustrating another data processing method provided in this application embodiment;
[0054] Figure 8 A flowchart illustrating another data processing method provided in this application embodiment;
[0055] Figure 9 This is another schematic diagram illustrating the clustering of multiple images from a single video, provided as an embodiment of this application.
[0056] Figure 10 A flowchart illustrating another data processing method provided in this application embodiment;
[0057] Figure 11 This is a schematic diagram illustrating another method of clustering all images, provided as an embodiment of this application.
[0058] Figure 12 A logical schematic diagram of a data processing method provided in an embodiment of this application;
[0059] Figure 13 A structural block diagram of a data processing apparatus provided in an embodiment of this application;
[0060] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0061] Figure 15 This is a schematic diagram of the structure of another electronic device in an embodiment of this application. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] To help those skilled in the art better understand the technical solutions of this application, some of the concepts involved in this application are introduced below.
[0064] The k-nearest neighbor algorithm: In the feature space, a given feature is compared with other features of a defined category. The distances between the given feature and each of the other features are calculated. The k features closest to the given feature are then recorded. Finally, the category to which the majority of the k features belong is selected as the category of the given feature. Here, the given feature can be understood as a second object part feature in this embodiment, and the other features can be understood as other second object part features.
[0065] k-Nearest Neighbor Graph: Based on the k-nearest neighbor algorithm described above, a given feature is connected to its k nearest neighbors to obtain a k-nearest neighbor graph. Simultaneously, the category to which the majority of the k features belong is taken as the category of the given feature. Each feature can be understood as a feature of each second object part in this embodiment of the application.
[0066] The word “exemplary” as used below means “serving as an example, embodiment, or illustration.” Any embodiment illustrated as an “exemplary” need not be construed as superior to or better than other embodiments.
[0067] The terms "first" and "second" used in this document are for descriptive purposes only and should not be construed as indicating relative importance or implying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0068] The design concept of the embodiments of this application is briefly introduced below:
[0069] In related technologies, the method for obtaining object part sample datasets is as follows: a large number of sample images are obtained through formal channels, and object parts are detected on the large number of sample images collected. The sample images with object part data are used as object part sample data and further processed by denoising, clustering, deduplication, etc. Finally, the sample object part data after a series of processing is labeled to obtain the labeled object part sample dataset.
[0070] However, the object part sample dataset obtained by the above method has low processing efficiency and is complex and prone to errors. This results in the presence of unqualified sample object parts in the labeled object part sample dataset, which in turn affects the training process of the object part recognition model and makes the recognition accuracy of the trained object part recognition model low.
[0071] In view of this, embodiments of this application provide a data processing method, apparatus, electronic device, and storage medium. For multiple videos, by clustering the images in each video, multiple images corresponding to the same object in each video can be accurately obtained. Then, all images in the multiple videos are clustered again to obtain multiple second image sets, each with a corresponding second label. Next, the second labels of all images are verified using the first labels of all images, thereby further identifying different images of the same object in all images, and setting the same target label for different images of the same object. Therefore, a large number of images containing object parts can be quickly and accurately obtained, and the labels of each image can be determined, improving the processing efficiency and accuracy of object part sample data.
[0072] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0073] like Figure 1 The diagram shown is an application scenario illustration of an embodiment of this application. The application scenario diagram includes multiple terminal devices 110 and a server 120, which can communicate with each other via a communication network.
[0074] In one alternative implementation, the communication network can be a wired network or a wireless network.
[0075] In this embodiment, the terminal device 210 is an electronic device used by a user, including but not limited to personal computers, mobile phones, tablets, laptops, e-book readers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. The server 200 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0076] It should be noted that the data processing method in this application embodiment can be executed by the server or the terminal device alone, or by both the server and the terminal device together. When both the server and the terminal device execute together, for example, the terminal device can collect multiple videos to be processed and send them to the server, which then performs subsequent processing on the videos. The following explanation primarily uses the example of the server executing the method alone, and no specific limitations are made here.
[0077] In a specific implementation, the server can collect multiple videos containing objects, for example, by crawling multiple videos through a web crawler, and then process the multiple videos using the data processing method of the embodiments of this application to obtain a sample dataset of object parts.
[0078] It should be noted that, Figure 2 The examples shown are merely illustrative; in reality, the number of terminal devices and servers is unlimited and is not specifically limited in the embodiments of this application.
[0079] The data processing method provided by exemplary embodiments of this application will be described below with reference to the accompanying drawings and the application scenarios described above. It should be noted that the application scenarios described above are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Furthermore, the embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, object artificial intelligence, smart transportation, and assisted driving.
[0080] See Figure 2 The diagram shown is a flowchart illustrating the implementation of a data processing method according to an embodiment of this application. The method is described here using a server as the execution entity as an example. The specific implementation flow of this method is as follows:
[0081] S201, acquire multiple videos to be processed, and perform object part detection processing on each video to obtain a first image set corresponding to each video, which contains the object part; wherein, the object part is used to uniquely identify the object, and different images containing the same object in the same first image set are set with the same first label.
[0082] The multiple videos to be processed can be videos containing object parts. An object part can be a specific part of an object, uniquely identifying it, such as a face or eyes. When the object part is the face or eyes of an object, the same object can refer to the same person. In the following embodiments of this application, the object can refer to a person.
[0083] It should be noted that multiple videos can be obtained through legitimate channels, such as obtaining multiple videos from the internet with the permission of the video copyright holder or the person in the video, or through other legitimate channels; no restrictions are imposed here.
[0084] For each video, multiple frames of images can be obtained, and then face detection can be performed on each frame. Specifically, existing face detection methods can be used to obtain multiple images containing faces. When the video contains multiple objects, multiple images of each object can be obtained, where each image can contain the face of one object.
[0085] Furthermore, facial features can be extracted from multiple images separately, and based on these extracted facial features, the multiple images can be clustered together, that is, the same facial features are clustered together to obtain different images of the same object, and the same first label is set for different images of the same object, thereby obtaining the first image set corresponding to each video; where the first label is used to represent the video-level label, which can be understood as a local label, and its specific form can be set as needed.
[0086] like Figure 3 As shown, video A contains 3 objects. After obtaining multiple images from video A, these images are clustered to obtain multiple images corresponding to each of the 3 objects. Then, a first label 'a' is set for the multiple images of the first object, a first label 'b' is set for the multiple images of the second object, and a first label 'c' is set for the multiple images of the third object. By setting different first labels, these 3 objects are distinguished, thereby obtaining the first image set corresponding to video A.
[0087] It should be noted that the specific form of the first tag can differ across different videos. For example, another video might contain four objects, and the first tags for each of these four objects could be A, B, C, and D. Understandably, there is no correlation between the first tags of multiple videos.
[0088] Since the number of objects appearing in a single video is limited, assuming that a maximum of 10 objects appear in a single video, clustering based on the facial features of these 10 objects yields high accuracy. Therefore, it is possible to accurately obtain different images of the same object in a single video.
[0089] Through the above process, multiple objects in each video can be distinguished to obtain different images corresponding to the same object in each video, thus obtaining the first image set.
[0090] S202, perform object part feature clustering processing on each image in the multiple first image sets to obtain multiple second image sets; wherein, each image in the same second image set is assigned the same second label.
[0091] Taking the face as an example, the multiple first image sets contain images obtained from the aforementioned multiple videos. For each image, facial features are extracted. Then, based on the extracted facial features, all images are clustered. For example, a corresponding clustering algorithm can be used to cluster all images to obtain multiple categories of image sets. Each category of image set can be used as a second image set. Furthermore, a corresponding second label is set for each category, so that each image in the same second image set has the same second label. This second label can be understood as a global label, and its specific form can be different from the first label mentioned above to distinguish between local and global labels.
[0092] For example, such as Figure 4 As shown, after performing facial feature clustering on all images obtained from multiple videos, a second image set corresponding to category 1, a second image set corresponding to category 2, ..., a second image set corresponding to category n is obtained. Second labels 1, 2, ..., n are assigned to categories 1, 2, ..., n respectively, so that each image in the second image set corresponding to category 1 has second label 1, each image in the second image set corresponding to category 2 has second label 2, and so on, with each image in the second image set corresponding to category n having second label n.
[0093] S203, based on the first and second labels associated with each image, determine the target label for each image; wherein, different images containing the same object have the same target label.
[0094] In this embodiment, considering the accuracy of clustering multiple images in a single video, meaning that images with the same first label can be considered as images of the same object, the clustering algorithm's threshold (e.g., the k value in the k-nearest neighbor algorithm described below) can be set relatively low in global clustering to ensure that images of the same class are grouped together as much as possible.
[0095] However, considering the large number of images obtained from multiple videos, errors can easily occur during the facial feature clustering process. For example, two images of the same object may be classified into different categories. Therefore, for all images, the first label is used to iteratively verify the second label. If two images have different second labels but the same first label, then the two images are classified as the same object.
[0096] In one possible implementation, such as Figure 5 As shown, in step S203 above, determining the target label for each image based on its associated first and second labels can include the following steps:
[0097] S2031, when it is determined that two images in each image have the same first label and different second labels, set the same target label for the two images;
[0098] S2032, whenever it is determined that two images in each image have the same second label, set the same target label for the two images.
[0099] In this implementation, all images can be traversed in a set order. Whenever two images are identified that have the same first label and different second labels, they are considered to belong to the same object, and the corresponding label (i.e., target label) of the same object is set for the two images. Whenever two images are identified that have the same second label, they are considered to belong to the same object, and the corresponding label of the same object is set for the two images.
[0100] In this way, multiple images of the same object can be accurately obtained, thus accurately classifying all images, grouping multiple images of the same object into one category, and setting corresponding target labels.
[0101] For example, all images include the first image, the second image, the third image, ... the mth image. Suppose that the first label of the first image and the third image are both 'a', and the second label of the first image is '4', and the second label of the third image is '5'. Then the first image and the third image are considered to belong to the same object, and the target label corresponding to this object is 'id6'. Therefore, the first image and the third image are set to the same target label 'id6'.
[0102] Furthermore, suppose that the second tag of the 5th image and the 8th image are both 4. Regardless of whether the first tags of these two images are the same, it is assumed that the 5th image and the 8th image belong to the same object. The target tag corresponding to this object is id3. Therefore, the same target tag id3 is set for the 5th image and the 8th image.
[0103] S204. Based on the obtained images and their corresponding target labels, generate a sample dataset of object parts.
[0104] In this step, each image has a target label. Multiple images with the same label can be saved together, which makes it easier to check all images and avoid noisy images.
[0105] In one alternative implementation, such as Figure 6 As shown, S204 generates an object part sample dataset based on the obtained images and corresponding target labels, which may include the following steps:
[0106] S2041, divide each image into multiple third image sets; wherein, within the same third image set, each image has the same target label;
[0107] S2042, Generate a sample dataset of object parts based on multiple sets of third images.
[0108] Through the above S2041 and S2042, multiple images with the same label can be aggregated together. Specifically, multiple images with the same target label can be saved in the same directory of the same folder, that is, each of the above third image sets is saved in a corresponding directory.
[0109] Furthermore, a folder containing multiple sets of third-party images can be sent to the annotation system. Annotators can log in to the annotation system via a terminal device and inspect all images in the folder to remove noisy images (i.e., images that do not meet the requirements), and then send them to the server via the terminal device. After receiving the inspected images, the server uses these images carrying target labels as a sample dataset of object parts for subsequent training of the object part recognition model.
[0110] In the scheme of this application embodiment, by detecting and processing the images in each video, multiple images corresponding to the same object in each video can be accurately obtained, and the same first label is set for the multiple images of the same object, thereby obtaining a first image set corresponding to each video. Then, all images in multiple videos are clustered again to obtain multiple second image sets, each with a corresponding second label. Then, the first labels of all images are used to verify the second labels of all images, thereby further accurately obtaining different images of the same object in all images, and setting the same target label for different images of the same object. In this way, a large number of images can be collected quickly and accurately, and the labels of each image can be determined, improving the collection efficiency and accuracy of object part sample data. Thus, by using the object part sample dataset obtained in this application embodiment to train the object part recognition model, the recognition accuracy of the trained object part recognition model can be improved.
[0111] The following is combined Figures 7-9 The process of object part detection for a single video in the embodiments of this application will be described in detail.
[0112] When performing object part detection on a single video, multiple frames of images can be extracted first, and then object part detection can be performed on each of the multiple frames to obtain multiple images. Then, object part features can be extracted from each of the multiple images. Based on these object part features, the multiple images can be clustered to obtain images of the same object.
[0113] In some embodiments, such as Figure 7 As shown, object part detection is performed on one of multiple videos to obtain the first set of images corresponding to that video. Specifically, this may include the following steps:
[0114] S2011: Extract multiple frames of images from a video, and perform object part detection on each of the multiple frames to obtain multiple images.
[0115] This involves extracting multiple keyframes from the video. These keyframes can be understood as images from different camera angles (i.e., different images). In other words, for multiple identical images from the same camera angle, one image is selected as a keyframe to obtain the aforementioned multi-frame images.
[0116] Furthermore, taking the face as an example, existing face detection methods can be used to perform face detection on the obtained multi-frame images to determine which images contain the face, thereby obtaining multiple images.
[0117] S2012, extract the first object part features of each of the multiple images, and perform clustering processing on the multiple images based on the obtained first object part features to obtain at least one first image subset corresponding to each object.
[0118] Taking the face as the object part and the first facial feature as the first object part feature as an example, existing facial feature extraction methods can be used to extract the first facial feature of each image. Then, based on the extracted first facial features of multiple images, clustering is performed on the multiple images. Optionally, images with the same first facial feature can be determined by calculating the similarity of the first facial features of each image. Each first facial feature can be in the form of a feature vector, and the similarity between two first facial features can be determined based on the distance between the vectors; the smaller the distance between the vectors, the more similar they are.
[0119] Using the above method, images with the same first facial features can be grouped together to obtain multiple first image subsets, and the images in each first image subset belong to the same object.
[0120] In one alternative implementation, when clustering multiple images, an object part tracking algorithm can be used. Based on the extracted first object part features, each object in the multiple images is tracked, thereby aggregating the images (belonging to the same object) on the same tracking sequence. The same object may correspond to multiple tracking sequences. Finally, the aggregated images are clustered to obtain multiple images of the same object.
[0121] like Figure 8 As shown, in S2012 above, the first object part features of each of the multiple images are extracted, and the multiple images are clustered based on the obtained first object part features to obtain at least one subset of the first images corresponding to each object. Specifically, this may include the following steps:
[0122] S2012_1, extract the first object part features from multiple images.
[0123] S2012_2 uses an object part tracking algorithm to aggregate adjacent and identical first object part features among multiple first object part features to obtain multiple aggregated first feature subsequences.
[0124] For example, the entire feature sequence corresponding to the multiple first object part features extracted above is: F1, F2, F3...Fn. By tracking the same first object part features using the object part tracking algorithm, adjacent and identical first object part features in the entire feature sequence can be aggregated. For example, if F1, F2, and F3 are the same first object part features, then F1, F2, and F3 are aggregated together as a first feature subsequence (which can be understood as a tracking sequence); if F6, F7, and F8 are the same first object part features, then F6, F7, and F8 are aggregated together as a first feature subsequence, and so on, multiple aggregated first feature subsequences can be obtained.
[0125] In this step, taking the object part as the face and the first object part feature as the first facial feature as an example, the face tracking algorithm can be used to filter out facial images of the same object in various poses, thereby ensuring that the variance of the subsequently obtained facial sample dataset is large. Such a facial sample dataset is more conducive to training the object face recognition model.
[0126] S2012_3, perform clustering processing on multiple first feature subsequences to obtain at least one first feature sequence, each first feature sequence containing the same multiple first object part features.
[0127] In this step, the multiple first feature subsequences obtained in the previous steps are clustered. The purpose is to cluster the first feature subsequences with the same first object part feature together (i.e., belonging to the same object) to obtain a single first feature sequence. Optionally, the first feature subsequences with the same first object part feature can be determined by calculating the similarity of the first object part features contained in each first feature subsequence. Assuming multiple objects are included, multiple first feature sequences can be obtained. Each object corresponds to one first feature sequence, meaning that each first feature sequence contains multiple identical first object part features.
[0128] S2012_4, for at least one first feature sequence, perform the following operations respectively: based on multiple images corresponding to a first feature sequence, determine the first image subset corresponding to a corresponding object.
[0129] Since each first feature sequence contains the same multiple first object part features, and each first object part feature corresponds to an image, multiple images can be determined based on each first feature sequence. The multiple images corresponding to each first feature sequence are then treated as a subset of the first images corresponding to an object.
[0130] For example, if multiple first feature sequences are first feature sequence 1, first feature sequence 2, and first feature sequence 3, then the multiple images corresponding to first feature sequence 1 are a subset of the first images corresponding to the first object; the multiple images corresponding to first feature sequence 2 are a subset of the first images corresponding to the second object; and the multiple images corresponding to first feature sequence 3 are a subset of the first images corresponding to the third object.
[0131] S2013, for each of the at least one subset of first images obtained, set the corresponding first label.
[0132] Assuming a video contains multiple objects, a first subset of images can be obtained for each object. This first subset of images includes multiple images, and then the same first tag can be set for the multiple images corresponding to each object.
[0133] S2014, Based on at least one subset of first images and the corresponding first tags, generate a set of first images corresponding to the video.
[0134] In this step, multiple subsets of first images carrying the first tag are aggregated together to obtain the first image set corresponding to the aforementioned video.
[0135] Figure 9 The specific implementation process of S2011 to S2014 above is shown.
[0136] like Figure 9 As shown, taking the face as an example, for an input video, keyframe extraction is performed to obtain multiple keyframes, which are... Figure 7 The process involves extracting multiple independent frames and processing them frame by frame. Face detection is performed on each independent frame to identify the independent frames containing faces, thereby obtaining multiple images containing faces. Then, facial features are extracted from the obtained images to obtain the facial features of each image, which can be specifically represented as a feature vector.
[0137] Furthermore, the feature vectors belonging to the same tracking sequence among the multiple feature vectors obtained by the face tracking algorithm are aggregated to obtain multiple aggregated feature vector subsequences (which can be understood as the first feature subsequence mentioned above). Then, the multiple feature vector subsequences are clustered to obtain multiple feature vector sequences (which can be understood as the first feature sequence mentioned above). Each feature vector sequence corresponds to a face cluster (i.e., multiple images containing faces), thus obtaining face cluster 0, face cluster 1, ..., face cluster n.
[0138] In this embodiment of the application, since the number of objects appearing in a single video is limited, clustering multiple facial images in a single video has a high clustering accuracy. Therefore, it is possible to accurately obtain different facial images of the same object in a single video.
[0139] Furthermore, by using facial tracking algorithms to track multiple facial images in a single video, various facial images on the same tracking sequence can be aggregated together. Then, when clustering the aggregated facial images, clustering results can be obtained quickly and accurately.
[0140] The following is combined Figures 10-12 The process of clustering object part features for all images obtained from multiple videos is described in detail in the embodiments of this application.
[0141] In some embodiments, such as Figure 10 As shown, S202 above performs object part feature clustering processing on each image in the obtained multiple first image sets to obtain multiple second image sets, which may include the following steps:
[0142] S2021, extract the features of the second object part of each image respectively.
[0143] In the above embodiments of this application, for each of all images, a corresponding first object part feature is extracted. In this step, the second object part feature of each image can be directly adopted from the first object part feature corresponding to that image, or it can be a newly extracted object part feature. This application embodiment does not limit this.
[0144] S2022, the k-nearest neighbor algorithm is used to cluster the extracted features of each second object part to obtain multiple second feature sequences, each of which contains the same multiple features of the second object parts.
[0145] In an optional implementation, S2022 uses the k-nearest neighbor algorithm to cluster the extracted features of each second object part to obtain multiple second feature sequences, which may include the following steps:
[0146] A. Use the k-nearest neighbor algorithm to construct a k-nearest neighbor graph for the features of each second object part.
[0147] Specifically, such as Figure 11As shown, after obtaining the second object part features of each image, each second object part feature is treated as a graph node. Based on the clustering results of each video, multiple images belonging to the same category (i.e., the same object) in each video can be identified, thus obtaining a set of images corresponding to multiple categories in multiple videos. Based on this, a graph node is obtained from the multiple graph nodes corresponding to multiple second object part features, and the distance between this graph node and other graph nodes is calculated. Then, the k graph nodes closest to this graph node are recorded. Finally, the category to which most of the k graph nodes belong is selected as the category of this graph node. At the same time, this graph node is connected to its k nearest neighbors to construct a k-nearest neighbor graph. The value of k can be set as needed and is not limited here.
[0148] B. In the k-nearest neighbor graph, multiple graph nodes belonging to the same category are pruned to obtain multiple second feature sequences; where each graph node represents a second object part feature.
[0149] For example, such as Figure 11 As shown, the k-nearest neighbor graph includes graph nodes of four categories: category 1, category 2, category 3, and category 4. Pruning the graph nodes of each of these four categories from the k-nearest neighbor graph yields a subgraph (containing multiple graph nodes) for each category. The multiple graph nodes contained in each category's subgraph form a second feature sequence. By assigning corresponding second labels to the multiple graph nodes of each category, for example... Figure 11 The numbers 1, 2, 3, and 4 in the graph can be used to determine the second label of all graph nodes, for example: [1, 2, 3, 1, 4, 3, 2, 2, 4, 1, 4, 3, 1, 1, 3, 4].
[0150] S2023, for multiple second feature sequences, perform the following operations respectively: based on multiple images corresponding to a second feature sequence, determine a corresponding second image set, and set a corresponding second label for a second image set.
[0151] Since each second feature sequence contains the same multiple second object part features, and each second object part feature corresponds to an image, multiple images can be determined based on each second feature sequence. The multiple images corresponding to each second feature sequence are taken as a set of second images for a category. Based on the second labels corresponding to the multiple graph nodes of each category, the second label of the second image set of each analogy can be determined.
[0152] For example, if multiple second feature sequences are second feature sequence 1, second feature sequence 2, and second feature sequence 3, then the multiple images corresponding to second feature sequence 1 constitute a set of second images for one category; the multiple images corresponding to second feature sequence 2 constitute a set of second images for another category; and the multiple images corresponding to second feature sequence 3 constitute a set of second images for yet another category.
[0153] The following is combined Figure 12 The data processing method provided in the embodiments of this application will be described by way of example.
[0154] like Figure 12 As shown, taking a face as the object and a facial image as the image containing the object as an example, the data processing method can specifically include the following steps:
[0155] First, acquire multiple videos;
[0156] Multiple videos can be obtained through legitimate channels, such as obtaining multiple videos from the internet with the permission of the video copyright holder or the people in the video, or through other legitimate channels; no restrictions are imposed here.
[0157] Second, each video is processed separately.
[0158] Specifically, videos 1, 2, ..., n are processed separately. Within each video, face detection and facial feature extraction are used to obtain multiple facial images and their respective facial features. Based on these features, a face tracking algorithm is used to aggregate the facial image sequences of each object appearing in the video. This ensures that within each video, all facial images in each facial image sequence belong to the same object. Furthermore, within each video, the aggregated facial image sequences are clustered to ensure that the multiple facial images corresponding to each object within each video are accurate.
[0159] Third, based on the second step, add a video-level tag to each object within each video. v ), obtain the corresponding video level tag for each video (l v A set of facial images, based on the set of facial images corresponding to multiple videos, is used to obtain videos with video-level tags (l v All facial images.
[0160] Wherein, the video level tag can be understood as the first tag in the above embodiments of this application, and the video level tag (l) is applied. vThe set of facial images can be understood as the first image set in the above embodiments of this application. This allows for the creation of a facial dataset with video-level labels. This labeling process does not require any manual intervention.
[0161] Fourth, for all facial images processed in step three, global clustering is used to cluster them, obtaining images with global labels (l g All facial images.
[0162] Wherein, the global tag can be understood as the second tag in the above embodiments of this application, and the global tag (l) is applied. g All facial images can be understood as a plurality of second image sets in the above embodiments of this application. Thus, a specific global label is assigned to each facial image. This labeling process does not require any object-oriented intervention.
[0163] Fifth, after obtaining the above-mentioned global tag (l) g After taking all facial images, use video-level tags (l) v ) for global tags (l g Iterative processing is performed.
[0164] Because video-level tags are more accurate than global tags, thus, after video-level tagging (l v ) for global tags (l g Iteration can correct global labels that are incorrect during global clustering.
[0165] Sixth, after step five, each facial image can be given a unique label.
[0166] The unique tag can be understood as the target tag in the above embodiments of this application. All facial images with a unique tag can be placed in the same folder. Specifically, multiple facial images with the same unique tag can be placed in the same directory under the same folder.
[0167] Furthermore, the aforementioned folder can be sent to the annotation system, where an object engineer can inspect all facial images within that folder to remove noisy images, ultimately obtaining an accurate facial sample dataset.
[0168] Through the above steps, a large number of facial images can be collected quickly and accurately, and the labels of each facial image can be determined, thereby improving the collection efficiency and accuracy of facial sample data. Thus, by using the facial sample dataset obtained in this application embodiment to train the object face recognition model, the recognition accuracy of the trained object face recognition model can be improved.
[0169] Based on the same inventive concept as the above-described method embodiments, this application also provides a data processing device. The principle of this device in solving the problem is similar to that of the above-described method. Therefore, the implementation of this device can refer to the implementation of the above-described method, and repeated details will not be described again.
[0170] refer to Figure 13 As shown in the embodiment of this application, a data processing device includes a local clustering module 131, a global clustering module 132, a label determination module 133, and a sample generation module 134.
[0171] The local clustering module 131 is used to acquire multiple videos to be processed, and to perform object part detection processing on the multiple videos respectively, so as to obtain a first image set corresponding to each of the multiple videos, which contains the object part; wherein, the object part is used to uniquely identify the object, and different images containing the same object in the same first image set are set with the same first label.
[0172] The global clustering module 132 is used to perform object part feature clustering processing on each image in the multiple first image sets to obtain multiple second image sets; wherein each image in the same second image set is set with the same second label;
[0173] The label determination module 133 is used to determine the target label of each image based on the first and second labels associated with each image; wherein different images containing the same object have the same target label.
[0174] The sample generation module 134 is used to generate a sample dataset of object parts based on the obtained images and their corresponding target labels.
[0175] In this embodiment, the local clustering module 131 detects and processes the images in each video, accurately obtaining multiple images corresponding to the same object in each video, and assigns the same first label to the multiple images of the same object, thereby obtaining a first image set corresponding to each video. Then, the global clustering module 132 clusters all images in multiple videos again to obtain multiple second image sets, each with a corresponding second label. Then, the label determination module 133 uses the first label of all images to verify the second label of all images, thereby further accurately obtaining different images of the same object in all images, and assigning the same target label to the different images of the same object.
[0176] In this way, a large number of images can be collected quickly and accurately, and the labels of each image can be determined, which improves the collection efficiency and accuracy of object part sample data. Thus, by using the object part sample dataset obtained in the embodiments of this application to train the object part recognition model, the recognition accuracy of the trained object part recognition model can be improved.
[0177] In one possible embodiment, the local clustering module 131 is further configured to:
[0178] For multiple videos, perform the following operations respectively:
[0179] Extract multiple frames of images from a video, and perform object part detection on each frame to obtain multiple images containing the object parts;
[0180] Extract the first object part features from each of the multiple images, and perform clustering processing on the multiple first object part features to obtain at least one first image subset corresponding to each object.
[0181] For each of the at least one subset of first images obtained, a corresponding first label is set;
[0182] Generate a first image set corresponding to a video based on at least one subset of first images and their corresponding first tags.
[0183] In one possible embodiment, when clustering multiple images based on the obtained multiple first object part features to obtain at least one first image subset corresponding to each object, the local clustering module 131 is further configured to:
[0184] The object part tracking algorithm is used to aggregate adjacent and identical first object part features from multiple first object part features to obtain multiple aggregated first feature subsequences.
[0185] Clustering is performed on multiple first feature subsequences to obtain at least one first feature sequence, and each first feature sequence contains the same multiple first object part features;
[0186] For at least one first feature sequence, perform the following operations respectively: Based on multiple images corresponding to a first feature sequence, determine the first image subset corresponding to a specific object.
[0187] In one possible embodiment, the global clustering module 132 is further configured to:
[0188] Extract the features of the second object part from each image separately;
[0189] The k-nearest neighbor algorithm is used to cluster the extracted features of each second object part to obtain multiple second feature sequences, each of which contains the same multiple features of the second object parts.
[0190] For multiple second feature sequences, perform the following operations respectively: based on multiple images corresponding to a second feature sequence, determine a corresponding second image set, and set a corresponding second label for a second image set.
[0191] In one possible embodiment, when the k-nearest neighbor algorithm is used to cluster the extracted features of each second object part to obtain multiple second feature sequences, the global clustering module 132 is further used for:
[0192] The k-nearest neighbor algorithm is used to construct a k-nearest neighbor graph for the features of each second object part;
[0193] In the k-nearest neighbor graph, multiple graph nodes belonging to the same category are pruned to obtain multiple second feature sequences; where each graph node represents a second object part feature.
[0194] In one possible embodiment, the tag determination module 133 is further configured to:
[0195] When two images are identified that have the same first label and different second labels, the same target label is set for the two images.
[0196] When it is determined that two images in each set have the same second label, the same target label is set for the two images.
[0197] In one possible embodiment, the sample generation module 134 is further configured to:
[0198] Each image is divided into multiple third image sets; within the same third image set, each image has the same target label.
[0199] Generate a dataset of sample parts of an object based on multiple sets of third-party images.
[0200] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this application, the functions of each module (or unit) can be implemented in one or more software or hardware components.
[0201] Having introduced the data processing method and apparatus according to exemplary embodiments of this application, we will now introduce a data processing apparatus according to another exemplary embodiment of this application.
[0202] Those skilled in the art will understand that various aspects of this application can be implemented as systems, methods, or program products. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."
[0203] In some possible implementations, the data processing apparatus according to this application may include at least a processor and a memory. The memory stores program code that, when executed by the processor, causes the processor to perform the steps of the data processing methods according to various exemplary embodiments of this application described in this specification. For example, the processor may perform actions such as... Figure 2 The steps are shown in the figure.
[0204] After introducing the data processing method and apparatus according to exemplary embodiments of this application, an electronic device according to another exemplary embodiment of this application will be described next.
[0205] Based on the same inventive concept as the above-described method embodiments, this application also provides an electronic device. The principle of this electronic device in solving the problem is similar to that of the above-described method. Therefore, the implementation of this electronic device can refer to the implementation of the above-described method, and repeated details will not be described again.
[0206] See Figure 14 As shown, the electronic device 140 may include at least a processor 141 and a memory 142. The memory 142 stores program code, which, when executed by the processor 141, causes the processor 141 to perform the steps in any of the above-described data processing methods.
[0207] In some possible implementations, the electronic device according to this application may include at least one processor and at least one memory. The memory stores program code that, when executed by the processor, causes the processor to perform the steps of the data processing methods described above according to various exemplary embodiments of this application. For example, the processor may perform actions such as... Figure 2 The steps are shown in the figure.
[0208] In an exemplary embodiment, this application also provides a storage medium including program code, such as a memory 142 including program code, which can be executed by a processor 141 of an electronic device 140 to complete the above-described data processing method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0209] The following reference Figure 15 To describe an electronic device 150 according to this embodiment of the present application. Figure 15 The electronic device 150 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0210] like Figure 15 The electronic device 150 is manifested in the form of a general electronic device. The components of the electronic device 150 may include, but are not limited to: at least one processing unit 151, at least one storage unit 152, and a bus 153 connecting different system components (including storage unit 152 and processing unit 151).
[0211] Bus 153 represents one or more of several bus structures, including a memory bus or memory controller, peripheral bus, processor, or local bus using any of the various bus structures.
[0212] Storage unit 152 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1521 and / or cache storage unit 1522, and may further include read-only memory (ROM) 1523.
[0213] Storage unit 152 may also include a program / utility 1525 having a set (at least one) program module 1524, such program module 1524 including but not limited to: operating system, one or more application programs, other program modules and program data, each of these examples or some combination of these may include an implementation of a network environment.
[0214] Electronic device 150 can also communicate with one or more external devices 154 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with electronic device 150, and / or with any device that enables electronic device 150 to communicate with one or more other electronic devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 155. Furthermore, electronic device 150 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 156. As shown, network adapter 156 communicates with other modules used in electronic device 150 via bus 153. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 150, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0215] In some possible implementations, various aspects of the data processing methods provided in this application can also be implemented as a program product, which includes program code. When the program product is run on an electronic device, the program code causes the electronic device to perform the steps of the data processing methods according to the various exemplary embodiments of this application described above. For example, the electronic device can perform actions such as... Figure 2 The steps are shown in the figure.
[0216] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0217] The program product of the embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a computing device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with a command execution system, apparatus, or device.
[0218] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with a command execution system, apparatus, or device.
[0219] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0220] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0221] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0222] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0223] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0224] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0225] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data processing method, characterized by, The method comprises the following steps: obtaining a plurality of videos to be processed, and performing object part detection processing on the plurality of videos respectively to obtain a plurality of first picture sets respectively corresponding to the plurality of videos and containing object parts; wherein the object part is used to uniquely identify an object, and different pictures containing the same object in the same first picture set are provided with the same first label; performing object part feature clustering processing on each picture contained in the obtained plurality of first picture sets to obtain a plurality of second picture sets; wherein each picture in the same second picture set is provided with the same second label; determining the target label of each picture based on the first label and the second label respectively associated with each picture; wherein different pictures containing the same object have the same target label; generating an object part sample data set based on the obtained pictures and the corresponding target labels.
2. The method of claim 1, wherein, The method comprises the following steps: for the plurality of videos, the following operations are performed respectively: extracting a plurality of pictures in a video, and performing object part detection on the plurality of pictures respectively to obtain a plurality of pictures containing object parts; extracting the first object part feature of each of the plurality of pictures respectively, and performing clustering processing on the plurality of pictures based on the obtained plurality of first object part features to obtain at least one first picture subset respectively corresponding to an object; for the obtained at least one first picture subset, a corresponding first label is set respectively; generating a first picture set corresponding to the video based on the at least one first picture subset and the corresponding target label.
3. The method of claim 2, wherein, The method comprises the following steps: by means of an object part tracking algorithm, adjacent and same first object part features in the plurality of first object part features are aggregated to obtain a plurality of first feature sub-sequences after aggregation; performing clustering processing on the plurality of first feature sub-sequences to obtain at least one first feature sequence, each first feature sequence containing the same plurality of first object part features; for the at least one first feature sequence, the following operations are performed respectively: based on the plurality of pictures corresponding to a first feature sequence, a first picture subset corresponding to a corresponding object is determined.
4. The method according to any one of claims 1 to 3, characterized in that, The method comprises the following steps: extracting the second object part feature of each of the pictures respectively; performing clustering processing on the extracted plurality of second object part features by means of a k-nearest neighbor algorithm to obtain a plurality of second feature sequences, each second feature sequence containing the same plurality of second object part features; for the plurality of second feature sequences, the following operations are performed respectively: based on the plurality of pictures corresponding to a second feature sequence, a corresponding second picture set is determined, and a corresponding second label is set for the second picture set.
5. The method of claim 4, wherein, The k-neighbor algorithm is used to cluster the extracted second object part features, and a plurality of second feature sequences are obtained, including: The k-neighbor algorithm is used to construct a k-neighbor graph for the second object part features. In the k-neighbor graph, a plurality of graph nodes belonging to the same category are pruned to obtain the plurality of second feature sequences, wherein each graph node represents a second object part feature.
6. The method according to any one of claims 1 to 3, characterized in that, Based on the obtained first label and second label associated with each picture, the target label of each picture is determined, including: When it is determined that two pictures in the plurality of pictures have the same first label and different second labels, the same target label is set for the two pictures; When it is determined that two pictures in the plurality of pictures have the same second label, the same target label is set for the two pictures.
7. The method according to any one of claims 1 to 3, characterized in that, Based on the obtained pictures and corresponding target labels, an object part sample data set is generated, including: The plurality of pictures are divided into a plurality of third picture sets; wherein in the same third picture set, each picture has the same target label; According to the plurality of third picture sets, the object part sample data set is generated.
8. A data processing apparatus, characterized by, It includes: A local clustering module is configured to obtain a plurality of videos to be processed, and perform object part detection on the plurality of videos respectively to obtain a first picture set corresponding to each of the plurality of videos, wherein the object part is used to uniquely identify an object, and different pictures containing the same object in the same first picture set are set with the same first label. A global clustering module is configured to perform object part feature clustering on each picture contained in the plurality of obtained first picture sets to obtain a plurality of second picture sets, wherein each picture in the same second picture set is set with the same second label. A label determination module is configured to determine a target label of each picture based on the first label and the second label associated with each picture, wherein different pictures containing the same object have the same target label. A sample generation module is configured to generate an object part sample data set based on the obtained pictures and corresponding target labels.
9. The apparatus of claim 8, wherein, The local clustering module is further configured to: For the plurality of videos, the following operations are performed respectively: Extract a plurality of frames of pictures in a video, and perform object part detection on the plurality of frames of pictures to obtain a plurality of pictures containing object parts; Extract first object part features of the plurality of pictures respectively, and perform clustering on the plurality of pictures based on the obtained plurality of first object part features to obtain at least one first picture subset corresponding to each object; For the obtained at least one first picture subset, a corresponding first label is set; Based on the at least one first picture subset and the corresponding first label, a first picture set corresponding to the video is generated.
10. The apparatus of claim 9, wherein, When the plurality of pictures are clustered based on the obtained plurality of first object part features to obtain at least one first picture subset corresponding to each object, the local clustering module is further configured to: The object part tracking algorithm is used to aggregate adjacent and same first object part features in the plurality of first object part features, to obtain a plurality of first feature sub-sequences after aggregation; The plurality of first feature sub-sequences are clustered to obtain at least one first feature sequence, each first feature sequence containing a plurality of same first object part features; For the at least one first feature sequence, the following operations are respectively performed: based on a plurality of pictures corresponding to one first feature sequence, a first picture subset corresponding to a corresponding object is determined.
11. The apparatus of any one of claims 8 to 10, wherein, The global clustering module is further configured to: extract respective second object part features of the respective pictures; cluster the extracted respective second object part features using a k-nearest neighbor algorithm to obtain a plurality of second feature sequences, each second feature sequence containing a plurality of same second object part features; For the plurality of second feature sequences, the following operations are respectively performed: based on a plurality of pictures corresponding to one second feature sequence, a corresponding second picture set is determined, and a corresponding second label is set for the second picture set.
12. The apparatus of claim 11, wherein, When the k-nearest neighbor algorithm is used to cluster the extracted respective second object part features to obtain a plurality of second feature sequences, the global clustering module is further configured to: construct a k-nearest neighbor graph using the k-nearest neighbor algorithm on the respective second object part features; In the k-nearest neighbor graph, a plurality of nodes belonging to the same category are pruned to obtain the plurality of second feature sequences; wherein each node represents a second object part feature.
13. An electronic device, comprising: It includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of any one of the methods of claims 1-7.
14. A computer-readable storage medium, characterized in that, It includes program code, and when the program code runs on an electronic device, the program code is used to make the electronic device execute the steps of any one of the methods of claims 1-7.
15. A computer program product, characterised in that, It includes computer instructions stored in a computer readable storage medium; when the processor of an electronic device reads the computer instructions from the computer readable storage medium, the processor executes the computer instructions, so that the electronic device executes the steps of any one of the methods of claims 1-7.
Citation Information
Patent Citations
Video labeling method and system based on image clustering and electronic equipment
CN109829397A
Video clustering method and device thereof
CN113515668A