Image processing method and related equipment
By segmenting the image and scoring multiple text pairs, the problem that image quality assessment cannot be reflected in a fine-grained manner in the existing technology is solved, a detailed assessment and accurate scoring of the quality of the image area is achieved, and the stability and accuracy of the assessment are improved.
Patent Information
- Application Number
- CN202410616355.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-17
AI Technical Summary
Existing image quality assessment methods cannot comprehensively and accurately reflect fine-grained defects in images, especially the quality differences in different areas, resulting in inaccurate assessment results.
By segmenting the image, the scoring model is used to extract and score features of each regional image, multiple pairs of text pairs are set up to achieve fine-grained scoring, and the scoring results are adjusted according to the weight of the text pairs to increase the stability and accuracy of the evaluation.
It achieves detailed quality assessment of each area of the image, accurately identifies problems existing in the image and defects in the evaluation indicators, and improves the stability and accuracy of image quality assessment.
Smart Images

Figure CN118212231B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and related equipment. Background Art
[0002] With the development of image processing technology, image quality assessment has become an important technical requirement. For example, image quality assessment is performed on images taken by a device so that the device can be optimized based on the quality assessment results. Existing image quality assessment methods usually assess the overall quality of the entire image. However, the assessment of the overall quality of the entire image cannot fully and accurately reflect the defects in the image. Summary of the invention
[0003] The present application provides an image processing method and related equipment to solve the problems of increased computing power and increased power consumption during the rendering process.
[0004] A first aspect provides an image processing method, which is applied to an electronic device. The electronic device includes a scoring model, and the scoring model includes an image encoder. The method includes: performing image segmentation on a first image to obtain various regional images; performing feature extraction on each regional image based on the image encoder to obtain a first image feature vector corresponding to each regional image; obtaining a text feature vector corresponding to a text pair, wherein the number of text pairs corresponding to the same evaluation index is one or more pairs; obtaining a total similarity score corresponding to the text pair based on the similarity between the first image feature vector and the text feature vector; for any evaluation index, obtaining an evaluation score of the regional image with respect to the evaluation index based on the weight of the text pair in the evaluation index and the corresponding total similarity score; and obtaining a processing result of the first image based on the evaluation score of each regional image.
[0005] In an embodiment of the present application, the image to be processed is segmented to obtain each regional image, and then each regional image is scored in a fine-grained manner through text pairs and scoring models. The text pairs for the same dimension (evaluation index) may include one or more pairs, so that the text pairs can be used to achieve accurate scoring of regional images. The score is further adjusted based on the weight of the text pair, which increases the stability and accuracy of the quality assessment. In this way, each evaluation index of each regional image of the image is scored, and subsequently, the problems in the image can be comprehensively and accurately found out based on the evaluation scores of each regional image on each evaluation index, such as finding out the area with problems in the image and which evaluation index problems exist in the area.
[0006] A possible implementation method is that there is at least one evaluation index corresponding to multiple pairs of text pairs, the weights of the text pairs in the evaluation index include L weights corresponding to the L pairs of text pairs, the L pairs of text pairs correspond to the same first target evaluation index, and L is an integer greater than or equal to 2; according to the similarity between the first image feature vector and the text feature vector, obtaining the total similarity score corresponding to the text pair includes: according to the similarity between the first image feature vector and the text feature vector corresponding to the L pairs of text pairs, obtaining L total similarity scores corresponding to the L pairs of text pairs; according to the weights of the text pairs in the evaluation index and the corresponding total similarity scores, obtaining the evaluation score of the regional image with respect to the evaluation index includes: performing weighted summation of the L total similarity scores and the L weights to obtain the evaluation score of the regional image with respect to the first target evaluation index.
[0007] In the embodiment of the present application, multiple text pairs are set as evaluation indicators to fully utilize the multiple text pairs to achieve scoring of the regional image, and corresponding weights are configured for each text pair to increase the reliability and accuracy of the scoring.
[0008] In a possible implementation, the evaluation index includes an overall evaluation index and an image parameter index, and the text feature vector includes a first text feature vector corresponding to the image parameter index and a second text feature vector corresponding to the overall evaluation index; extracting features from each region image based on the image encoder includes: extracting features from each region image and the first image based on the image encoder to obtain a first image feature vector corresponding to each region image and a second image feature vector corresponding to the first image; obtaining a total similarity score corresponding to the text pair based on the similarity between the first image feature vector and the first text feature vector; obtaining a corresponding first total similarity score based on the weight and the text pair in the evaluation index. Corresponding total similarity scores, obtaining the evaluation scores of the regional images with respect to the evaluation indexes includes: obtaining the first evaluation scores of the regional images with respect to the image parameter indexes according to the weights of the text pairs in the image parameter indexes and the corresponding first total similarity scores; obtaining the processing results of the first image according to the evaluation scores of the respective regional images includes: for each regional image, obtaining the corresponding second total similarity score according to the similarity between the first image feature vector and the second text feature vector; obtaining the regional total score according to the first evaluation scores and the second total similarity scores of the respective regional images; obtaining the third total similarity score of the first image according to the similarity between the second image feature vector and the second text feature vector; obtaining the total score of the first image according to the third total similarity score and the regional total score.
[0009] In an embodiment of the present application, the quality of the first image is evaluated, and full consideration is given to the overall performance of the first image and the overall performance of each regional image in the first image as well as the performance of the regional images in various image parameter indicators, thereby comprehensively and accurately reflecting the problems existing in the image.
[0010] A possible implementation method is to obtain a regional total score based on the first evaluation score and the second total similarity score of each regional image, including: obtaining a parameter weight of an image parameter indicator; obtaining a first regional score of the regional image based on the parameter weight of the image parameter indicator and the first evaluation score of the regional image with respect to the image parameter indicator; obtaining a second regional score of the regional image based on the first regional score and the second total similarity score of the regional image; and obtaining a regional total score based on the second regional scores of each regional image.
[0011] In an embodiment of the present application, when evaluating the performance of the regional image in each image parameter indicator, a corresponding parameter weight is also set for each image parameter indicator, so that the parameter weight can be adjusted in the future according to scene requirements or user input, so that the total score is biased towards the corresponding image parameter indicator, thereby realizing personalized evaluation.
[0012] A possible implementation method is to obtain a first regional score of a regional image based on a parameter weight of an image parameter index and a first evaluation score of the regional image with respect to the image parameter index, including: performing weighted summation on the parameter weight of the image parameter index and the first evaluation score of the regional image with respect to the image parameter index to obtain the first regional score of the regional image; to obtain a second regional score of the regional image based on the first regional score and the second total similarity score of the regional image, including: adding the first regional score of the regional image to the second total similarity score to obtain the second regional score of the regional image; and to obtain a regional total score based on the second regional scores of each regional image, including: obtaining a regional weight of each regional image; and performing weighted summation on the regional weight and the second regional score of each regional image to obtain a regional total score.
[0013] In an embodiment of the present application, when evaluating the performance of a regional image in various image parameter indicators, a corresponding regional weight is also set for each regional image label, so that the regional weight can be adjusted in the future according to scene requirements or user input, so that the total score is biased towards the corresponding regional image, thereby achieving personalized evaluation.
[0014] A possible implementation method is to obtain the total score of the first image based on the third total similarity score and the regional total score of the first image, including: obtaining the overall weight and the partial weight; performing weighted calculation on the overall weight and the third total similarity score to obtain a first weighted score; performing weighted calculation on the partial weight and the regional total score to obtain a second weighted score; and obtaining the total score of the first image based on the first weighted score and the second weighted score.
[0015] In an embodiment of the present application, when performing quality assessment on the first image, overall weights and partial weights are also set, so that according to subsequent scene requirements or user input, the overall or regional focus can be determined to achieve personalized assessment.
[0016] In a possible implementation, the method further includes: obtaining initial weights of P pairs of text, where P is an integer greater than or equal to 2, and the P pairs of text correspond to the same second target evaluation index; obtaining a first training image and a second training image, wherein the second target evaluation index of the first training image is better than that of the second training image; obtaining an evaluation score of the first training image with respect to the second target evaluation index based on the initial weights of the first training image and the P pairs of text; obtaining an evaluation score of the second training image with respect to the second target evaluation index based on the initial weights of the second training image and the P pairs of text; obtaining a first difference based on a difference between the evaluation scores of the first training image and the second training image with respect to the second target evaluation index; obtaining a first annotation score of the first training image and a second annotation score of the second training image, both of which are related to the second target evaluation index; obtaining a second difference based on the difference between the first annotation score and the second annotation score; constructing an objective function based on the first difference and the second difference; determining the optimal weight of the P pairs of text based on the objective function; and using the optimal weight of the P pairs of text as the weight of the text pair in the second target evaluation index.
[0017] In an embodiment of the present application, for any evaluation indicator including multiple text pairs, an optimal weight is set for each text pair in the evaluation indicator, so that based on the setting of the optimal weight, the scoring of the evaluation indicator by the multiple text pairs is more accurate and reliable.
[0018] In a possible implementation, the method further includes: performing image segmentation on the second image to obtain sub-images, wherein the shooting scenes of the first image and the second image are similar, and the first image and the second image are respectively taken by different electronic devices; determining a target sub-image that matches the regional image; and for any evaluation index, outputting a comparison result between the regional image and the target sub-image with respect to the evaluation index based on an evaluation score of the regional image with respect to the evaluation index and an evaluation score of the target sub-image with respect to the evaluation index.
[0019] In an embodiment of the present application, the quality of multiple images can be evaluated by the image processing method provided in the embodiment of the present application, and the defects existing in the multiple images can be determined more accurately subsequently.
[0020] In a possible implementation, the method further includes: obtaining a first input, the first input indicating intelligent deletion of K images of the electronic device, K being an integer greater than or equal to 2; in response to the first input, obtaining a total score of the K images; and deleting the remaining images of the K images except the target image, the target image having the highest total score.
[0021] In a possible implementation, the method also includes: obtaining a second input, the second input indicating that H images of the electronic device are to be deleted according to a target image parameter indicator, where H is an integer greater than or equal to 2; in response to the second input, obtaining a total score of the H images according to a parameter weight of the target image parameter indicator and parameter weights of other image parameter indicators, wherein the parameter weight of the target image parameter indicator is greater than the parameter weights of other image parameter indicators; and deleting the remaining images except the target image from the H images, where the target image has the highest total score.
[0022] In one possible implementation, the scoring model also includes a text encoder; obtaining a text feature vector corresponding to a text pair includes: obtaining an input text pair in response to a text input; and performing feature extraction on the input text pair based on the text encoder to obtain a text feature vector corresponding to the text pair.
[0023] In a possible implementation, the image parameter indicators include one or more of the following: noise, clarity, brightness, saturation, color cast, focus, contrast, sharpness, tonality, three-dimensional effect, and lighting effect.
[0024] The second aspect provides an electronic device, which includes one or more processors and one or more memories; the one or more memories are coupled to the one or more processors, and the one or more memories store computer instructions; when the one or more processors execute the computer instructions, the electronic device executes any one of the image processing methods above.
[0025] A third aspect provides a computer-readable storage medium, the computer-readable storage medium comprising computer instructions, and when the computer instructions are executed, any of the above image processing methods is executed.
[0026] A fourth aspect provides a chip system, which includes a processor and a communication interface; the processor is used to call and run a computer program stored in the storage medium from the storage medium to execute any of the image processing methods above.
[0027] In addition, the technical effects brought about by the second to fourth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0029] Figure 1A schematic diagram of an application scenario provided for an embodiment of the present application;
[0030] Figure 2 A schematic diagram of another application scenario provided for an embodiment of the present application;
[0031] Figure 3 A schematic diagram of an interface provided in an embodiment of the present application;
[0032] Figure 4 Another interface schematic diagram provided for an embodiment of the present application;
[0033] Figure 5 Another interface schematic diagram provided for an embodiment of the present application;
[0034] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0035] Figure 7 A schematic diagram of the scoring model structure provided in the embodiment of the present application;
[0036] Figure 8 A schematic diagram of another scoring model structure provided in an embodiment of the present application;
[0037] Fig. 9 A schematic diagram of a fine-tuning scoring model provided in an embodiment of the present application;
[0038] Fig.10 A schematic diagram of an image processing method provided in an embodiment of the present application;
[0039] Fig.11 A schematic diagram of another image processing method provided in an embodiment of the present application;
[0040] Fig.12 A schematic diagram of a specific flow chart of step S705 provided in an embodiment of the present application;
[0041] Fig.13 A schematic diagram of a flow chart of a method for obtaining a total score of a first image provided in an embodiment of the present application;
[0042] Fig.14 A flow chart of a weight optimization method provided in an embodiment of the present application;
[0043] Fig.15 A schematic diagram of another image processing method provided in an embodiment of the present application;
[0044] Fig.16 A schematic diagram of another image processing method provided in an embodiment of the present application;
[0045] Fig.17A schematic diagram of another image processing method provided in an embodiment of the present application;
[0046] Fig.18 A schematic diagram of a method for calculating evaluation points provided in an embodiment of the present application;
[0047] Fig.19 A schematic diagram of a chip system structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In this article, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprising a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0049] In this application, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0050] As mentioned above, the existing image quality assessment method usually assesses the overall quality of the entire image. When implementing the embodiments of the present application, the inventors found that the problems (defects) existing in different areas of the image are not the same. For example, in a selfie image of a person, there is a lot of noise in the background area, while the noise in the foreground area is almost negligible. Therefore, only evaluating the image as a whole, the overall quality assessment obtained obviously cannot fully and accurately reflect the problems existing in the image.
[0051] In view of this, the embodiments of the present application provide an image processing method, a device, a storage medium and a chip system, which perform image segmentation on the image to be processed to obtain each regional image, and then perform fine-grained scoring on each regional image through text pairs and scoring models. The text pairs for the same dimension (evaluation index) may include one or more pairs, so that the text pairs can be used to achieve accurate scoring of regional images. The score is further adjusted based on the weight of the text pair, which increases the stability and accuracy of the quality assessment. In this way, each evaluation index of each regional image of the image is scored, and subsequently, according to the evaluation score of each regional image on each evaluation index, the problems in the image can be comprehensively and accurately found, such as finding the area with problems in the image and which evaluation index problems exist in the area.
[0052] In the embodiment of the present application, the evaluation index may include but is not limited to: an overall evaluation index and an image parameter index. The overall evaluation index is used to analyze the overall quality of the image. The image parameter index is used to analyze the quality of the image parameters of the image. The image parameter index may include but is not limited to: a noise index, a clarity index, a brightness index, a saturation index, a color cast index, a focus index, a contrast index, a sharpness index, a tone index, a three-dimensional effect index, and a light effect index.
[0053] Among them, the noise index is used to analyze the image's performance in terms of noise. The clarity index is used to analyze the image's performance in terms of clarity. The brightness index is used to analyze the image's performance in terms of brightness. The saturation index is used to analyze the image's performance in terms of saturation. The color cast index is used to analyze the image's performance in terms of color cast. The focus index is used to analyze the image's performance in terms of focus. The contrast index is used to analyze the image's performance in terms of contrast. The sharpness index is used to analyze the image's performance in terms of sharpness. The tone index is used to analyze the image's performance in terms of tone. The 3D effect index is used to analyze the image's performance in terms of 3D effect. The light effect index is used to analyze the image's performance in terms of light effect.
[0054] In an embodiment of the present application, the overall performance of an image can be predicted based on an overall evaluation text pair, and the score of the image with respect to the overall evaluation index can be obtained. The overall evaluation text pair can be, for example, ['Good photo.', 'Bad photo.']. The image parameter performance of an image can be predicted based on a parameter evaluation text pair, and the score of the image with respect to the image parameter index can be obtained. For example, the noise performance of an image can be predicted based on a noise evaluation text pair, and the clarity of an image can be predicted based on a clarity evaluation text pair. The noise evaluation text pair can be, for example, ['Clean photo', 'Noisy photo']. The relevant content of the text pair will be described in detail below.
[0055] See also Figure 1, an application scenario of the image processing method of an embodiment of the present application is introduced by way of example.
[0056] Take the electronic device 100 as a computer as an example. The image output effect of device A (not shown) is better than that of device B (not shown). The user controls device A and device B to shoot the same shooting scene at the same time, and obtains image 10a shot by device A and image 20a shot by device B. The shooting scenes shot by image 10a and image 20a are similar or consistent, and the shooting time is close or consistent. When evaluating the quality of image 10a and image 20a, the image shot by the device with good image output effect can be used as a reference image to find out the problems in the other image. The electronic device 100 can default to the first image input as the reference image.
[0057] The user can preferentially input image 10a into the electronic device 100, and then input image 20a into the electronic device 100, and control the electronic device 100 to run the image processing method provided in the embodiment of the present application to find out the problems existing in image 20a (the second image) relative to image 10a (the first image).
[0058] The electronic device 100 runs the image processing method provided in the embodiment of the present application, performs image segmentation on the image 10a and the image 20a, and obtains the regional images of the image 10a and the image 20a respectively. For example, a sunset region image, a cloud region image, a mountain region image, and a sea region image are obtained. The regional images of the image 10a and the image 20a are matched. For example, the sunset region image of the image 10a matches the sunset region image of the image 20a, the cloud region image of the image 10a matches the cloud region image of the image 20a, and so on. The electronic device 100 scores the two matched regional images from each evaluation index, and the scores are normalized to obtain the scores of each regional image on each evaluation index. When the score of a regional image in the matched regional images is lower than the preset threshold of the score of the other regional image, it is considered that the low-scoring regional image has a problem on the evaluation index. The preset threshold can be a percentage, such as 70%, 80% or 90%, and the preset threshold can be set according to the actual situation, and the present application does not make specific restrictions on this.
[0059] For example, the scores are uniformly normalized to between 0 and 1, the maximum score is 1, the minimum score is 0, the cloud region image of image 10a scores 0.9 on the noise evaluation index, the cloud region image of image 20a scores 0.5 on the noise evaluation index, and the preset threshold is 80%. Based on 0.5<0.9*80%, it can be concluded that "the cloud region image of image 20a has high noise". By analogy, the comparison results of all matching region images on various evaluation indicators can be determined.
[0060] The diagnostic result interface 101 of the electronic device 100 displays the comparison results (or existing problems) of all matching regional images on the second image (image 20a) with respect to various evaluation indicators. Figure 1 As shown, the following information is displayed on the diagnostic result interface 101 of the electronic device 100:
[0061] Diagnosis
[0062] Second picture
[0063] Box0: Clouds, [Box0 xxxx], high noise, low definition
[0064] Box1: Sunset, [Box1 xxxx], low saturation, high brightness
[0065] Box2: Sea, [Box2 xxxx], purple, low brightness
[0066] Box3: Mountain, [Box3 xxxx], low contrast
[0067] Among them, [Box0 xxxx], [Box1 xxxx], [Box2 xxxx] and [Box3 xxxx] respectively correspond to the box information of the cloud area image (Box0), the sunset area image (Box1), the sea area image (Box2) and the mountain area image (Box3), such as position coordinates, size, etc.
[0068] “Box0: Clouds, [Box0 xxxx], high noise, low clarity” can be understood as the noise of the cloud region image in the second image is higher than that of the cloud region image in the first image and the clarity of the cloud region image in the second image is lower than that of the cloud region image in the first image. It can also be understood as the scores of the noise evaluation index and the clarity evaluation index of the cloud region image in the second image are both lower than the preset thresholds of the scores of the noise evaluation index and the clarity evaluation index of the cloud region image in the first image.
[0069] In the embodiment of the present application, the regional images of the first image and the second image can be compared based on the overall evaluation index and / or image parameter index, and the embodiment of the present application does not specifically limit this.
[0070] In the embodiment of the present application, the electronic device 100 compares the image 10a and the image 20a based on the overall evaluation index and / or the image parameter index.
[0071] The electronic device 100 can score the image 10a and the image 20a through the overall evaluation text, and obtain the scores of the image 10a and the image 20a on the overall evaluation index, and then the comparison result of the image 10a and the image 20a can be displayed on the diagnosis result interface 101 of the electronic device 100. For example, "image 10a is better than image 20a" or "image 10a is recommended" is output.
[0072] The electronic device 100 can score the images 10a and 20a using the overall evaluation text pair and the image parameter text pair to obtain the total scores of the images 10a and 20a, and then the comparison results of the images 10a and 20a can be displayed on the diagnostic result interface 101 of the electronic device 100.
[0073] The electronic device 100 can score image 10a and image 20a through image parameter text, obtain the scores of image 10a and image 20a regarding image parameter indicators, and output the comparison results of image 10a and image 20a on the diagnostic result interface 101 of the electronic device 100 based on the scores of image 10a and image 20a regarding image parameter indicators.
[0074] See also Figure 2 , exemplarily introduces another application scenario of the image processing method of an embodiment of the present application.
[0075] Image 10b and image 20b are images of people taken by two devices in the same scene and at similar times. The electronic device 100 scores image 10a according to various image parameter indicators, and scores image 20a according to various image parameter indicators, and obtains the scores of image 10a and image 20a for various image parameter indicators, and outputs the comparison results of image 10a and image 20a according to the scores of image 10a and image 20a for image parameter indicators.
[0076] like Figure 2 As shown, the following information is displayed on the diagnostic result interface 101 of the electronic device 100:
[0077] Diagnosis:
[0078] The second picture has the following problems compared to the first picture:
[0079] High noise, low definition, poor tonal effects, poor 3D effects, and poor lighting effects.
[0080] “Poor tonal effect, poor three-dimensional effect and poor lighting effect” can also be determined from the image depth, skin lighting, contour sense and lighting range of image 10b and image 20b. Image 10b has stronger image depth, skin lighting, contour sense and lighting range than image 20b, so image 20b looks more like a two-dimensional plane and its three-dimensional effect is obviously worse than that of image 10b.
[0081] Understandably, Figure 1 to Figure 2 In the scenario, the electronic device 100 can also output the information of the first image, that is, when the score of the first image or the regional image of the first image is lower than the preset threshold of the score of the second image, the defects of the first image or the regional image of the first image can also be output. Figure 1 to Figure 2 In the scenario, the electronic device 100 may also directly output all the scores, such as outputting the scores of the first image, the second image, and all the regional images.
[0082] Therefore, the image processing method provided in the embodiment of the present application can be used to compare the images taken by two devices (or multiple devices), and then the defects in the images taken by each device can be found, thereby establishing a solid and reliable foundation for subsequent device optimization.
[0083] See also Figures 3 to 5 , exemplarily introduces another application scenario of the image processing method of an embodiment of the present application.
[0084] like Figure 3 As shown, the electronic device 100 displays a setting interface 102, and the setting interface 102 includes a deletion setting control 103. The deletion setting control 103 can be used to instruct to rate multiple images in the electronic device 100, and then delete low-rated images.
[0085] In the embodiment of the present application, the user can specify multiple images to be deleted. For example, the user can first select multiple images to determine the selected multiple images as images to be deleted. The electronic device 100 scores the multiple images to be deleted specified by the user, and then deletes the low-scoring images.
[0086] In other embodiments, the electronic device 100 may default multiple similar images as images to be deleted, score the multiple similar images, and delete low-scoring images. The electronic device 100 may determine multiple similar images by the shooting time and the semantics of the captured images. For example, if there are 5 images in the gallery of the electronic device 100 whose shooting time differs by a preset time length, and the semantics of the 5 images are basically the same, such as all sunset images, then the 5 images can be considered similar images and grouped together.
[0087] The deletion setting control 103 can be set in the setting interface of the camera application, or in the setting interface of the gallery application, or can be set according to actual conditions, and this application does not make any specific limitation on this.
[0088] like Figure 4 As shown, the electronic device 100 displays a deletion setting interface 104 in response to an input to the deletion setting control 103. The deletion setting interface 104 includes a smart deletion control 105, a custom deletion control 106 and a text input box 107.
[0089] The intelligent deletion control 105 is used to trigger the electronic device 100 to intelligently delete multiple images to be deleted.
[0090] In the embodiment of the present application, intelligent deletion can comprehensively consider all evaluation indicators (such as overall evaluation indicators and image parameter indicators). In response to the input of the intelligent deletion control 105, the electronic device 100 calculates the total score of multiple images to be deleted according to the image processing method provided in the embodiment of the present application, retains the image with the highest total score, and deletes the remaining images.
[0091] In some embodiments, intelligent deletion can increase the regional weight of the key area image, thereby making the total score of the image biased towards the key area image, retaining the image with the highest total score, and deleting the remaining images.
[0092] Exemplarily, if the multiple images to be deleted all identify that the sunset area image is located in the middle of the image, and the area ratio of the sunset area image reaches a preset ratio value, then the key area image can be determined to be the sunset area image. Alternatively, if the image semantics of the multiple images to be deleted are all identified as sunset images, then the sunset area image can be used as the key area image. The total score of the image is calculated based on the area weight of the sunset area image and the area weights of other area images. The area weight of the sunset area image is greater than the area weights of other area images, so that the total score of the image pays more attention to the sunset area image.
[0093] In some embodiments, intelligent deletion may focus on overall quality, such as using overall evaluation text to rate multiple images to be deleted, obtaining image scores, retaining the image with the highest score, and deleting the remaining images.
[0094] The custom delete control 106 is used to trigger the electronic device 100 to perform selective deletion according to the selected image parameter index. The custom delete control 106 allows the user to select one or more image parameter indexes, and then selectively deletes the multiple images to be deleted according to the image parameter indexes selected by the user, such as retaining the image with the best image parameter index selected by the user among the multiple images to be deleted, and deleting the remaining images.
[0095] In an embodiment of the present application, the electronic device 100 can determine the parameter weights of each image parameter indicator based on the selected image parameter indicator, and then calculate the total score of the image based on the parameter weights of each image parameter indicator, retain the image with the highest total score among multiple images to be deleted, and delete the remaining images, where the parameter weight of the selected image parameter indicator is greater than the parameter weight of the unselected image parameter indicator.
[0096] In other embodiments, the electronic device 100 may score multiple images to be deleted based on the text of the selected image parameter indicators to obtain scores of the multiple images to be deleted regarding the selected image parameter indicators, retain the image with the highest score, and delete the remaining images.
[0097] like Figure 5 As shown, the electronic device 100 displays a custom deletion interface 108 in response to input to the custom deletion control 106, and the custom deletion interface 108 displays controls for various image parameter indicators, such as a noise control 108a, a clarity control 108b, a brightness control 108c, a saturation control 108d, a color cast control 108e, a focus control 108f, a contrast control 108g, a sharpness control 108h, a tone control 108i, a three-dimensional stereoscopic effect control 108j, and a lighting effect control 108k.
[0098] For example, Figure 5 As shown, the user opens the 3D stereo effect control 108j and the light effect control 108k. The electronic device 100 determines the parameter weights of each image parameter index in response to the input of the 3D stereo effect control 108j and the light effect control 108k, calculates the total score of the image according to the determined parameter weights, and finally retains the image with the highest total score and deletes the remaining images. The parameter weights of the 3D stereo effect index and the light effect index are greater than the parameter weights of the remaining image parameter indexes, so that the total scores of multiple images tend to the 3D stereo effect index and the light effect index, that is, the images with better 3D stereo effect and light effect are retained, and the remaining images are deleted.
[0099] The text input box 107 is used for the user to input text or text pairs, so as to perform personalized deletion according to the text or text pairs input by the user. The electronic device 100 can respond to the text input through the text input box, construct a text pair according to the text input by the user, and then score the multiple images to be deleted according to the constructed text pairs. The electronic device 100 can respond to the text pairs input through the text input box, obtain the text pairs input by the user, score the multiple images to be deleted according to the text pairs input by the user, retain the image with the highest score, and delete the remaining images.
[0100] Exemplarily, the user inputs "bright color" through the text input box 107, and the electronic device 100 constructs a text pair ['bright color', 'not bright color'] in response to the text "bright color" input by the user. The electronic device 100 scores the multiple images to be deleted according to the constructed text pair ['bright color', 'not bright color'], obtains the scores of the multiple images to be deleted with respect to the text pair ['bright color', 'not bright color'], retains the image with the highest score, and deletes the remaining images.
[0101] In other embodiments, when the electronic device 100 performs personalized deletion based on the text or text pair input by the user, it may also refer to other image parameter indicators and / or overall evaluation indicators to calculate the score of the image, except that the weight of the text or text pair input by the user is greater than that of other text pairs when calculating the score.
[0102] When performing intelligent deletion, custom deletion or personalized deletion, the image with the highest score may be retained or n images with the top n scores may be retained, where n is an integer greater than or equal to 2.
[0103] Therefore, through the image processing method provided in the embodiment of the present application, multiple images can be intelligently deleted, custom deleted, or personalized deleted. For example, when taking pictures, the user takes several pictures of a certain scene, such as the sunset, the beach, etc., but does not know which picture to keep after taking them, causing the mobile phone memory to be full quickly, and it is a pity to delete them all. Through the image processing method provided in the embodiment of the present application, the images of the same scene in the album are intelligently deleted, custom deleted, or personalized deleted, and the redundant pictures are deleted.
[0104] In an embodiment of the present application, in addition to scoring images, the image processing method provided in the embodiment of the present application can also be used for video scoring, scoring each frame image in the video, or scoring once every multiple frames of images, so that the total score of the video can be given.
[0105] Specifically, the filter can be applied after the user shoots the video, such as various short video platforms, and can also be used by the director after shooting the video to render the video in multiple ways, and select the best rendering method through the image processing method mentioned in the embodiment of the present application.
[0106] For example, for a certain video, two video filter effects are used, but the user wants to know which of the two filter effects is better. The image processing method mentioned in the embodiment of the present application can be used to score, so as to determine which video has a higher score, that is, which video has a better effect.
[0107] It can be understood that the image processing method provided in the embodiments of the present application can also be applied to different application scenarios, and the present application does not make any specific limitations on this.
[0108] In the embodiments of the present application, the electronic device may also be referred to as a terminal device, a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc.
[0109] The structure of the electronic device 100 is introduced below by taking the electronic device provided in the embodiment of the present application as a mobile phone as an example.
[0110] like Figure 6 As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a display screen 130, a camera 140, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, etc.
[0111] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0112] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0113] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0114] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, and / or a universal serial bus (USB) interface, etc.
[0115] The electronic device 100 implements the display function through a GPU, a display screen 130, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 130 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0116] The display screen 130 is used to display images, videos, etc. The display screen 130 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or W display screens 130, where W is a positive integer greater than 1.
[0117] The display screen 130 can be used to display Figure 1 to Figure 2 , Figures 3 to 5 User interface.
[0118] The electronic device 130 can realize the shooting function through the ISP, the camera 140, the video codec, the GPU, the display screen 130 and the application processor.
[0119] The ISP is used to process the data fed back by the camera 140. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 140.
[0120] The camera 140 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or Q cameras 140, where Q is a positive integer greater than 1.
[0121] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0122] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0123] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0124] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0125] The internal memory 121 may be used to store computer executable program codes, which may include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area.
[0126] The memory of the electronic device 100 (such as the internal memory 121 or the external memory card) can be used to store a shot type library, a scene type library, and a clipping rule library, which will be described in detail below.
[0127] In some embodiments, the electronic device 100 may further include a sensor module, an audio module, a speaker, a receiver, a microphone, and an earphone interface, and the audio function is implemented through the audio module, the speaker, the receiver, the microphone, the earphone interface, and the application processor, etc. For example, audio recording during video recording, etc.
[0128] It should be understood that Figure 6 The electronic device 100 shown is only an example, and the electronic device 100 may have more Figure 6 The more or less components shown in the figure can be combined with two or more components, or can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0129] In the embodiment of the present application, the electronic device 100 includes a scoring model. When the electronic device 100 executes the image processing method provided in the embodiment of the present application, the scoring model is used to score the image (whole image and / or regional image).
[0130] The scoring model provided in the embodiments of the present application may include but is not limited to a multimodal large model. A multimodal large model refers to a deep learning model that can process and understand data in multiple modalities, for example, these multiple modalities include but are not limited to text, images, audio, video, etc., and multiple modal data are associated, for example, text is a graphic type data associated with an image. The multimodal large model has the ability to convert text and images into vectors in a high-dimensional space.
[0131] The scoring model provided in the embodiment of the present application can be used for image quality assessment (Image Quality Assessment, IQA) using contrastive language-image pre-training (Contrastive Language-Image Pre-Training, CLIP), that is, the scoring model provided in the embodiment of the present application is a multimodal large model CLIP-IQA.
[0132] See also Figure 7 , exemplarily introduces a structure of a scoring model provided in an embodiment of the present application. The scoring model 200 includes an image encoder 201 , a text encoder 202 , a scoring module 203 and an output module 204 .
[0133] The image encoder 201 is used to extract features of the image to be evaluated for image quality and obtain a corresponding image feature vector. The image encoder 202 converts the image into a vector represented by numbers. For example, the device can use 128 numbers to represent a frame image, which can also be understood as using a 128-dimensional vector to represent the frame image. The 128-dimensional vector can be called a high-dimensional space representation of the frame image.
[0134] The image to be subjected to image quality assessment may include, but is not limited to: a whole image, and a regional image (sub-image) obtained by segmenting the whole image.
[0135] The text encoder 202 is used to extract features from the text to obtain a corresponding text feature vector. The text encoder 202 converts the text into a vector represented by a number, and the vector represented by the number can be called a high-dimensional space representation of the text.
[0136] In the embodiment of the present application, the text pair is input into the text encoder 202, and the text encoder performs feature extraction on the text pair to obtain a text feature vector corresponding to the text pair. The text pair includes two opposing text descriptions, which can also be understood as the text pair including a positive description text and a negative description text, such as for the text pair ['Good photo.', 'Badphoto.'], where 'Good photo.' can be understood as a positive description text, and 'Bad photo.' can be understood as a negative description text. The text encoder performs feature extraction on the text pair to obtain a text feature vector including a text feature vector corresponding to the positive description text and a text feature vector corresponding to the positive description text.
[0137] In an embodiment of the present application, a corresponding text pair can be constructed for each evaluation index. The text pair of the overall evaluation index can be a pair of mutually opposing texts used to evaluate the quality of the entire image. For any image parameter index, the text pair of the image parameter index can be a pair of mutually opposing texts used to evaluate the quality of the image parameter. The text pair of each image parameter index only describes the corresponding image parameter index. For example, the text pair of the clarity index is two opposing sentences related to clarity; the text pair of the brightness index is two opposing sentences related to brightness.
[0138] For example, for the overall evaluation index, the text pairs that can be constructed may include but are not limited to: ['a good picture', 'a bad picture'], ['a high-quality picture', 'a low-quality picture'], ['Good photo.', 'Badphoto.'], ['High quality photo', 'Low quality photo'] and other text pairs.
[0139] For another example, for the three-dimensional effect index, the corresponding text pairs that can be constructed may include but are not limited to: ['Good 3d effect photo', 'Bad 3d effect photo'], ['Good 3-d effect photo','Bad3-d effect photo'], ['Good three-dimensional effect photo','Bad three-dimension effect photo'] and ['Strong three-dimension effect photo','Weakthree-dimensionaleffectphoto'].
[0140] For another example, for the lighting effect indicators, the corresponding text pairs that can be constructed may include but are not limited to: ['Good lighting photo', 'Bad lighting photo'], ['Good lighting effect photo', 'Bad lighting effect photo'], ['Good optical effects photo', 'Bad optical effectsphoto'], ['Good tone photo', 'Bad tone photo'], ['Good visual effect photo', 'Bad visual effect photo'] and ['Good light appearance photo', 'Bad light appearance photo'].
[0141] It can be understood that the above text pairs are only examples and this application does not make any specific limitations on them.
[0142] In the embodiment of the present application, the text or text pair obtained by the text encoder 202 may be pre-stored by the electronic device 100, may be input by the user, or may be the text or text pair constructed by the electronic device according to the user input.
[0143] The scoring module 203 is used to calculate the similarity between the text feature vector and the image feature vector to obtain the corresponding cosine similarity.
[0144] In the embodiment of the present application, the scoring module 203 obtains the image feature vector output by the image encoder 201 and the text feature vector output by the text encoder 202. The scoring module 203 calculates the cosine similarity of the obtained image feature vector and the obtained text feature vector respectively by using the following cosine similarity formula to obtain the corresponding cosine similarity.
[0145]
[0146] Where x is the image feature vector. i is the text feature vector, i=1, 2 represents a pair of opposing texts, for example, t1 represents the feature representation vector corresponding to the positive description text in the text pair, and t2 represents the feature representation vector corresponding to the negative description text in the text pair. ⊙ represents the vector dot product, represents the l2 norm; S y Represents the cosine similarity between the text feature vector and the image feature vector of the y-th text pair, where y ranges from 1 to the number of text feature vectors obtained by the scoring module 203 .
[0147] For any text pair, S y It includes the cosine similarity S1 between the image feature vector x and the text feature vector t1 and the cosine similarity S2 between the image feature vector x and the text feature vector t2.
[0148] The scoring module 203 is also used to calculate the score of the cosine similarity through the following Softmax formula to obtain the total similarity score associated with the image and text pair.
[0149]
[0150] in, is the overall similarity, with a value range between 0 and 1. As the total similarity score associated with the image and text pair.
[0151] Exemplarily, the scoring module 203 obtains the image feature vector x of image a and the text feature vectors of three pairs of text pairs, namely, the text feature vector T1 corresponding to ['High quality photo', 'Low quality photo'], the text feature vector T2 corresponding to ['Good 3d effect photo', 'Bad 3d effect photo'], and the text feature vector T3 corresponding to ['Goodlighting photo', 'Bad lighting photo']. The value range of y in the above cosine similarity formula is 1 to 3.
[0152] The following takes the calculation of the cosine similarity between image a and text feature vector T1 as an example, and the calculation formula is as follows:
[0153]
[0154] Among them, t1 represents the text feature representation vector corresponding to the positive description text 'High quality photo' in the text pair, and t2 represents the text feature representation vector corresponding to the negative description text 'Low quality photo' in the text pair. T1 It includes the cosine similarity S1 between the image feature vector x and the text feature vector t1 and the cosine similarity S2 between the image feature vector x and the text feature vector t2. T1 represents the cosine similarity between the text feature vector T1 and the image feature vector x corresponding to ['High quality photo', 'Low quality photo']. Substituting the cosine similarities S1 and S2 into the above Softmax formula, we get Represents the total similarity score between image a and the text pair ['High quality photo', 'Low quality photo']. Very big, such as =0.99 means the image has a high score and is a good image. If the score is low, it is a bad image.
[0155] For example, the text pair input for the overall image evaluation index is ['a high-quality image', 'a low-quality image'], and the total similarity score is is 0.95, which means that the input image is of good quality overall; the total similarity score is If it is 0.01, it means that the input image is of poor quality overall.
[0156] In addition to the overall evaluation of the image, the image parameters can also be evaluated. Taking noise as an example, the input format is still (image, text), where the text is a description of the noise. For example, the input text pair is ['a clean image', 'a noisy image'] or ['a low-noise image', 'a high-noise image']. The total similarity score is 0.98, it means that the input image is a low-noise image. If it is 0.02, it means that the input image is a very noisy image. It can be understood that it can also be the text corresponding to indicators such as clarity, contrast, color, saturation, brightness, sharpness, and even three-dimensional effects, light and shadow effects (tones).
[0157] The output module 204 is used to output the total similarity score associated with the image and text pair calculated by the scoring module 203 .
[0158] In the embodiment of the present application, when the image to be evaluated for image quality is the entire image a, the image encoder 201 performs feature extraction on the entire image to obtain the image feature vector A of the entire image. The text encoder 202 can perform feature extraction on the text pair b of the overall evaluation index to obtain the text feature vector B, and can also perform feature extraction on the text pair of the image parameter index to obtain the corresponding text feature vector, such as the text feature vector C1 corresponding to the text pair c1 of the clarity index, and the text feature vector C2 of the text pair c2 of the contrast index. The scoring module 203 can calculate the cosine similarities D1 and D2 of the image feature vector A and the text feature vector B, and obtain the associated total similarity score of the entire image a and the text pair b according to the cosine similarities D1 and D2. The scoring module 203 can also calculate the cosine similarities E1 and E2 of the image feature vector A and the text feature vector C2, and obtain the associated total similarity score of the entire image a and the text pair c1 according to the cosine similarities E1 and E2.
[0159] The electronic device 100 can perform image segmentation on the entire image a to obtain regional images a1, a2 and a3, and the regional images a1, a2 and a3 form the entire image a. Similarly, when the image to be evaluated for image quality is the regional image a1, the image encoder 201 performs feature extraction on the regional image a1 to obtain the image feature vector A1 of the regional image a1. The scoring module 203 can calculate the cosine similarity D between the image feature vector A1 and the text feature vector B. 11 and D 12 , and according to the cosine similarity D 11 and D 12 The total similarity score associated with the region image a1 and the text pair b is obtained. The scoring module 203 can also calculate the cosine similarity E between the image feature vector A1 and the text feature vector C2. 11 and E 12 , and according to the cosine similarity E 11 and E 12 Get the total similarity score associated with the entire image a and the text pair c1.
[0160] See also Figure 8 , exemplarily introduces another structure of the scoring model 200 provided in an embodiment of the present application. Figure 8 The scoring model 200 and Figure 7 The difference between the scoring model 200 is: Figure 8 The scoring model 200 does not include a text encoder, and Figure 8 The scoring model 200 includes a text feature vector acquisition module 205 .
[0161] In the embodiment of the present application, the scoring model 200 can obtain the corresponding text feature vector through the text feature vector acquisition module 205, without the need for the text encoder 202 to perform feature extraction on the text or text pair. Specifically, the electronic device 100 can pre-store the text feature vector, and the text feature vector acquisition module 205 obtains the text feature vector from the electronic device 100 and inputs it to the scoring module 203.
[0162] In some embodiments, Figure 7 and Figure 8 The scoring model 200 shown may also include a segmentation module (not shown), which is used to perform image segmentation on the input whole image to obtain various regional images, and input the whole image and / or various regional images to the image encoder 203.
[0163] In other embodiments, the segmentation module may be independent of the scoring model 200 .
[0164] Understandable, yes Figure 7 and Figure 8After the scoring model 200 shown performs operations such as network pruning, the scoring model 200 is deployed in the electronic device 100 .
[0165] It should be understood that Figure 7 and Figure 8 The scoring model 200 shown is only one example, and the scoring model 200 may have more Figure 7 and Figure 8 More or fewer modules may be shown, two or more modules may be combined, or the module configuration may be different.
[0166] It should be noted that in the prior art, traditional algorithms are used for image parameters (dimensions) such as noise, clarity, brightness, saturation, color cast, focus, contrast, and sharpness. For example, brightness, saturation, and color are judged by HSL, noise and clarity are judged by PSNR, SSIM, sobel operator, Laplace operator, edge detection or gradient, and contrast is judged by RMS-Contrast or Weber-Contrast and Michelson-Contrast corresponding to L in LAB (HSL). The embodiment of the present application can score image parameters (dimensions) such as noise, clarity, brightness, saturation, color cast, focus, contrast, and sharpness through a scoring model, and accurate scoring of the above image parameters can be achieved based on text pairs.
[0167] It should be noted that there are no indicators corresponding to three-dimensional stereoscopic effects, tonality and lighting effects in the prior art, and the scoring model provided in the embodiment of the present application can encapsulate indicators of three-dimensional stereoscopic effects, tonality and lighting effects, and use the encapsulated evaluation indicators to measure whether the tone, three-dimensional sense and lighting of the image are good or bad, or the degree of good or bad.
[0168] In an embodiment of the present application, tone, three-dimensional stereoscopic effect and lighting effect can all be implemented using the CLIP multimodal large model and encapsulated into an independent indicator. The indicator output range is mapped to [0,1] through functions such as softmax. The closer to 1, the better the tone and / or three-dimensional stereoscopic effect and / or lighting effect, and the closer to 0, the worse.
[0169] The multimodal large model encapsulates the tone and three-dimensional effect indicators, and the scoring model is obtained by fine-tuning the multimodal large model using the ContextOptimization (CoOp) method.
[0170] See also Fig. 9 , a schematic diagram of the fine-tuning scoring model provided in an embodiment of the present application is exemplified.
[0171] The text pairs corresponding to the three-dimensional effect include: ['Good 3d effect photo', 'Bad 3deffect photo'], ['Good 3-d effect photo', 'Bad 3-d effect photo'], ['Good three-dimensionl effect photo', 'Bad three-dimensionl effect photo'], and ['Strongthree-dimensionl effect photo', 'Weak three-dimensionl effect photo'].
[0172] The text pairs corresponding to the tonal effects are: ['Good lighting photo', 'Bad lightingphoto'], ['Good lighting effect photo', 'Bad lighting effect photo'], ['Goodoptical effects photo', 'Bad optical effects photo'], ['Good tone photo', 'Badtone photo'], ['Good visual effect photo', 'Bad visual effect photo'] and ['Good light appearance photo', 'Bad light appearance photo'].
[0173] The text pairs corresponding to the three-dimensional effect and the tone effect are input into the text encoder to obtain the text feature vectors of each text pair. The scoring module calculates the total similarity score of the text feature vector and the image feature vector, and adjusts the learnable vector according to the total similarity score. The subsequent scoring model can score according to the adjusted learning vector and the obtained text feature vector. Therefore, a set of prompts is designed to evaluate the tone / light and shadow effects / light effects, and the designed prompts are directly encapsulated into indicators for use.
[0174] It can be understood that the above three-dimensional stereoscopic effect and tone effect are packaged and evaluated together, and the three-dimensional effect and tone effect can also be scored separately. Fig. 9 Just replace CLASS in the text box with the text pair corresponding to the light effect.
[0175] In the embodiment of the present application, when migrating the large model to our corresponding downstream task, promptlearning can be used to fine-tune the large model so that the large model is more suitable for our task. By fine-tuning (or training) prompt, the embedding vector of prompt can be more suitable for our downstream task.
[0176] The executor of the image processing method provided in the embodiment of the present application may be the electronic device mentioned above, or may be a functional module and / or functional entity in the electronic device that can implement the image processing method, and the scheme of the present application may be implemented by hardware and / or software, which may be determined according to actual usage requirements and is not limited by the embodiment of the present application.
[0177] See also Fig.10 , exemplarily introduces the image processing method flow provided by the embodiment of the present application. The image processing method provided by the embodiment of the present application is applied to an electronic device, and the electronic device includes a scoring model.
[0178] Step S601, performing image segmentation on the first image to obtain images of various regions.
[0179] In the embodiment of the present application, the first image is an image to be processed. Figure 1 In the scenario of , the first image may be image 10a or image 20a. Figure 2 In the scenario of , the first image may be image 10b or image 20b. Figures 3 to 5 In the scenario, the first image may be processed to be deleted.
[0180] In the embodiment of the present application, after the electronic device acquires the first image, it performs image segmentation on the first image to obtain various regional images. The regional images can also be called sub-images, which are partial images of the first image. The regional images obtained after image segmentation can be combined to obtain the first image.
[0181] Among them, the technologies used in image segmentation may include but are not limited to: SegmentAnything Model (SAM), Recognize Anything Model (RAM), Open Set Object Detector (Grounding-DINO) and Yolo (You Only Look Once) model.
[0182] When implementing the embodiments of the present application, the inventors found that the above-mentioned technology has the following characteristics: The SAM model has fine segmentation and high accuracy. RAM and RAM++ recognition are relatively high for indoor scenes, but the segmentation is too coarse and there are omissions. The Grounding-DINO model can only recognize the corresponding objects in the picture by prompt, but there are still many errors in recognition, especially for people and faces. Yolo performs well in recognizing people and faces. In view of this, in the embodiments of the present application, the electronic device or segmentation module can use the SAM model for segmentation, combined with the recognition of Grounding-DINO+prompt and the Yolo model for person and face recognition, so as to realize the segmentation, detection and recognition of the first image, give full play to the advantages of each model technology, and make up for their respective shortcomings, thereby improving the accuracy of image segmentation, detection and recognition.
[0183] Step S602: extract features from each region image based on an image encoder to obtain a first image feature vector corresponding to each region image.
[0184] In the embodiment of the present application, after performing image segmentation on the first image in step S601, various regional images are obtained. All regional images can be input into an image encoder. Based on the image encoder, feature extraction is performed on the input regional images to obtain first image feature vectors corresponding to various regional images.
[0185] In some embodiments, a portion of the region image may be input to an image encoder. Figure 1 In the scenario, each region image obtained in step S601 of image 10a and each region image obtained in step S601 of image 20a may be matched, and the matched region images may be input into the image encoder.
[0186] Exemplarily, the electronic device inputs the regional image A and the regional image B to the image encoder. The image encoder extracts features from the regional image A to obtain a first image feature vector corresponding to the regional image A. The image encoder extracts features from the regional image B to obtain a first image feature vector corresponding to the regional image B.
[0187] In this article, in order to facilitate the distinction between the image feature vectors obtained after the image encoder extracts features from the overall image and the regional image, the image feature vector corresponding to the regional image is named the first image feature vector, and the image feature vector corresponding to the overall image is named the second image feature vector.
[0188] Among them, the relevant contents of the image encoder can be referred to above and will not be repeated here.
[0189] Step S603, obtaining text feature vectors corresponding to the text pairs, wherein the number of text pairs corresponding to the same evaluation index is one or more pairs.
[0190] In an embodiment of the present application, the electronic device can obtain text pairs corresponding to one or more evaluation indicators, such as obtaining text pairs corresponding to overall evaluation indicators and / or text pairs corresponding to image parameter indicators, and the image parameter indicators can be one or more.
[0191] In the embodiment of the present application, the text pair for the overall evaluation index may be one or more pairs. For example, the text pair for the overall evaluation index may be any one or more pairs of the following text pairs: ['a high-quality picture', 'a low-quality picture'], ['a good picture', 'a bad picture'], and ['good photo', 'bad photo'].
[0192] In an embodiment of the present application, the text pair for any image parameter indicator may be one or more pairs. For example, taking the image parameter indicator as a three-dimensional effect indicator as an example, the text pair for the three-dimensional effect indicator may be any one or more pairs of the following text pairs: ['Good 3d effect photo', 'Bad 3d effect photo'], ['Good 3-d effect photo', 'Bad 3-d effect photo'], ['Good three-dimensionl effectphoto', 'Bad three-dimensionl effect photo'], and ['Strong three-dimensionleffect photo', 'Weak three-dimensionl effect photo'].
[0193] In an embodiment of the present application, among the text pairs corresponding to one or more evaluation indicators obtained by the electronic device, there is at least one evaluation indicator corresponding to multiple pairs of text pairs, that is, there are at least two or more pairs of text pairs corresponding to the same evaluation indicator.
[0194] It should be noted that in the prior art, for the same evaluation indicator, a pair of text pairs is generally used, such as only one pair of text pairs is input into the text encoder for the same evaluation indicator, or, for the same evaluation indicator, the scoring module only uses the text feature vector and image feature vector of one pair of text pairs for calculation.
[0195] In the image processing method provided in the embodiment of the present application, multiple pairs of text pairs can be used for any evaluation index. For example, the three-dimensional effect index can use the text pairs ['Good 3d effect photo', 'Bad 3d effectphoto'], ['Good 3-d effect photo', 'Bad 3-d effect photo'], ['Good three-dimensionl effect photo', 'Bad three-dimensionl effect photo'] and ['Strongthree-dimensionl effect photo', 'Weak three-dimensionl effect photo']. Different text feature vectors are obtained after feature extraction from different text pairs. Even if corresponding to the same evaluation index, the scoring module uses different text feature vectors and the same image feature vector for calculation, and the scores obtained are not the same. Therefore, by using multiple pairs of text pairs for the same evaluation index, the accuracy of scoring can be improved.
[0196] In an embodiment of the present application, each evaluation index can be determined first, and then a corresponding text pair can be constructed according to each evaluation index. The constructed text pair is input into the scoring model for calculation, and the text pair with the best performance in all data sets is screened out, such as the 5 or 10 text pairs with the best performance in all data sets. The screened text pairs are subjected to feature extraction to obtain a feature vector of the corresponding text pair. The text feature vector corresponding to the obtained text pair is pre-stored in an electronic device, so that the pre-stored text feature vector can be directly used for similarity calculation in the future, reducing the calculation processing of the text encoder.
[0197] In some other embodiments, the electronic device may pre-store the screened text pairs, and perform feature extraction on the screened text pairs when performing image processing. The scoring model also includes a text encoder. Obtaining a text feature vector corresponding to the text pair includes: obtaining an input text pair in response to text input; and performing feature extraction on the input text pair based on the text encoder to obtain a text feature vector corresponding to the text pair.
[0198] The text input can be Figure 4 Input in the text input box 107.
[0199] Step S604: Obtain a total similarity score corresponding to the text pair according to the similarity between the first image feature vector and the text feature vector.
[0200] In step S602, each of the regional images input to the image encoder has its corresponding first image feature vector. For each regional image input to the image encoder, the scoring module performs similarity calculation based on the first image feature vector corresponding to the regional image and the text feature vector obtained in step S603 to obtain the cosine similarity between the text feature vector and the image feature vector. The scoring module then calculates the cosine similarity through the SoftMax function to obtain the total similarity score associated with the regional image and the text pair corresponding to the text feature vector.
[0201] It can be understood that, for each region image, when the text feature vectors whose similarity is calculated with the first image feature vector of the region image correspond to multiple text pairs, the total similarity scores corresponding to each text pair can be obtained. When the text feature vectors whose similarity is calculated with the first image feature vector of the region image correspond to multiple evaluation indicators, the total similarity scores corresponding to each evaluation indicator can be obtained.
[0202] In the following, regional image A is taken as an example. Regional image A corresponds to the first image feature vector A1. The feature vectors of the text pairs obtained in step S603 include the text feature vector B1 corresponding to text pair B, the text feature vector C1 corresponding to text pair C, and the text feature vector D1 corresponding to text pair D. The scoring module calculates the similarity between the first image feature vector A1 and the text feature vector B1 and obtains the total similarity score S1 associated with regional image A and text pair B through the SoftMax function. Correspondingly, the scoring module calculates the total similarity score S2 associated with regional image A and text pair C and the total similarity score S3 associated with regional image A and text pair D. The total similarity score S1 corresponds to text pair B, while the total similarity score S2 corresponds to text pair C, and the total similarity score S3 corresponds to text pair D.
[0203] Step S605 , for any evaluation index, according to the weight of the text pair in the evaluation index and the corresponding total similarity score, obtain the evaluation score of the regional image with respect to the evaluation index.
[0204] In an embodiment of the present application, for any evaluation index, the weight of the text pair in the evaluation index indicates the weight of the text pair in the evaluation index. Any evaluation index may include one or more pairs of text pairs. When the evaluation index includes only one pair of text pairs, the weight of the text pair in the evaluation index is 1. When the evaluation index includes multiple pairs of text pairs, the sum of the weights of the multiple pairs of text pairs is 1.
[0205] In the embodiment of the present application, for any evaluation indicator, when the evaluation indicator includes multiple text pairs, a corresponding initial weight can be set in advance for each text pair, and the initial weight corresponding to each text pair can be tuned and trained to find the optimal weight. The electronic device stores the optimal weight of the text pair in each evaluation indicator, and then calculates the evaluation score according to the optimal weight.
[0206] Unless otherwise specified below, the weight of a text pair refers to the optimal weight.
[0207] As shown in the above example, the text pairs of the three-dimensional effect evaluation index are: text pair 1 ['Good 3d effect photo', 'Bad 3d effect photo'], text pair 2 ['Good 3-d effect photo', 'Bad 3-deffect photo'], text pair 3 ['Good three-dimensionl effect photo', 'Bad three-dimensionl effect photo'] and text pair 4 ['Strong three-dimensionl effect photo', 'Weak three-dimensionl effect photo']. Among them, text pairs 1 to 4 have corresponding weights, which are 0.3, 0.2, 0.4 and 0.1 respectively. The weights 0.3, 0.2, 0.4 and 0.1 are the optimal weights obtained after tuning training. Therefore, in the three-dimensional effect index, the corresponding weights of text pairs 1 to 4 are 0.3, 0.2, 0.4 and 0.1.
[0208] In the embodiment of the present application, there are J evaluation indicators for each regional image, and J evaluation scores of the regional image with respect to the J evaluation indicators can be obtained.
[0209] In the embodiment of the present application, for any image (whole image or regional image), the evaluation score calculation formula for any evaluation index is as follows:
[0210]
[0211] in, Represents the evaluation score of the image with respect to the evaluation index, Indicates the weight corresponding to the i-th text pair in the evaluation index, is the total similarity score corresponding to the i-th text pair in the evaluation index, that is, and They represent the weight and score of the i-th prompt respectively. T is an integer greater than or equal to 1. When T is 1, that is, only one text pair is included in the evaluation index, then is 1, .
[0212] As shown in the above example, text pair B and text pair C correspond to the same evaluation index a, and the weights of text pair B and text pair C in evaluation index a are 0.8 and 0.2 respectively, and text pair D corresponds to another evaluation index b. According to the weights of the text pairs in evaluation index a (0.8 and 0.2) and the corresponding total similarity scores (S1 and S2), the evaluation score of the regional image with respect to evaluation index a is obtained. According to the weights of the text pairs in evaluation index b and the corresponding total similarity score (S3), the evaluation score of the regional image with respect to evaluation index b is obtained. Based on the fact that evaluation index b only includes one text pair, the evaluation score of the regional image with respect to evaluation index b is also the total similarity score S3. Evaluation index a can be an overall evaluation index or an image parameter index. Evaluation index b can be an overall evaluation index or an image parameter index. Evaluation index a and evaluation index b are two different evaluation indexes, such as different image parameter indicators.
[0213] In the embodiment of the present application, for the same evaluation index, multiple text pairs can be set to fully utilize the multiple text pairs to achieve accurate scoring of the regional image. In addition, the score can be adjusted based on the weight of the text pair in the evaluation index, further increasing stability and accuracy.
[0214] Step S606: Obtain the processing result of the first image according to the evaluation scores of the images of each region.
[0215] In the embodiment of the present application, in step S605, the evaluation scores of each regional image with respect to each evaluation index can be obtained, that is, the evaluation scores of each region in the first image with respect to each evaluation index can be obtained, thereby obtaining the quality evaluation of the first image based on the evaluation scores of each region in the first image with respect to each evaluation index.
[0216] In some embodiments, the processing result of the first image may further include, after the quality evaluation of the first image is obtained according to the evaluation scores of various regions in the first image with respect to various evaluation indicators, selectively deleting the first image according to the quality evaluation of the first image.
[0217] The image processing method provided by the embodiment of the present application includes but is not limited to the following technical effects:
[0218] The image to be processed is segmented to obtain images of various regions, and then fine-grained scores are performed on each region image through text pairs and scoring models. The text pairs set for the same evaluation index can include one or more pairs, so that the text pairs can be used to achieve accurate scoring of regional images. The scores are further adjusted based on the weights of the text pairs, which increases the stability and accuracy of the quality assessment. In this way, the evaluation indicators of each regional image of the image are scored, and the problems in the image can be comprehensively and accurately found out based on the evaluation scores of each regional image on each evaluation index, such as finding out the problematic areas in the image and which evaluation index problems exist in the area.
[0219] In an embodiment of the present application, there is at least one evaluation index corresponding to multiple pairs of text pairs, and the weights of the text pairs in the evaluation index include L weights corresponding to L pairs of text pairs one by one, and the L pairs of text pairs correspond to the same first target evaluation index, where L is an integer greater than or equal to 2. The first target evaluation index can be any of the above-mentioned evaluation indicators. When there are multiple evaluation indicators corresponding to multiple pairs of text pairs, there are multiple first target evaluation indicators, such as the overall evaluation index corresponding to text pair A and text pair B, and the tone index corresponding to text C, text D, and text E, then at least two first target evaluation indicators (overall evaluation index, tone index) are included.
[0220] Step S604 obtains the total similarity score corresponding to the text pair according to the similarity between the first image feature vector and the text feature vector, and specifically may include: obtaining L total similarity scores corresponding to the L pairs of text pairs according to the similarity between the first image feature vector and the text feature vectors corresponding to the L pairs of text pairs.
[0221] Step S605 obtains the evaluation score of the regional image with respect to the evaluation index according to the weight of the text pair in the evaluation index and the corresponding total similarity score, which may specifically include: performing weighted summation on L total similarity scores and L weights to obtain the evaluation score of the regional image with respect to the first target evaluation index.
[0222] As shown in the above example, text pair B and text pair C correspond to the same evaluation index a, and the weights of text pair B and text pair C in evaluation index a are 0.8 and 0.2 respectively. According to the similarity between the first image feature vector A1 and the text feature vector B1, the total similarity score S1 corresponding to text pair B is obtained. According to the similarity between the first image feature vector A1 and the text feature vector C1, the total similarity score S2 corresponding to text pair C is obtained. The total similarity score and the weight are weighted summed: 0.8*S1+0.2*S2, and the evaluation score of regional image A with respect to evaluation index a is 0.8*S1+0.2*S2.
[0223] In the embodiment of the present application, for any image (regional image), when scoring a certain evaluation index, the weights and total similarity scores of multiple text pairs included in the evaluation index can be used for calculation.
[0224] In an embodiment of the present application, the text feature vector includes a first text feature vector corresponding to the image parameter index and a second text feature vector corresponding to the overall evaluation index. The first text feature vector corresponding to the image parameter index: the text feature vector obtained after feature extraction of the text corresponding to the image parameter index. For example, feature extraction of the text corresponding to the tone index is performed to obtain the first text feature vector corresponding to the tone index. Feature extraction of the text corresponding to the light effect index is performed to obtain the first text feature vector corresponding to the light effect index. The second text feature vector corresponding to the overall evaluation index: the text feature vector obtained after feature extraction of the text corresponding to the overall evaluation index.
[0225] See also Fig.11 , exemplarily introduces another image processing method flow provided in an embodiment of the present application.
[0226] Step S701 : extracting features from each regional image and the first image based on an image encoder to obtain a first image feature vector corresponding to each regional image and a second image feature vector corresponding to the first image.
[0227] The above step S602 may specifically include the content of step S701.
[0228] Step S702: Obtain a corresponding first total similarity score according to the similarity between the first image feature vector and the first text feature vector.
[0229] The above step S604 may specifically include the content of step S702.
[0230] Step S703: Obtain a first evaluation score of the regional image with respect to the image parameter index according to the weight of the text pair in the image parameter index and the corresponding first total similarity score.
[0231] The above step S605 may specifically include the content of step S703.
[0232] The first total similarity score can be understood as the score associated with the text pair in the region image and the image parameter index. The first evaluation score can be understood as the score associated with the region image and the image parameter index.
[0233] Step S704: for each region image, a corresponding second total similarity score is obtained according to the similarity between the first image feature vector and the second text feature vector.
[0234] The above step S606 may specifically include the contents of steps S704 to S707.
[0235] Step S705 , obtaining a regional total score according to the first evaluation score and the second total similarity score of each regional image.
[0236] A regional total score is obtained according to the first evaluation score of each regional image and the second total similarity score of each regional image.
[0237] The second overall similarity score can be understood as the score associated with the text pair in the region image and the overall evaluation index.
[0238] In some embodiments, when the overall evaluation index includes multiple pairs of text pairs, the second evaluation score of the regional image with respect to the overall evaluation index can be obtained based on the weights of the text pairs in the overall evaluation index and the corresponding second total similarity scores. Then step S705 can be specifically as follows: the regional total score is obtained based on the first evaluation scores of each regional image and the second evaluation scores of each regional image.
[0239] Step S706: Obtain a third total similarity score of the first image according to the similarity between the second image feature vector and the second text feature vector.
[0240] The third overall similarity score may be understood as the score associated with the first image and the text pair in the overall evaluation index.
[0241] Step S707: Obtain a total score of the first image according to the third total similarity score of the first image and the total region score.
[0242] In some embodiments, when the overall evaluation index includes multiple pairs of text pairs, the third evaluation score of the first image with respect to the overall evaluation index can be obtained according to the weights of the text pairs in the overall evaluation index and the corresponding third total similarity scores. Then step S705 can specifically be: obtaining the total score of the first image according to the third evaluation score of the first image and the total score of the region.
[0243] In some embodiments, the fourth total similarity score of the first image can also be obtained based on the similarity between the second image feature vector and the first text feature vector. When the image parameter index includes multiple text pairs, the fourth evaluation score of the first image with respect to the image parameter index can be obtained based on the weights of the text pairs in the image parameter index and the corresponding fourth total similarity score. Then step S705 can specifically be: the total score of the first image is obtained based on the third evaluation score, the fourth evaluation score and the total regional score of the first image.
[0244] In the embodiment of the present application, the scores of each region image with respect to each evaluation index are calculated, and the performance of each region of the image with respect to each evaluation index is evaluated. The score of the first image with respect to the overall evaluation index is also calculated, and the performance of the image with respect to the overall evaluation index is evaluated, and the total score of the first image is obtained by fully considering each region of the image and the overall evaluation.
[0245] See also Fig.12 Step S705 may specifically include:
[0246] Step S801, obtaining parameter weights of image parameter indicators.
[0247] In the embodiment of the present application, the electronic device may pre-store parameter weights of various image parameter indicators, and the parameter weights of various image parameter indicators may be the same or different. For example, the parameter weight of the tone indicator may be the same or different from the parameter weight of the three-dimensional effect.
[0248] In the embodiment of the present application, the electronic device can obtain the parameter weight of the corresponding image parameter index according to the user's input. Figure 5 In the scene shown, the user opens the three-dimensional effect control 108j and the light effect control 108k, and the parameter weights of the three-dimensional stereoscopic effect index and the light effect index are greater than the weights of other image parameter indexes.
[0249] Step S802 , obtaining a first region score of the region image according to the parameter weight of the image parameter index and a first evaluation score of the region image with respect to the image parameter index.
[0250] In the embodiment of the present application, step S802 may specifically include: performing weighted summation on the parameter weight of the image parameter index and the first evaluation score of the regional image with respect to the image parameter index to obtain a first regional score of the regional image.
[0251] Step S803: Obtain a second region score of the region image according to the first region score and the second total similarity score of the region image.
[0252] In the embodiment of the present application, step S803 may specifically include: adding the first region score of the region image to the second total similarity score to obtain the second region score of the region image.
[0253] In some embodiments, step S803 may specifically include: adding the first regional score of the regional image to the second evaluation score to obtain the second regional score of the regional image.
[0254] Step S804: obtaining a regional total score according to the second regional score of each regional image.
[0255] In the embodiment of the present application, the regional weight of each regional image is obtained, and the regional weight of each regional image and the second regional score are weighted summed to obtain the regional total score.
[0256] In the embodiment of the present application, among the multiple regional images of the first image, the regional weight of the key regional image is greater than the regional weights of the other regional images. Therefore, the regional total score is biased towards the key regional image, and then the total score of the first image obtained based on the regional total score is also biased towards the key regional image. When selectively deleting images based on the total score, the key regional image of the retained image can be made better.
[0257] In the embodiment of the present application, parameter weights are set for each image parameter index, and in subsequent evaluation, the parameter weights can be adjusted to make the score closer to the image parameter index of interest, providing a personalized evaluation. Regional weights are set for each regional image, and in subsequent evaluation, the regional weights can be adjusted to make the score closer to the regional image of interest, providing a personalized evaluation. Based on the personalized evaluation, personalized processing of the image can be achieved, such as selective deletion of the image.
[0258] See also Fig.13 , obtaining the total score of the first image may include the following steps:
[0259] Step S901, obtaining the overall weight and partial weight.
[0260] In the embodiment of the present application, whether the quality assessment of the first image focuses more on the whole or on the region can be adjusted by the overall weight and the partial weight.
[0261] Step S902: Perform weighted calculation on the overall weight and the third total similarity score to obtain a first weighted score.
[0262] In some embodiments, the overall weight and the third evaluation score are weighted to obtain a first weighted score.
[0263] Step S903: Perform weighted calculation on the partial weights and the regional total score to obtain a second weighted score.
[0264] Step S904: Obtain a total score of the first image according to the first weighted score and the second weighted score.
[0265] The first weighted score is added to the second weighted score to obtain a total score for the first image.
[0266] In the embodiment of the present application, the total score of the image can be calculated according to the following total score formula:
[0267]
[0268] The above formula satisfies: W1+W2=1; ; .
[0269] Among them, score all Indicates the total score of the image. C indicates the evaluation score of the scoring model for the entire image (without segmentation) (it can be the third total similarity score or the third evaluation score). B j W represents the overall evaluation score of the j-th regional image by the scoring model (it can be the second total similarity score or the second evaluation score). M is the number of regional images obtained after the overall image is segmented, that is, it is divided into M regions, and M is greater than or equal to 2. W j W represents the region weight of the jth region image. j The sum of the weights is equal to 1, that is, the sum of the regional weights of the M regional images is equal to 1. N is the number of image parameter indicators, that is, it corresponds to N different image parameter indicators. i W represents the parameter weight of the i-th image parameter index. i The sum of the weights is equal to 1, that is, for the same area image, the sum of the parameter weights of the N image parameter indicators is equal to 1. ij Indicates the score (first evaluation score) corresponding to the i-th image parameter index of the j-th region image. W1 is the overall weight and W2 is the partial weight.
[0270] In the embodiment of the present application, the first evaluation score of each region image with respect to the image parameter index can be calculated according to the following formula:
[0271]
[0272] in, represents the first evaluation score corresponding to the i-th image parameter index (e.g., noise is the first image parameter index, clarity is the second image parameter index, etc.) of the j-th region image. L is the number of text pairs included in the i-th image parameter index. W x Indicates the weight corresponding to the xth text pair, a x Represents the total similarity score associated with the region image of the jth region and the xth text pair.
[0273] In the embodiment of the present application, the overall weight W1 and the partial weight W2 can be used to adjust whether the total score focuses more on the whole or the region. The specific values of the overall weight W1 and the partial weight W2 can be set according to the actual situation. For example, if the image is a human selfie scene, the partial weight W2 can be adjusted to be greater than the overall weight W1, so that the total score of the image is more biased towards the region, so as to facilitate subsequent processing (such as the above Figures 3 to 5 Delete scene shown in the figure) can be more realistic.
[0274] In the embodiment of the present application, the area weight W j It is convenient to adjust which area image the total score focuses on. For example, when the current image is identified as a sunset photo, the area weight W of the sunset area image can be determined. j Greater than the weight of images in other regions.
[0275] In the embodiment of the present application, the parameter weight W i It is convenient to focus more on which image parameter indicators in the total score. For example, Figure 5 In the custom deletion shown, in response to the user opening the 3D effect control 108j and the light effect control 108k, it can be determined that the image parameter indexes of the 3D effect and the light effect are greater than other image parameter indexes, and then images with total scores that are biased towards the 3D effect and the light effect can be selected, thereby retaining the images with the best 3D effect and the light effect and deleting the rest of the images.
[0276] In the embodiment of the present application, each weight can be stored in advance, and then the corresponding weight can be determined according to the scene or semantics of the recognized image. Then the total score of the whole image can be calculated, the highest score is retained, and the low score is deleted, so that a group of similar pictures in the album can be automatically deleted and the best picture can be retained.
[0277] The following describes a method for determining text pairs and optimizing weights of text pairs provided in an embodiment of the present application.
[0278] In an embodiment of the present application, evaluation indicators can be predetermined, and the text pairs included in each evaluation indicator can be determined. For example, for a certain evaluation indicator, multiple pairs of text pairs can be designed, and the multiple pairs of text pairs are input into a scoring model to filter out one or the first few text pairs with the best performance in all data sets. When multiple text pairs are filtered out for a certain evaluation indicator, the weight of each text pair can be optimized by the weight optimization method provided in the embodiment of the present application to obtain the optimal weight.
[0279] See also Fig.14 , an exemplary introduction to the weight optimization method provided in the embodiments of the present application.
[0280] Step S101, obtaining initial weights of P pairs of texts, where P is an integer greater than or equal to 2, and the P pairs of texts correspond to the same second target evaluation index.
[0281] For any evaluation indicator, select the P pairs of texts with the best performance in all data sets. For example, taking the second target evaluation indicator as the lighting effect indicator, the text pairs constructed for the lighting effect indicator include ['Good lighting photo', 'Bad lighting photo'], ['Good lighting effect photo', 'Bad lighting effect photo'], ['Good optical effects photo', 'Bad optical effectsphoto'], ['Good tone photo', 'Bad tone photo'], ['Good visual effect photo', 'Badvisual effect photo'] and ['Good light appearance photo', 'Bad lightappearance photo'], among which ['Good lighting photo', 'Bad lighting photo'], ['Goodlighting effect photo', 'Bad lighting effect photo'] and ['Good optical effectsphoto', 'Bad optical effects photo'] perform well in all data sets. Therefore, the text pairs corresponding to the lighting effect indicator are determined to be the above-mentioned ['Good lighting photo', 'Bad lighting photo'], ['Goodlighting effect photo', 'Bad lighting effect photo'] and ['Good optical effectsphoto', 'Bad optical effects photo'].
[0282] Step S102: acquiring a first training image and a second training image, wherein a second target evaluation index of the first training image is better than that of the second training image.
[0283] As in the above example, the second target evaluation index is the light effect index, and the first training image can be the image after the second training image is filled with light, that is, the difference between the first training image and the second training image is that the first training image is processed with fill light, while the second training image is not processed with fill light.
[0284] Step S103, obtaining an evaluation score of the first training image with respect to a second target evaluation index according to the initial weights of the first training image and P pairs of texts.
[0285] In the embodiment of the present application, after determining each text pair included in any evaluation index, the initial weight of each text pair can be set. For example, if four text pairs are included, the initial weight of each text pair can be set to 0.25.
[0286] Step S104, obtaining an evaluation score of the second training image with respect to a second target evaluation index according to the initial weights of the second training image and P pairs of texts.
[0287] In an embodiment of the present application, step S103 and step S104 may specifically include: extracting features from the first training image and the second training image based on an image encoder to obtain a third image feature vector corresponding to the first training image and a fourth image feature vector corresponding to the second training image. Obtaining training text feature vectors corresponding to P pairs of text. According to the similarity between the third image feature vector and the training text feature vector, obtain P total similarity scores (i.e., first training total similarity scores) corresponding to the first training image and the P pairs of text respectively; according to the similarity between the fourth image feature vector and the training text feature vector, obtain P total similarity scores (i.e., second training total similarity scores) corresponding to the second training image and the P pairs of text respectively. According to the initial weights of the P pairs of text and the P first training total similarity scores, obtain the evaluation score of the first training image with respect to the second target evaluation index. According to the initial weights of the P pairs of text and the P second training total similarity scores, obtain the evaluation score of the second training image with respect to the second target evaluation index.
[0288] Step S105 , obtaining a first difference value according to a difference value between the evaluation scores of the first training image and the second training image with respect to the second target evaluation index.
[0289] The evaluation score of the first training image with respect to the second target evaluation index is subtracted from the evaluation score of the second training image with respect to the second target evaluation index to obtain a first difference.
[0290] Step S106, obtaining a first annotation score of the first training image and a second annotation score of the second training image, wherein both the first annotation score and the second annotation score are related to the second target evaluation index.
[0291] The first annotation score and the second annotation score are scores given by technicians, such as professionals, to the second target evaluation index of the first training image and the second training image.
[0292] Step S107, obtaining a second difference value according to the difference value between the first annotation score and the second annotation score.
[0293] Step S108: constructing an objective function according to the first difference and the second difference.
[0294] The objective function is to minimize the distance between the "difference between the evaluation scores of the large model for the first training image and the second training image (first difference)" and the "difference between the scores of the professionals for the first training image and the second training image (second difference)". The objective function can be constructed as follows:
[0295] ,
[0296]
[0297] Among them, P is the number of text pairs included in the evaluation index.
[0298] Step S109, determining the optimal weights of P pairs of texts according to the objective function.
[0299] Step S110, taking the optimal weights of P pairs of texts as the weights of the text pairs in the second target evaluation index.
[0300] For example, after the data set is screened, the top three text pairs with the best light and shadow index effects are retained, namely text pair a, text pair b, and text pair c. The weights of the three text pairs are , and The scoring model calculates the total similarity scores of the first training image and the second training image through text pair a. and The scoring model calculates the total similarity scores of the first training image and the second training image through the text pair b. and The scoring model calculates the total similarity scores of the first training image and the second training image through the text pair c. and The images in the test set are first scored by professionals for their lighting effects. The score of the first training image is the first annotation score, and the score of the second training image is the second annotation score.
[0301] The objective function is to minimize the distance between the "difference between the scores of the large model for the two images (first difference)" and the "difference between the scores marked by the professionals (second difference)". The objective function expression can be to minimize the square distance between the first difference and the second difference.
[0302] "The difference between the scores of the two images given by the large model" = the first evaluation score of the image after fill-in light - the first evaluation score of the image before fill-in light = =
[0303] "Difference in scores marked by professionals" = first marking score - second marking score = .
[0304] Then the objective function expression is:
[0305]
[0306] Objective optimization: Under the premise that the sum of the weights of the text pairs is equal to 1, find the weight w so that the function Minimum.
[0307] ,
[0308]
[0309] Weight optimization can adopt Bayesian optimization algorithm (BO), evolutionary algorithm (EA) or genetic algorithm (GA) and so on.
[0310] In the embodiment of the present application, for any evaluation index, multiple pairs of texts can be constructed, and the optimal weight can be configured for each text pair according to the weight optimization method provided in the embodiment of the present application.
[0311] See also Fig.15 , exemplarily introduces another image processing method provided in an embodiment of the present application.
[0312] Step S111, performing image segmentation on the second image to obtain sub-images, wherein the shooting scenes of the first image and the second image are similar, and the first image and the second image are images shot by different electronic devices respectively.
[0313] The second image is an image to be processed. Figure 1 In the scenario of , the second image may be image 10a or image 20a. Figure 2 In the scenario, the second image may be image 10b or image 20b.
[0314] For step S111, reference may be made to the relevant content of step S601.
[0315] Step S112, determining a target sub-image that matches the regional image.
[0316] In the embodiment of the present application, the regional image of the first image and the sub-image in the second image may be matched to find a matching image, and then the matching images are scored and compared.
[0317] In the embodiment of the present application, feature point matching can be performed on the regional image and the sub-image by combining intersection over union (IoU) matching, SIFT feature point matching, and homography matching. Specifically, semantic segmentation (SAM) is performed on the input image, and then feature point matching + semantic filtering is performed to remove some poor-quality segmented areas (SIFT), and then Yolo is used to separately identify "person" and "face" for "focus" judgment (YOLOv8), and Grounding-DINO is used to identify common areas through prompt input (DINO).
[0318] Step S113 , for any evaluation index, outputting a comparison result of the regional image and the target sub-image with respect to the evaluation index according to the evaluation score of the regional image with respect to the evaluation index and the evaluation score of the target sub-image with respect to the evaluation index.
[0319] Exemplarily, taking the tone index as an example, the regional image a1 is matched with the sub-image a2, and the evaluation score a11 of the regional image a1 with respect to the tone index is obtained, and the evaluation score a21 of the sub-image a2 with respect to the tone index is obtained. The comparison result of the regional image and the target sub-image with respect to the evaluation index is output according to the output of the evaluation score a11 and the evaluation score a21. When the evaluation score a21 is lower than the preset percentage of the evaluation score a11, it can be considered that the tone effect of the sub-image a2 is poor. The evaluation score a11 and the evaluation score a21 can be output, and the conclusion that "the tone effect of the sub-image a2 is poor" can also be output.
[0320] See also Fig.16 , exemplarily introduces another image processing method provided in an embodiment of the present application.
[0321] Step S121: obtaining a first input, where the first input indicates intelligent deletion of K images of the electronic device, where K is an integer greater than or equal to 2.
[0322] The first input can be Figure 4 The input of the intelligent deletion control 105 is deleted.
[0323] Step S122: In response to the first input, obtain the total scores of the K images.
[0324] In the embodiment of the present application, the total scores of K images can be obtained according to the above image processing method.
[0325] In other embodiments, in response to the first input, scores of K images are calculated according to text pairs corresponding to the overall evaluation index, and the scores of the images with respect to the overall evaluation index are taken as the total scores of the images.
[0326] Step S123, deleting the remaining images among the K images except the target image, where the target image has the highest total score.
[0327] The target image may also be an image whose total score ranks in the top n, where n is an integer greater than or equal to 2.
[0328] See also Fig.17 , exemplarily introduces another image processing method provided in an embodiment of the present application.
[0329] Step S131, obtaining a second input, where the second input indicates deleting H images of the electronic device according to the target image parameter index, where H is an integer greater than or equal to 2.
[0330] The second input can be Figure 4 The input of the custom delete control 106 is defined.
[0331] Step S132, in response to the second input, obtaining a total score of H images according to the parameter weight of the target image parameter index and the parameter weights of other image parameter indexes, wherein the parameter weight of the target image parameter index is greater than the parameter weights of other image parameter indexes.
[0332] In the embodiment of the present application, the total score of H images can be calculated based on the parameter weights of the above-mentioned target image parameter indicators, the parameter weights of other image parameter indicators and the above-mentioned total score formula.
[0333] In other embodiments, the evaluation score of the image may be calculated based on the parameter weights of the target image parameter index and the parameter weights of other image parameter indexes, and the image evaluation score may be used as the total score of the image.
[0334] Step S133, deleting the remaining images except the target image from the H images, where the target image has the highest total score.
[0335] See also Fig.18 , a method for calculating evaluation points provided in an embodiment of the present application is exemplarily introduced.
[0336] Step S141, receiving deletion setting input.
[0337] The deletion setting input is used to instruct to rate multiple images in the electronic device and then delete low-scoring images. The image deletion setting input can be Figure 3 The input of the delete setting control 103 is displayed.
[0338] Step S142, when it is intelligent deletion, determining the text feature vector corresponding to the intelligent deletion and the corresponding text pair weight.
[0339] In the embodiment of the present application, whether it is an intelligent deletion can be determined based on the user's input.
[0340] In an embodiment of the present application, the electronic device may display a delete control in response to an input of a delete setting. Figure 4 As shown, the deletion control may include a smart deletion control 105, a custom deletion control 106, and a text input box 107. In response to an input to the smart deletion control 105, the electronic device determines that the current deletion is a smart deletion.
[0341] In the embodiment of the present application, corresponding evaluation indicators may be pre-set for intelligent deletion. The evaluation indicators corresponding to intelligent deletion may include but are not limited to: an overall evaluation indicator or a comprehensive consideration of the overall evaluation indicator and the image parameter indicator.
[0342] For easy distinction, the evaluation index corresponding to the intelligent deletion is named the first index. The text pair corresponding to the first index is determined, and features are extracted from the text pair corresponding to the first index to obtain a text feature vector corresponding to the first index, and the text feature vector corresponding to the first index is used as the text feature vector corresponding to the intelligent deletion.
[0343] In an embodiment of the present application, when at least one evaluation index in the first index corresponding to the intelligent deletion includes multiple pairs of text pairs, the weights of the multiple pairs of text pairs are determined. For example, according to the above-mentioned weight optimization method, for any first index including multiple pairs of text pairs, the optimal weight of the text pairs in the first index is determined, and the optimal weight is used as the weight of the text pairs in the first index. The weight of the text pair corresponding to the intelligent deletion includes the weights of the text pairs in all the first indicators. If the first indicator includes evaluation indicators a and b, the weight of the text pair corresponding to the intelligent deletion includes the weight of the text pair in evaluation indicator a and the weight of the text pair in evaluation indicator b.
[0344] Step S143, calculating the similarity based on the image feature vector and the text feature vector corresponding to the intelligent deletion.
[0345] Step S144, obtaining a corresponding total similarity score according to the similarity.
[0346] Step S145, obtaining an evaluation score according to the total similarity score and the weight of the text pair corresponding to the intelligent deletion.
[0347] In the embodiment of the present application, when intelligent deletion is performed, only the overall situation can be considered, that is, only the text pairs corresponding to the overall evaluation index are used for scoring. The text pairs corresponding to the image parameter index can also be comprehensively considered for scoring.
[0348] Step S146, when it is a custom deletion, determine the image parameter index selected by the user.
[0349] In the embodiment of the present application, it can be determined whether it is a custom deletion based on the user's input.
[0350] In the embodiment of the present application, the electronic device responds to the input to the custom deletion control 106, determines that the current one is custom deletion, and displays Figure 5 In response to inputs to the controls of certain image parameter indicators, the image parameter indicators selected by the user are determined. For example, if the user inputs to the tone control 108i and the three-dimensional stereoscopic effect control 108j, the image parameter indicators selected by the user are determined to be the tone and the three-dimensional stereoscopic effect.
[0351] Step S147, determining the corresponding text feature vector and the corresponding text pair weight according to the image parameter index selected by the user.
[0352] In the embodiment of the present application, corresponding evaluation indicators can be set in advance for custom deletion.
[0353] The evaluation indicators corresponding to custom deletion include the following situations:
[0354] 1. The evaluation index corresponding to custom deletion is the image parameter index selected by the user.
[0355] 2. Defining the deletion corresponding evaluation index includes the image parameter index selected by the user and the image parameter index not selected by the user, wherein the parameter weight of the image parameter index selected by the user is greater than the parameter weight of the image parameter index not selected.
[0356] 3. The evaluation indicators corresponding to the custom deletion include the overall evaluation indicators and the evaluation indicators in the above situation 1 or 2.
[0357] For easy distinction, the evaluation index corresponding to the custom deletion is named the second index. The text pair corresponding to the second index is determined, and features are extracted from the text pair corresponding to the second index to obtain a text feature vector corresponding to the second index, and the text feature vector corresponding to the second index is used as the text feature vector corresponding to the custom deletion.
[0358] In an embodiment of the present application, when at least one evaluation index includes multiple pairs of text pairs in the second index corresponding to the custom deletion, the weights of the multiple pairs of text pairs are determined. For example, according to the above-mentioned weight optimization method, for any second index including multiple pairs of text pairs, the optimal weight of the text pair in the second index is determined, and the optimal weight is used as the weight of the text pair in the second index. The weight of the text pair corresponding to the custom deletion includes the weights of the text pairs in all second indicators. If the second indicator includes evaluation indicators a and b, the weight of the text pair corresponding to the custom deletion includes the weight of the text pair in evaluation indicator a and the weight of the text pair in evaluation indicator b.
[0359] Step S148, calculating the similarity based on the image feature vector and the text feature vector corresponding to the custom deletion.
[0360] Step S149, obtaining a corresponding total similarity score according to the similarity.
[0361] Step S150, obtaining an evaluation score according to the total similarity score and the weight of the text pair corresponding to the custom deletion.
[0362] Step S151: when it is a personalized deletion, obtain the first text pair.
[0363] In the embodiment of the present application, whether it is a personalized deletion can be determined based on the user's input.
[0364] In the embodiment of the present application, the electronic device determines that the current deletion is personalized in response to the input to the text input box 107. In response to the input to the text input box 107, the text or text pair input by the user is obtained.
[0365] The first text pair may be a text pair input by a user, or a text pair constructed according to text input by a user.
[0366] Exemplarily, the user inputs the text "bright color", and a text pair ["bright color", "bright color"] may be set for the text "bright color".
[0367] Step S152: extract features from the first text pair to obtain a corresponding text feature vector.
[0368] Step S153: determining the text pair weight corresponding to the first text pair.
[0369] When the first text pair includes multiple text pairs, it can be obtained whether the weight of each text pair is preset, and if so, the pre-configured weight is used as the text pair weight corresponding to the first text pair. If not, the weights of each text pair in the first text can be evenly divided.
[0370] Step S154, calculating the similarity based on the image feature vector and the text feature vector corresponding to the first text pair.
[0371] Step S155, obtaining a corresponding total similarity score according to the similarity.
[0372] Step S156: obtaining an evaluation score according to the total similarity score and the text pair weight corresponding to the first text pair.
[0373] In the embodiment of the present application, corresponding scoring can be performed according to the user's input to perform personalized scoring, which can meet different scenarios and different needs.
[0374] The present application also provides an electronic device, which includes Figure 6The hardware and software shown. In some other embodiments, the electronic device includes at least: one or more processors and one or more memories. The processor includes a central processing unit and a graphics processing unit. The one or more memories are coupled to the one or more processors, and the one or more memories store computer instructions; when the one or more processors execute the computer instructions, the electronic device executes the above-mentioned image processing method.
[0375] See also Fig.19 , Fig.19 A schematic diagram of a chip system structure provided in an embodiment of the present application.
[0376] Fig.19 A schematic diagram of the composition of a chip system 1600 is shown. The chip system 1600 may include: a processor 1601 and a communication interface 1602, which are used to support related devices to implement the functions involved in the above embodiments. In a possible design, the chip system also includes a memory for storing program instructions and data necessary for the electronic device. The chip system may be composed of chips, or may include chips and other discrete devices. It should be noted that in some implementations of the present application, the communication interface 1602 may also be referred to as an interface circuit.
[0377] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0378] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the image processing method in the above-mentioned method embodiments.
[0379] An embodiment of the present application further provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the image processing method as described in the above embodiment.
[0380] Among them, the electronic device, computer storage medium, computer program product or chip system provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0381] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0382] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0383] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0384] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0385] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0386] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.
Claims
1. An image processing method, characterized in that: Applied to an electronic device, the electronic device includes a scoring model, the scoring model includes an image encoder, and the method includes: Performing image segmentation on the first image to obtain images of various regions; Performing feature extraction on each of the regional images based on the image encoder to obtain a first image feature vector corresponding to each of the regional images; Obtaining text feature vectors corresponding to the text pairs, wherein the number of text pairs corresponding to the same evaluation index is one or more pairs; Obtaining a total similarity score corresponding to the text pair according to the similarity between the first image feature vector and the text feature vector; For any evaluation index, obtaining the evaluation score of the regional image with respect to the evaluation index according to the weight of the text pair in the evaluation index and the corresponding total similarity score; The processing result of the first image is obtained according to the evaluation scores of each of the regional images.
2. The image processing method according to claim 1, characterized in that: There is at least one evaluation indicator corresponding to multiple text pairs, the weights of the text pairs in the evaluation indicator include L weights corresponding to L pairs of text pairs one by one, the L pairs of text pairs correspond to the same first target evaluation indicator, and L is an integer greater than or equal to 2; The obtaining, according to the similarity between the first image feature vector and the text feature vector, a total similarity score corresponding to the text pair comprises: According to the similarity between the first image feature vector and the text feature vectors corresponding to the L pairs of text pairs, obtaining L total similarity scores corresponding to the L pairs of text pairs one by one; The step of obtaining the evaluation score of the regional image with respect to the evaluation index according to the weight of the text pair in the evaluation index and the corresponding total similarity score comprises: A weighted sum is performed on the L total similarity scores and the L weights to obtain an evaluation score of the regional image with respect to the first target evaluation index.
3. The image processing method according to claim 1 or 2, characterized in that: The evaluation index includes an overall evaluation index and an image parameter index, and the text feature vector includes a first text feature vector corresponding to the image parameter index and a second text feature vector corresponding to the overall evaluation index; The extracting features of each of the regional images based on the image encoder comprises: Performing feature extraction on each of the regional images and the first image based on the image encoder to obtain a first image feature vector corresponding to each of the regional images and a second image feature vector corresponding to the first image; The obtaining, according to the similarity between the first image feature vector and the text feature vector, a total similarity score corresponding to the text pair comprises: Obtaining a corresponding first total similarity score according to the similarity between the first image feature vector and the first text feature vector; The step of obtaining the evaluation score of the regional image with respect to the evaluation index according to the weight of the text pair in the evaluation index and the corresponding total similarity score comprises: Obtaining a first evaluation score of the regional image with respect to the image parameter index according to the weight of the text pair in the image parameter index and the corresponding first total similarity score; The processing result of obtaining the first image according to the evaluation scores of each of the regional images includes: For each of the regional images, obtaining a corresponding second total similarity score according to the similarity between the first image feature vector and the second text feature vector; Obtaining a regional total score according to the first evaluation score and the second total similarity score of each regional image; Obtaining a third total similarity score of the first image according to the similarity between the second image feature vector and the second text feature vector; The total score of the first image is obtained according to the third total similarity score of the first image and the region total score.
4. The image processing method according to claim 3, characterized in that: The obtaining of the total regional score according to the first evaluation score and the second total similarity score of each regional image comprises: Get parameter weights of image parameter indicators; Obtaining a first regional score of the regional image according to a parameter weight of the image parameter index and a first evaluation score of the regional image with respect to the image parameter index; Obtaining a second region score of the region image according to the first region score of the region image and the second total similarity score; A regional total score is obtained according to the second regional score of each regional image.
5. The image processing method according to claim 4, characterized in that: Obtaining a first regional score of the regional image according to the parameter weight of the image parameter index and the first evaluation score of the regional image with respect to the image parameter index comprises: Performing a weighted summation on the parameter weight of the image parameter index and the first evaluation score of the regional image with respect to the image parameter index to obtain a first regional score of the regional image; The obtaining, according to the first region score of the region image and the second total similarity score, a second region score of the region image comprises: Adding the first region score of the region image and the second total similarity score to obtain a second region score of the region image; The obtaining of the regional total score according to the second regional score of each regional image comprises: Obtain the regional weight of each regional image; The regional weight and the second regional score of each regional image are weightedly summed to obtain a regional total score.
6. The image processing method according to claim 3, characterized in that: The obtaining the total score of the first image according to the third total similarity score of the first image and the total score of the region includes: Get the overall weight and partial weight; Performing weighted calculation on the overall weight and the third total similarity score to obtain a first weighted score; Performing weighted calculation on the partial weight and the total score of the region to obtain a second weighted score; A total score of the first image is obtained according to the first weighted score and the second weighted score.
7. The image processing method according to claim 1 or 2, characterized in that: The method further comprises: Obtaining initial weights of P pairs of texts, where P is an integer greater than or equal to 2, and the P pairs of texts correspond to the same second objective evaluation indicator; Acquire a first training image and a second training image, wherein the second target evaluation index of the first training image is better than that of the second training image; Obtaining an evaluation score of the first training image with respect to the second target evaluation index according to initial weights of the first training image and the P pairs of texts; Obtaining an evaluation score of the second training image with respect to the second target evaluation index according to the initial weights of the second training image and the P pairs of texts; Obtaining a first difference value according to a difference value between the evaluation scores of the first training image and the second training image with respect to the second target evaluation index; Obtaining a first annotation score of the first training image and a second annotation score of the second training image, wherein both the first annotation score and the second annotation score are related to the second target evaluation index; Obtaining a second difference value according to a difference value between the first annotation score and the second annotation score; constructing an objective function according to the first difference and the second difference; Determining the optimal weights of the P pairs of texts according to the objective function; The optimal weights of the P pairs of text pairs are used as the weights of the text pairs in the second target evaluation index.
8. The image processing method according to claim 1 or 2, characterized in that: The method further comprises: Performing image segmentation on the second image to obtain sub-images, wherein the shooting scenes of the first image and the second image are similar, and the first image and the second image are images shot by different electronic devices respectively; Determining a target sub-image matching the regional image; For any of the evaluation indicators, a comparison result between the region image and the target sub-image with respect to the evaluation indicator is output according to the evaluation score of the region image with respect to the evaluation indicator and the evaluation score of the target sub-image with respect to the evaluation indicator.
9. The image processing method according to claim 3, characterized in that: The method further comprises: Obtaining a first input, where the first input indicates intelligent deletion of K images of the electronic device, where K is an integer greater than or equal to 2; In response to the first input, obtaining total scores of the K images; Delete the remaining images except the target image among the K images, wherein the target image has the highest total score.
10. The image processing method according to claim 4, characterized in that: The method further comprises: Obtaining a second input, where the second input indicates deleting H images of the electronic device according to a target image parameter indicator, where H is an integer greater than or equal to 2; In response to the second input, obtaining a total score of the H images according to the parameter weight of the target image parameter indicator and the parameter weights of other image parameter indicators, wherein the parameter weight of the target image parameter indicator is greater than the parameter weights of other image parameter indicators; Delete the remaining images except the target image from the H images, and the target image has the highest total score.
11. The image processing method according to claim 1, characterized in that: The scoring model also includes a text encoder; The obtaining of the text feature vector corresponding to the text pair comprises: In response to text input, obtaining an input text pair; Based on the text encoder, feature extraction is performed on the input text pair to obtain a text feature vector corresponding to the text pair.
12. The image processing method according to claim 3, characterized in that: The image parameter indicators include one or more of the following: noise, clarity, brightness, saturation, color cast, focus, contrast, sharpness, tone, three-dimensional effect and light effect.
13. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories; the one or more memories are coupled to the one or more processors, and the one or more memories store computer instructions; when the one or more processors execute the computer instructions, the electronic device executes the image processing method as described in any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises computer instructions, and when the computer instructions are executed, the image processing method according to any one of claims 1 to 12 is executed.
15. A chip system, characterized in that: The chip system includes a processor and a communication interface; the processor is used to call and run a computer program stored in a storage medium from the storage medium to execute the image processing method as described in any one of claims 1 to 12.
