Text box position determination method and device, electronic equipment and storage medium

By determining similar images from the sample image set and using the aesthetic quality scoring model, the problem of poor text box position determination in the prior art is solved, accurate recommendation of the text box position in the image to be processed is achieved, and the user's diverse needs are met.

CN118675176APending Publication Date: 2024-09-20XINGIN INFORMATION TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410830534.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

In the prior art, it is difficult to meet users' diverse text box design needs only through blank area detection, and it is impossible to effectively determine the appropriate text box position.

Method used

By obtaining the image features of the image to be processed, similar sample images are determined from the pre-constructed sample image set, and the pre-trained aesthetic quality scoring model is used to determine the recommended text frame based on the aesthetic quality score and position information of the candidate text frame. Location.

Benefits of technology

It achieves accurate and effective determination of the position of the text box in the image to be processed, meets the diverse design needs of users, and improves the accuracy and user experience of text box recommendation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675176A
    Figure CN118675176A
Patent Text Reader

Abstract

The invention discloses a textbox position determination method and device, electronic equipment and a storage medium, and relates to the technical field of image processing. The position information of the recommended textbox in the to-be-processed image can be determined based on the recommendation degree of each candidate textbox, and diversified design requirements of users can be met. The method comprises the following steps: acquiring a to-be-processed image; determining a plurality of sample images similar to the to-be-processed image from a pre-constructed sample image set according to the image features of the to-be-processed image; according to the textbox position information of the plurality of sample images, determining position information of candidate textboxes of the to-be-processed image; for each candidate textbox, inputting the to-be-processed image and the position information of the candidate textbox into a pre-trained aesthetic quality scoring model to obtain an aesthetic quality score of the candidate textbox output by the aesthetic quality scoring model; and based on the aesthetic quality score and the position information of each candidate textbox, determining the position information of a recommended textbox in the to-be-processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, electronic device, and storage medium for determining the position of a text box. Background Art

[0002] Currently, in order to enable the images posted by users to carry more information, users can find a suitable text area in the image and place the relevant information to be carried in the text area.

[0003] In related technologies, a blank area detection method can be used to find a suitable copy area. Specifically, the terminal can detect the blank area on the image, and thus determine the blank area as the copy area.

[0004] However, in the above method, only detecting blank areas may not meet the diverse design needs of users. Summary of the Invention

[0005] The present application provides a method, device, electronic device and storage medium for determining the position of a text box, which can determine the position information of the recommended text box in the image to be processed based on the recommendation level of each candidate text box, and can meet the diverse design needs of users.

[0006] In a first aspect, the present application provides a method for determining the position of a text box, the method comprising: obtaining an image to be processed; determining multiple sample images similar to the image to be processed from a pre-constructed sample image set based on image features of the image to be processed; wherein the sample images in the sample image set have corresponding text box position information; determining the position information of candidate text boxes of the image to be processed based on the text box position information of the multiple sample images; for each of the candidate text boxes: inputting the image to be processed and the position information of the candidate text box into a pre-trained aesthetic quality scoring model to obtain the aesthetic quality score of the candidate text box output by the aesthetic quality scoring model, the aesthetic quality score of each candidate text box being used to characterize the degree of recommendation of the candidate text box in the image to be processed; and determining the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box.

[0007] In a second aspect, the present application provides a device for determining the position of a text box, which includes an acquisition module, a determination module and a processing module; the acquisition module is used to acquire an image to be processed; the determination module is used to determine multiple sample images similar to the image to be processed from a pre-constructed sample image set based on the image features of the image to be processed; wherein the sample images in the sample image set have corresponding text box position information; the determination module is also used to determine the position information of the candidate text boxes of the image to be processed based on the text box position information of the multiple sample images; the processing module is used to, for each candidate text box: input the image to be processed and the position information of the candidate text box into a pre-trained aesthetic quality scoring model to obtain the aesthetic quality score of the candidate text box output by the aesthetic quality scoring model, the aesthetic quality score of each candidate text box is used to characterize the recommendation degree of the candidate text box in the image to be processed; the determination module is also used to determine the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box.

[0008] In a third aspect, an electronic device is provided, comprising: a processor and a memory; the memory is used to store a computer program, and when the processor executes the computer program, the electronic device executes the method described in the first aspect.

[0009] In a fourth aspect, a computer-readable storage medium is provided, comprising: a computer program or instructions; when the computer program or instructions are run on an electronic device, the electronic device executes the method described in the first aspect.

[0010] In a fifth aspect, a computer program product is provided, comprising a computer program or instructions, which, when executed on an electronic device, causes the electronic device to execute the method described in the first aspect.

[0011] The present application provides a method, device, electronic device, and storage medium for determining the position of a text box. The electronic device can determine multiple sample images similar to the image to be processed from a pre-constructed sample image set based on the image features of the image to be processed; and after determining the position information of the candidate text boxes of the image to be processed based on the text box position information of the multiple sample images, the image to be processed and the position information of each candidate text box are input into a pre-trained aesthetic quality model, thereby accurately and effectively determining the aesthetic quality score of each candidate text box. Since the aesthetic quality score of each candidate text box is used to characterize the degree of recommendation of the candidate text box in the image to be processed, the electronic device can determine the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box, thereby meeting the diverse design needs of users.

[0012] It will be understood that the above general description and the following detailed description are merely exemplary and explanatory and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 This is a scenario diagram of a text box position determination system provided by an embodiment of the present application;

[0015] Figure 2 This is a flow chart of a method for determining the position of a text box provided in an embodiment of the present application;

[0016] Figure 3 This is another flowchart of the method for determining the position of a text box provided in an embodiment of the present application;

[0017] Figure 4 This is a structural diagram of a device for determining the position of a text box provided in an embodiment of the present application;

[0018] Figure 5 This is another structural diagram of the text box position determination device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to enable ordinary people in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0020] It is understood that the terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0021] It will also be understood that the term “comprising” indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements and / or components.

[0022] The text box location determination method provided in the embodiment of the present application can be applied to the text box recommendation scenario. Specifically, when a user is about to publish an image (e.g., an image to be processed) or a note related to the image, a text box recommendation option may be displayed in the display interface of the electronic device (specifically, an interface related to a certain application). After the user clicks on the text box recommendation option, the electronic device may display a recommended text box to the user. The user can then enter the corresponding text information in the recommended text box.

[0023] In one example, the electronic device that executes the text box location determination method provided in an embodiment of the present application can be a terminal, which can also be called user equipment (UE), access terminal, subscriber unit (subscriberunit), subscriber station, mobile station (MS), mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device. The terminal in the embodiments of the present application can be a mobile phone, a cellular phone, a smart phone, a tablet computer, a wireless data card, a personal digital assistant (PDA), a wireless modem, a handset, a laptop computer, a machine type communication (MTC) terminal, a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a smart home device (for example, a refrigerator, a television, an air conditioner, an electric meter, etc.), an intelligent robot, a robotic arm, a workshop equipment, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical care, 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, a vehicle-mounted terminal, a roadside unit with terminal function, or a wireless terminal in a smart city. unit, RSU), etc., flying equipment (e.g., intelligent robots, hot air balloons, drones, airplanes), etc. The terminal may also be other devices with terminal functions, for example, the terminal may also be a device that functions as a terminal in device-to-device (D2D) communication.

[0024] In another example, the above-mentioned electronic device can also be a server, which can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (content delivery network, CDN), as well as big data and artificial intelligence platforms.

[0025] like Figure 1 As shown, an embodiment of the present application provides a text box location determination system, which may include at least one terminal, at least one server, at least one database, and a network. The terminal held by a user can be connected to the servers of different applications via the network. The terminal is any device with computing hardware that can support and execute the software product corresponding to the game. In addition, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can be connected to each other through different networks and different servers. The network can be a wireless network or a wired network, such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different terminals can also use their own Bluetooth network or hotspot network to connect to other terminals or servers, etc. For example, multiple users can be online through different terminals and thus connected and synchronized with each other through appropriate networks to support multiple users using the same application. In addition, the text box location determination system may include multiple databases, multiple databases coupled to different servers, and information related to the application can be continuously stored in the database when different users are online and using the application.

[0026] In one embodiment, a terminal that executes the method for determining the position of a text box provided in an embodiment of the present application may include a touch screen and a processor (of course, the terminal may also use peripherals such as a mouse and keyboard as input devices, and the touch screen is used as an example for illustration here). The touch screen is used to present a graphical user interface (such as a merchant page or a store filter page) and receive operation instructions generated by the user acting on the graphical user interface. When the user operates the graphical user interface through the touch screen, the graphical user interface can control the local content of the terminal in response to the received operation instructions, or control the content of the peer server in response to the received operation instructions. For example, the operation instructions generated by the user acting on the graphical user interface include instructions for starting an application, and the processor is configured to start the application after receiving the instruction to start the application provided by the user. In addition, the processor is configured to render and draw the graphical user interface associated with the application on the touch screen. The touch screen is a multi-touch sensitive screen that can sense touch or sliding operations performed simultaneously at multiple points on the screen. The user uses a finger to perform a touch operation on the graphical user interface. When the graphical user interface detects the touch operation, it controls the graphical user interface to display an action corresponding to the touch operation.

[0027] It is understandable that Figure 1 The text box position determination system provided in the embodiment of the present application is only an example in the embodiment of the present application. The text box position determination system and the corresponding scenario described in the embodiment of the present application are for more clearly illustrating the technical solution provided in the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0028] like Figure 2 As shown, an embodiment of the present application provides a method for determining the position of a text box, which is executed by an electronic device and includes S201-S205.

[0029] S201: Obtain an image to be processed.

[0030] It should be understood that the image to be processed may be any image, or any image without a text box.

[0031] S202: Determine a plurality of sample images similar to the image to be processed from a pre-constructed sample image set according to image features of the image to be processed.

[0032] The sample images in the sample image set have corresponding text box position information.

[0033] In some embodiments, the electronic device can determine the similarity between the image to be processed and each sample image in the sample image set based on the image features of the image to be processed and the image features of each sample image in the sample image set, thereby determining multiple sample images similar to the image to be processed based on the similarity between the image to be processed and each sample image.

[0034] Specifically, in one case, the electronic device may determine, from the sample image set, multiple sample images with similarities greater than a threshold as multiple sample images similar to the image to be processed based on the similarity between the image to be processed and each sample image in the sample image set.

[0035] It should be understood that if the similarity between the image to be processed and a sample image in the sample image set is greater than a threshold, it means that the similarity between the sample image and the image to be processed is high. At this time, the electronic device can determine the sample image as a sample image similar to the image to be processed.

[0036] In another case, the electronic device may also determine a preset number of sample images with the highest similarity from the sample image set as multiple sample images similar to the image to be processed based on the similarity between the image to be processed and each sample image in the sample image set.

[0037] It can be understood that the preset number of sample images with the highest similarity determined from the sample image set have a high degree of similarity with the image to be processed, so the electronic device can determine the preset number of sample images with the highest similarity as multiple sample images similar to the image to be processed.

[0038] In this embodiment, by determining the similarity between the image to be processed and each sample image in the sample image set, the electronic device can accurately and effectively determine the degree of similarity between the image to be processed and each sample image, thereby being able to conveniently and quickly determine multiple sample images similar to the image to be processed, thereby improving the efficiency of determining candidate text boxes.

[0039] Optionally, the similarity may be cosine similarity.

[0040] S203 : Determine the position information of the candidate text boxes of the image to be processed according to the text box position information of the plurality of sample images.

[0041] It should be understood that the text box location information of a sample image is the location information of the text box corresponding to the sample image, and one sample image corresponds to one text box. For multiple sample images similar to the image to be processed, the electronic device can determine the text box corresponding to one sample image as a candidate text box for the image to be processed, and thus can determine the text box location information of one sample image as the location information of a candidate text box for the image to be processed.

[0042] Alternatively, the position information of a candidate text box may be represented by the two-dimensional coordinates of the vertices included in the candidate text box. For example, the position information of the candidate text box may include the two-dimensional coordinates of the upper left vertex and the two-dimensional coordinates of the lower right vertex in the candidate text box. Alternatively, the position information of the candidate text box may include the two-dimensional coordinates of the upper right vertex and the two-dimensional coordinates of the lower left vertex in the candidate text box.

[0043] S204 , for each candidate text box: inputting the image to be processed and the position information of the candidate text box into a pre-trained aesthetic quality scoring model to obtain an aesthetic quality score of the candidate text box output by the aesthetic quality scoring model.

[0044] The aesthetic quality score of each candidate text box is used to represent the recommendation degree of the candidate text box in the image to be processed.

[0045] It should be understood that a higher aesthetic quality score for a candidate text box indicates a higher degree of recommendation for the candidate text box in the image to be processed, which can also be understood as indicating that the image to be processed containing the candidate text box has higher aesthetic quality or a richer aesthetic quality. Conversely, a lower aesthetic quality score for a candidate text box indicates a lower degree of recommendation for the candidate text box in the image to be processed, which can also be understood as indicating that the image to be processed containing the candidate text box has lower aesthetic quality or a less rich aesthetic quality.

[0046] S205 : Determine the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box.

[0047] It will be appreciated that, based on the aesthetic quality score of each candidate text box, the electronic device can determine the differences in recommendation levels corresponding to different candidate text boxes in the image to be processed. By using the recommendation level of each candidate text box in the image to be processed, the electronic device can determine which candidate text boxes have a higher recommendation level for the image to be processed, thereby more accurately determining recommended text boxes for the image to be processed.

[0048] In an embodiment of the present application, the electronic device can determine multiple sample images similar to the image to be processed from a pre-constructed sample image set based on the image features of the image to be processed; and after determining the position information of the candidate text boxes of the image to be processed based on the text box position information of the multiple sample images, the image to be processed and the position information of each candidate text box are input into a pre-trained aesthetic quality model, thereby accurately and effectively determining the aesthetic quality score of each candidate text box. Since the aesthetic quality score of each candidate text box is used to characterize the degree of recommendation of the candidate text box in the image to be processed, the electronic device can determine the position information of the recommended text boxes in the image to be processed based on the aesthetic quality score and position information of each candidate text box, thereby meeting the diverse design needs of users.

[0049] Combine Figure 2 ,like Figure 3 In one implementation of the embodiment of the present application, the above-mentioned determination of the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box may specifically include S2051-S2052.

[0050] S2051. Based on the aesthetic quality score of each candidate text box, select q candidate text boxes with the highest aesthetic quality scores from each candidate text box.

[0051] Wherein, q is a positive integer.

[0052] It should be understood that the electronic device selects q candidate text boxes with the highest aesthetic quality scores from each candidate text box, that is, selects q candidate text boxes with the highest corresponding recommendation degrees from each candidate text box.

[0053] S2052: Determine the position information of the recommended text box in the image to be processed based on the aesthetic quality scores and position information of the q candidate text boxes.

[0054] It is understandable that since the q candidate text boxes are the candidate text boxes with the highest aesthetic quality scores (or correspondingly the highest recommendation levels) among the candidate text boxes in the image to be processed, the electronic device can determine the recommended text boxes with the highest recommendation levels for the image to be processed based on the aesthetic quality scores and position information of each of the q candidate text boxes, thereby improving the accuracy of determining the position information of the recommended text boxes.

[0055] In some embodiments, the above-mentioned determination of the position information of the recommended text box in the image to be processed based on the aesthetic quality scores and position information of each of the q candidate text boxes can be achieved through the following S2052a-S2052b.

[0056] S2052a: Determine a first candidate text box from the q candidate text boxes based on the respective position information of the q candidate text boxes.

[0057] There is no overlapping area between the first candidate text box and other candidate text boxes.

[0058] It should be understood that the electronic device may determine whether there is an overlapping area between any two text boxes among the q candidate text boxes, thereby determining the first candidate text box.

[0059] It is understandable that the number of the first candidate text boxes may be one or more. The embodiment of the present application does not specifically limit the number of the first candidate text boxes.

[0060] S2052b: When the aesthetic quality score of the first candidate text box is greater than a preset score threshold, use the position information of the first candidate text box as the position information of the recommended text box.

[0061] In this embodiment, if the aesthetic quality score of the first candidate text box exceeds a preset score threshold, it indicates that the aesthetic quality score of the first candidate text box is high, specifically, the first candidate text box has a high degree of recommendation in the image to be processed. In this way, the electronic device uses the position information of the first candidate text box as the position information of the recommended text box, thereby improving the effectiveness of text box recommendations and accurately determining the position information of the recommended text box in the image to be processed.

[0062] In other embodiments, the above-mentioned determination of the position information of the recommended text box in the image to be processed based on the aesthetic quality scores and position information of each of the q candidate text boxes can also be implemented through the following S2052c-S2052d.

[0063] S2052c: Based on the position information of each of the q candidate text boxes, determine m second candidate text boxes from the q candidate text boxes.

[0064] There is an overlapping area between the m second candidate text boxes, and m is an integer greater than or equal to 2.

[0065] Specifically, the electronic device can determine whether there is an overlapping area between the q candidate text boxes (or between any two candidate text boxes included in the q candidate text boxes) based on the respective position information of the q candidate text boxes, thereby determining the m second candidate text boxes.

[0066] S2052d: Based on the aesthetic quality scores of the m second candidate text boxes, the position information of the second candidate text box with the highest aesthetic quality score among the m second candidate text boxes is used as the position information of the recommended text box.

[0067] In this embodiment, if a particular second candidate text box among the m second candidate text boxes has the highest aesthetic quality score, it indicates that the second candidate text box is most highly recommended in the image to be processed. In this case, the electronic device uses the position information of the second candidate text box with the highest aesthetic quality score as the position information of the recommended text box, thereby recommending a more appropriate text box for the image to be processed and improving the user experience of the image to be processed.

[0068] In another implementation of the embodiment of the present application, the above-mentioned determination of the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box may further include S2053.

[0069] S2053: Based on the aesthetic quality score of each candidate text box, the position information of the candidate text box with the highest aesthetic quality score among all candidate text boxes is used as the position information of the recommended text box.

[0070] Optionally, the electronic device may perform non-maximum suppression (NMS) processing on each candidate text box based on the aesthetic quality score of each candidate text box, thereby screening out the candidate text box with the highest aesthetic quality score.

[0071] It is understood that by selecting the candidate text box with the highest aesthetic quality score from each candidate text box, the electronic device can determine the corresponding candidate text box with the highest recommendation level. Using the position information of the candidate text box with the highest aesthetic quality score as the position information of the recommended text box can ensure that the candidate text box with the highest recommendation level is selected as the recommended text box in the image to be processed, thereby accurately and efficiently determining the position information of the recommended text box.

[0072] In some embodiments, the sample image set is constructed by following steps A-C:

[0073] Step A: Acquire multiple original images.

[0074] The original image is an image with a text box.

[0075] Optionally, the multiple original images may be poster images.

[0076] Step B: remove the text box of each original image to obtain a sample image corresponding to each original image.

[0077] In combination with the description of the above embodiment, it should be understood that the sample image may be an image without a text box.

[0078] In the embodiments of the present application, the process of removing the text box from each original image by the electronic device can also be understood as the electronic device performing image reconstruction (or image redrawing) on ​​each original image. Specifically, the electronic device repairs the area corresponding to the text box, removes the text box and the text contained in the text box, and restores the image to obtain a sample image.

[0079] Optionally, the electronic device may perform image reconstruction processing on each original image through a stable diffusion model (SD).

[0080] Step C: constructing a sample image set based on the multiple original images and the sample image corresponding to each of the multiple original images.

[0081] Optionally, one original image may correspond to one sample image. Specifically, the sample image set may include multiple samples, wherein one sample includes one original image and one sample image (ie, the sample image corresponding to the original image).

[0082] In an embodiment of the present application, after acquiring multiple original images, the electronic device can remove the text box of each original image to obtain a sample image corresponding to each original image; finally, based on the multiple original images and the sample images corresponding to each original image, a sample image set can be conveniently and quickly constructed, thereby improving the efficiency of determining multiple sample images similar to the image to be processed.

[0083] In one implementation of the embodiment of the present application, the above-mentioned construction of the sample image set based on multiple original images and the sample image corresponding to each of the multiple original images can be implemented by the following steps D-E.

[0084] Step D: For each original image, determine the text box position information of the original image, and use the text box position information of the original image as the text box position information of the sample image corresponding to the original image.

[0085] Optionally, after acquiring multiple original images, the electronic device may determine and acquire the position information of the text box included in each original image by manual annotation, that is, determine the text box position information of each original image.

[0086] Step E: constructing a sample image set based on the multiple original images, the sample image corresponding to each of the multiple original images, and the text box position information of the sample image corresponding to each of the multiple original images.

[0087] Specifically, a sample included in the sample image set includes an original image, a sample image (ie, the sample image corresponding to the original image), and text box position information (ie, the text box position information of the sample image).

[0088] Optionally, the original image included in the sample image set may specifically be pixel information of the original image, and the sample image included in the sample image set may specifically be pixel information of the sample image.

[0089] For example, the sample image set may satisfy the following formula:

[0090] D={d1,d2,...,d n}

[0091] Where D represents the sample image set, d1 represents the first sample, d2 represents the second sample, and d n Represents the nth sample, where n is a positive integer.

[0092] The nth sample satisfies the following formula:

[0093] d n =(img n ,box n ,img n sd )

[0094] Among them, d n Indicates the nth sample, img n Represents the nth original image, img n sd Indicates the nth sample image, box n Indicates the text box position information of the nth sample image, where the nth sample image is the sample image corresponding to the nth original image.

[0095] In an embodiment of the present application, by using the text box position information of each original image as the text box position information of the sample image corresponding to each original image, the text box position information of the sample image can be taken into consideration in the process of constructing the sample image set, thereby satisfying the process of determining the position information of the candidate text box for the image to be processed.

[0096] In an optional implementation, the above-mentioned construction of a sample image set based on multiple original images, sample images corresponding to each of the multiple original images, and text box position information of the sample images corresponding to each of the multiple original images can be implemented by the following steps E1-E2.

[0097] Step E1: Input the sample image corresponding to each original image into the image feature extraction model to obtain the image features of the sample image output by the image feature extraction model.

[0098] In some embodiments, the electronic device may also input the pixel information of each sample image into an image feature extraction model, that is, it may obtain the image feature of each sample image, and the image feature is used to characterize the pixel information of the sample image.

[0099] Optionally, the above-mentioned image feature extraction model can be a cross-model language image alignment model (contrastive language image pre-training, CLIP) model. The electronic device can extract features of a sample image through the image encoder in the CLIP model, that is, it can obtain the image features of the sample image.

[0100] Step E2: construct a sample image set based on multiple original images, sample images corresponding to each of the multiple original images, text box position information of the sample images corresponding to each of the multiple original images, and image features of the sample images corresponding to each of the multiple original images.

[0101] Specifically, for a certain sample included in the sample image set, the sample includes an original image, a sample image (the sample image corresponding to the original image), text box position information (the text box position information of the sample image) and an image feature (the image feature of the sample image).

[0102] Exemplarily, in combination with the example in step E above, the nth sample also satisfies the following formula:

[0103] d n =(img n ,box n ,img n sd ,emb n img )

[0104] Among them, d n Indicates the nth sample, img n Represents the nth original image, img n sd Indicates the nth sample image, box n Indicates the text box position information of the nth sample image, emb n img Represents the image features of the nth sample image, where the nth sample image is the sample image corresponding to the nth original image.

[0105] In an embodiment of the present application, the electronic device can add the image features of each sample image obtained by the image feature extraction model in the process of constructing the sample image set, so that based on the image features of each sample image, multiple sample images similar to the image to be processed can be conveniently and quickly determined from the sample image set, thereby improving the efficiency of determining the position information of the text box.

[0106] In some embodiments, the above aesthetic quality scoring model can be trained by the methods provided in the following steps F-G.

[0107] Step F: Obtain a training sample set.

[0108] The training sample set includes multiple training samples and labels for each training sample. Each training sample includes a sample image and location information of a text box. The sample image is an image without a text box, and the label of the training sample is an aesthetic quality score corresponding to the text box.

[0109] Step G: Based on the training sample set, the initial aesthetic quality scoring model is trained to obtain a trained aesthetic quality scoring model.

[0110] Specifically, the electronic device can input each training sample (including the sample image and the location information of the text box) into the initial aesthetic quality scoring model to obtain the predicted aesthetic quality score of each text box output by the initial aesthetic quality scoring model; then the electronic device determines the loss function based on the predicted aesthetic quality score of each text box and the label of each training sample (that is, the aesthetic quality score corresponding to each text box), and updates the parameters in the initial aesthetic quality scoring model based on the loss function, so that a trained aesthetic quality scoring model can be obtained.

[0111] It should be understood that the above loss function is used to characterize the degree of inconsistency between the predicted aesthetic quality score of each text box and the label of each training sample.

[0112] Optionally, the aesthetic quality scoring model can be the open-source You Only Look Once (YOLO) model. The electronic device can perform target box regression prediction based on the YOLO model. Specifically, the YOLO model takes multiple training samples as input, and the regression target is the label of each training sample (i.e., the aesthetic quality score corresponding to each text box).

[0113] In an embodiment of the present application, after obtaining a training sample set, the electronic device can train an initial aesthetic quality scoring model based on the training sample set to obtain a trained aesthetic quality scoring model. Since the training sample set includes multiple training samples and labels for each training sample, each training sample includes a sample image and the location information of a text box, and the label of each training sample is the aesthetic quality score corresponding to the text box. That is, the electronic device trains the initial aesthetic quality scoring model based on each sample image, the location information of each text box, and the aesthetic quality score corresponding to each text box, and can obtain a trained aesthetic quality scoring model with higher prediction accuracy. Furthermore, based on the trained aesthetic quality scoring model, the aesthetic quality score of each candidate text box can be accurately and effectively determined.

[0114] In an optional implementation, the above-mentioned acquisition of the training sample set may specifically include steps H to J.

[0115] Step H: For each sample image in the sample image set, a text box is added to the sample image to obtain an expanded image corresponding to the sample image.

[0116] It should be understood that the process in which the electronic device adds a text box to the sample image to obtain the expanded image corresponding to the sample image can also be understood as the process in which the electronic device performs data expansion on the sample image.

[0117] Specifically, for a sample image, the electronic device may randomly sample at least one text box around the text box corresponding to the sample image (i.e., the text box included in the original image corresponding to the sample image), thereby obtaining an expanded image corresponding to the sample image. In other words, a sample image may correspond to one or more expanded images.

[0118] Step I: Determine the aesthetic quality score of the text box in the expanded image based on the position information of the text box in the expanded image corresponding to the sample image and the position information of the text box in the original image corresponding to the sample image.

[0119] The original image is an image with a text frame, and the sample image corresponding to the original image is obtained by removing the text frame from the original image.

[0120] In combination with the description of the above embodiment, it should be understood that after acquiring multiple original images, the electronic device can remove the text box of each original image, thereby obtaining a sample image corresponding to each original image.

[0121] In an optional implementation, the electronic device may determine an intersection-over-union (IoU) ratio between the text box in the expanded image and the text box in the original image based on the position information of the text box in the expanded image and the position information of the text box in the original image. The IoU ratio between the text box in the expanded image and the text box in the original image may be used as an aesthetic quality score for the text box in the expanded image.

[0122] In this implementation, the aesthetic quality score of the text box in the expanded image can also be understood as the overlap of the text box in the expanded image, specifically the degree of overlap between the text box in the expanded image and the text box in the original image. The degree of overlap can be determined by the intersection-over-union ratio.

[0123] Specifically, the aesthetic quality score of a text box in an expanded image can satisfy the following formula:

[0124]

[0125] Among them, overlap m Indicates the aesthetic quality score of the text box in the mth expanded image corresponding to the nth sample image, box n Indicates the text box position information of the nth original image, Indicates the position information of the text box in the mth expanded image, It represents the intersection-over-union ratio between the text box in the mth expanded image and the text box in the nth original image, where m and n are both positive integers, and the nth sample image is the sample image corresponding to the nth original image.

[0126] Therefore, by adding a text box to the n-th sample image, the expanded image corresponding to the n-th sample image can satisfy the following formula:

[0127]

[0128] in, Indicates the expanded image corresponding to the nth sample image, box1 n Indicates the position information of the text box in the first expanded image corresponding to the nth sample image, overlap1 indicates the aesthetic quality score of the text box in the first expanded image, Indicates the position information of the text box in the second expanded image corresponding to the nth sample image, overlap2 indicates the aesthetic quality score of the text box in the second expanded image, Indicates the position information of the text box in the mth expanded image corresponding to the nth sample image, overlap m represents the aesthetic quality score of the text box in the mth expanded image, where m and n are both positive integers.

[0129] Alternatively, the electronic device may determine the number of pixels included in the text box in the expanded image based on the position information of the text box in the expanded image, and determine the number of pixels included in the text box in the original image based on the position information of the text box in the original image. Subsequently, the electronic device may determine an intersection-over-union ratio between the text box in the expanded image and the text box in the original image based on the number of pixels included in the text box in the expanded image and the number of pixels included in the text box in the original image.

[0130] In an embodiment of the present application, the electronic device can accurately and effectively characterize the degree of overlap (or distance) between the text box in the expanded image and the text box in the original image by determining the intersection-over-union ratio between the text box in the expanded image and the text box in the original image as the aesthetic quality score of the text box in the expanded image, thereby accurately and effectively characterizing the aesthetic quality corresponding to the text box in the expanded image.

[0131] Step J: Use the position information of the text boxes in the sample image and the expanded image as a training sample, and use the aesthetic quality score of the text box in the expanded image as the label corresponding to the training sample.

[0132] In conjunction with the description of the above embodiments, it should be understood that the multiple training samples and the labels of each training sample constitute the above training sample set, which can also be understood as a data set for the aesthetic quality scoring model.

[0133] Exemplarily, in combination with the example in step I above, the training sample set may satisfy the following formula:

[0134]

[0135] Among them, F represents the training sample set, img1 represents the first original image, box1 represents the text box position information of the first sample image, img1 sd Represents the first sample image, S b 1 ox Indicates the expanded image corresponding to the first sample image, img n Indicates the nth original image, box n Indicates the text box position information of the nth sample image, img n sd represents the nth sample image, S b n ox Represents the expanded image corresponding to the nth sample image, n is a positive integer, and the nth sample image is the sample image corresponding to the nth original image.

[0136] Specifically, the electronic device uses the position information of the text boxes in the sample image and the expanded image as a training sample, which can be understood as using the position information of the sample image and the text boxes in the expanded image as input to the aesthetic quality scoring model. The electronic device uses the aesthetic quality scores of the text boxes in the expanded image as the labels corresponding to the training samples, which can be understood as using the aesthetic quality score group of the text boxes in the expanded image as the confidence level of the text boxes in the expanded image in the aesthetic quality scoring model. By determining the input and confidence level of the aesthetic quality scoring model, the electronic device can train an aesthetic quality scoring model with high prediction accuracy.

[0137] Combined with the above Figures 1 to 3 , describes in detail the method for determining the position of the text box provided by this embodiment, and will now be combined with Figure 4-Figure 5 , describing the text box position determination device provided according to this embodiment.

[0138] like Figure 4 As shown, the device 40 for determining the position of a text box includes: an acquisition module 401 , a determination module 402 and a processing module 403 .

[0139] The acquisition module 401 is used to acquire the image to be processed.

[0140] The determination module 402 is configured to determine a plurality of sample images similar to the image to be processed from a pre-built sample image set according to the image features of the image to be processed; wherein the sample images in the sample image set have corresponding text box position information.

[0141] The determination module 402 is further configured to determine the position information of the candidate text boxes of the image to be processed based on the text box position information of the multiple sample images.

[0142] Processing module 403 is used to: for each candidate text box: input the position information of the image to be processed and the candidate text box into a pre-trained aesthetic quality scoring model, and obtain the aesthetic quality score of the candidate text box output by the aesthetic quality scoring model. The aesthetic quality score of each candidate text box is used to represent the recommendation level of the candidate text box in the image to be processed.

[0143] The determination module 402 is further configured to determine the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box.

[0144] Optionally, the determination module 402 is specifically configured to select q candidate text boxes with the highest aesthetic quality scores from each candidate text box based on the aesthetic quality score of each candidate text box, where q is a positive integer.

[0145] The determination module 402 is further specifically configured to determine the position information of the recommended text box in the image to be processed based on the aesthetic quality scores and position information of the q candidate text boxes.

[0146] Optionally, the determination module 402 is further specifically configured to determine a first candidate text box from the q candidate text boxes based on respective position information of the q candidate text boxes, where the first candidate text box has no overlapping area with other candidate text boxes.

[0147] The determination module 402 is further specifically configured to use the position information of the first candidate text box as the position information of the recommended text box when the aesthetic quality score of the first candidate text box is greater than a preset score threshold.

[0148] Optionally, the determination module 402 is further specifically configured to determine m second candidate text boxes from the q candidate text boxes based on respective position information of the q candidate text boxes, where there are overlapping areas between the m second candidate text boxes, and m is an integer greater than or equal to 2.

[0149] The determination module 402 is further specifically configured to use the position information of the second candidate text box with the highest aesthetic quality score among the m second candidate text boxes as the position information of the recommended text box based on the aesthetic quality scores of the m second candidate text boxes.

[0150] Optionally, the determination module 402 is specifically configured to use the position information of the candidate text box with the highest aesthetic quality score among the candidate text boxes as the position information of the recommended text box based on the aesthetic quality score of each candidate text box.

[0151] Optionally, the acquisition module 401 is further configured to acquire a plurality of original images, where the original images are images with text boxes.

[0152] The processing module 403 is further configured to remove the text box in each of the original images to obtain a sample image corresponding to each of the original images.

[0153] The processing module 403 is further configured to construct the sample image set based on the multiple original images and the sample image corresponding to each of the multiple original images.

[0154] Optionally, the determination module 402 is further configured to determine, for each original image, text box position information of the original image, and use the text box position information of the original image as the text box position information of the sample image corresponding to the original image.

[0155] The processing module 403 is specifically configured to construct the sample image set based on the multiple original images, the sample image corresponding to each of the multiple original images, and the text box position information of the sample image corresponding to each of the multiple original images.

[0156] Optionally, the determination module 402 is further configured to determine the similarity between the image to be processed and each sample image in the sample image set based on the image features of the image to be processed and the image features of each sample image in the sample image set.

[0157] Determination module 402 is further configured to, based on the similarity between the image to be processed and each sample image in the sample image set, determine from the sample image set a plurality of sample images having a similarity greater than a threshold as a plurality of sample images similar to the image to be processed. Alternatively, based on the similarity between the image to be processed and each sample image in the sample image set, determine from the sample image set a preset number of sample images having the highest similarity as a plurality of sample images similar to the image to be processed.

[0158] Optionally, the processing module 403 is specifically configured to input a sample image corresponding to each original image into an image feature extraction model to obtain image features of the sample image output by the image feature extraction model.

[0159] The processing module 403 is further specifically used to construct the sample image set based on the multiple original images, the sample images corresponding to each of the multiple original images, the text box position information of the sample images corresponding to each of the multiple original images, and the image features of the sample images corresponding to each of the multiple original images.

[0160] Optionally, the acquisition module 401 is also used to obtain a training sample set, which includes multiple training samples and a label for each training sample; each training sample includes a sample image and location information of a text box, and the sample image is an image without a text box; the label of the training sample is the aesthetic quality score corresponding to the text box.

[0161] The processing module 403 is further configured to train the initial aesthetic quality scoring model based on the training sample set to obtain a trained aesthetic quality scoring model.

[0162] Optionally, the processing module 403 is further configured to add a text box to each sample image in the sample image set to obtain an expanded image corresponding to the sample image.

[0163] Determination module 402 is further configured to determine an aesthetic quality score of the text box in the expanded image based on position information of the text box in the expanded image corresponding to the sample image and position information of the text box in the original image corresponding to the sample image; wherein the original image is an image having a text box, and the sample image corresponding to the original image is obtained by removing the text box from the original image.

[0164] The determination module 402 is further configured to use the position information of the sample image and the text box in the expanded image as a training sample, and use the aesthetic quality score of the text box in the expanded image as a label corresponding to the training sample.

[0165] Optionally, the determination module 402 is specifically configured to determine an intersection-over-union ratio between the text box in the expanded image and the text box in the original image based on the position information of the text box in the expanded image and the position information of the text box in the original image.

[0166] The determination module 402 is further specifically configured to use the intersection-over-union ratio between the text box in the expanded image and the text box in the original image as the aesthetic quality score of the text box in the expanded image.

[0167] As described above, the embodiment of the present application can divide the text box position determination device into functional modules according to the above method example. Among them, the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, it can be understood that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module.

[0168] Regarding the text box position determination device in the above embodiment, the specific manner in which each module performs operations and the beneficial effects it has have been described in detail in the above method embodiment and will not be repeated here.

[0169] Figure 5 This is a schematic diagram of the structure of another text box position determination device provided by this application. Figure 5 The text box position determination apparatus 50 may include at least one processor 501 and a memory 503 for storing processor-executable instructions. The processor 501 is configured to execute the instructions in the memory 503 to implement the text box position determination method in the above embodiment.

[0170] In addition, the text box position determination device 50 may further include a communication bus 502 and at least one communication interface 504 .

[0171] The processor 501 may be a central processing unit (CPU), a microprocessor unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the present application.

[0172] The communication bus 502 may include a pathway for transmitting information between the aforementioned components.

[0173] The communication interface 504 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0174] The memory 503 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be independent and connected to the processing unit via a bus. The memory may also be integrated with the processing unit.

[0175] The memory 503 is used to store instructions for executing the solution of the present application, and the execution is controlled by the processor 501. The processor 501 is used to execute the instructions stored in the memory 503, thereby realizing the functions of the method of the present application.

[0176] In a specific implementation, as an embodiment, the processor 501 may include one or more CPUs, such as Figure 5 CPU0 and CPU1 in.

[0177] In a specific implementation, as an embodiment, the text box position determination device 50 may include multiple processors, such as Figure 51 and 507. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0178] In a specific implementation, as an embodiment, the text box position determination device 50 may further include an output device 505 and an input device 506. The output device 505 communicates with the processor 501 and can display information in a variety of ways. For example, the output device 505 can be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 506 communicates with the processor 501 and can accept user input in a variety of ways. For example, the input device 506 can be a mouse, a keyboard, a touch screen device, or a sensor device.

[0179] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the text box position determination device 50, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0180] In addition, the present application also provides a computer-readable storage medium, including instructions, which, when executed by an electronic device, enable the electronic device to execute the text box position determination method provided in the above embodiment.

[0181] In addition, the present application also provides a computer program product, including instructions, which, when executed by an electronic device, enable the electronic device to execute the text box position determination method provided in the above embodiment.

[0182] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the claims.

Claims

1. A method for determining the position of a text box, characterized in that: The method comprises: Get the image to be processed; Determining a plurality of sample images similar to the image to be processed from a pre-constructed sample image set according to the image features of the image to be processed; wherein the sample images in the sample image set have corresponding text box position information; Determining the position information of the candidate text boxes of the image to be processed according to the text box position information of the multiple sample images; For each of the candidate text boxes: inputting the position information of the image to be processed and the candidate text box into a pre-trained aesthetic quality scoring model, obtaining the aesthetic quality score of the candidate text box output by the aesthetic quality scoring model, wherein the aesthetic quality score of each of the candidate text boxes is used to characterize the recommendation degree of the candidate text box in the image to be processed; Based on the aesthetic quality score and position information of each candidate text box, position information of the recommended text box in the image to be processed is determined.

2. The method according to claim 1, characterized in that: The step of determining the position information of the recommended text box in the image to be processed based on the aesthetic quality score and the position information of each candidate text box includes: Based on the aesthetic quality score of each candidate text box, selecting q candidate text boxes with the highest aesthetic quality scores from each candidate text box, where q is a positive integer; Based on the aesthetic quality scores and position information of the q candidate text boxes, position information of the recommended text box in the image to be processed is determined.

3. The method according to claim 2, characterized in that The determining the position information of the recommended text box in the image to be processed based on the aesthetic quality scores and position information of each of the q candidate text boxes includes: Based on the position information of each of the q candidate text boxes, determining a first candidate text box from the q candidate text boxes, where there is no overlapping area between the first candidate text box and other candidate text boxes; When the aesthetic quality score of the first candidate text box is greater than a preset score threshold, the position information of the first candidate text box is used as the position information of the recommended text box.

4. The method according to claim 2, characterized in that: The determining the position information of the recommended text box in the image to be processed based on the aesthetic quality scores and position information of each of the q candidate text boxes includes: Based on the position information of each of the q candidate text boxes, determine m second candidate text boxes from the q candidate text boxes, there is an overlapping area between the m second candidate text boxes, and m is an integer greater than or equal to 2; Based on the aesthetic quality scores of the m second candidate text boxes, the position information of the second candidate text box with the highest aesthetic quality score among the m second candidate text boxes is used as the position information of the recommended text box.

5. The method according to claim 1, characterized in that The step of determining the position information of the recommended text box in the image to be processed based on the aesthetic quality score and the position information of each candidate text box includes: Based on the aesthetic quality score of each of the candidate text boxes, the position information of the candidate text box with the highest aesthetic quality score among the candidate text boxes is used as the position information of the recommended text box.

6. The method according to claim 1, characterized in that The sample image set is constructed in the following way: Acquire multiple original images, wherein the original images are images with text boxes; Removing the text box in each of the original images to obtain a sample image corresponding to each of the original images; The sample image set is constructed based on the multiple original images and the sample image corresponding to each of the multiple original images.

7. The method according to claim 6, characterized in that The constructing the sample image set based on the multiple original images and the sample image corresponding to each of the multiple original images includes: For each of the original images, determining text box position information of the original image, and using the text box position information of the original image as text box position information of the sample image corresponding to the original image; The sample image set is constructed based on the multiple original images, the sample image corresponding to each of the multiple original images, and the text box position information of the sample image corresponding to each of the multiple original images.

8. The method according to claim 7, characterized in that The step of determining a plurality of sample images similar to the image to be processed from a pre-constructed sample image set according to the image features of the image to be processed comprises: Determining the similarity between the image to be processed and each sample image in the sample image set based on the image feature of the image to be processed and the image feature of each sample image in the sample image set; Based on the similarity between the image to be processed and each sample image in the sample image set, a plurality of sample images having a similarity greater than a threshold are determined from the sample image set as a plurality of sample images similar to the image to be processed; or Based on the similarity between the image to be processed and each sample image in the sample image set, a preset number of sample images with the highest similarity are determined from the sample image set as a plurality of sample images similar to the image to be processed.

9. The method according to claim 8, characterized in that The constructing the sample image set based on the multiple original images, the sample image corresponding to each of the multiple original images, and the text box position information of the sample image corresponding to each of the multiple original images includes: Inputting a sample image corresponding to each of the original images into an image feature extraction model to obtain image features of the sample image output by the image feature extraction model; The sample image set is constructed based on the multiple original images, the sample images corresponding to each of the multiple original images, the text box position information of the sample images corresponding to each of the multiple original images, and the image features of the sample images corresponding to each of the multiple original images.

10. The method according to any one of claims 1 to 9, characterized in that The aesthetic quality scoring model is trained in the following way: Acquire a training sample set, the training sample set comprising a plurality of training samples and a label of each training sample; each of the training samples comprises a sample image and location information of a text box, the sample image is an image without a text box; the label of the training sample is an aesthetic quality score corresponding to the text box; Based on the training sample set, the initial aesthetic quality scoring model is trained to obtain a trained aesthetic quality scoring model.

11. The method according to claim 10, characterized in that The step of obtaining a training sample set includes: For each sample image in the sample image set, a text box is added to the sample image to obtain an extended image corresponding to the sample image; Determine the aesthetic quality score of the text box in the extended image based on the position information of the text box in the extended image corresponding to the sample image and the position information of the text box in the original image corresponding to the sample image; wherein the original image is an image with a text box, and the sample image corresponding to the original image is obtained by removing the text box from the original image; The position information of the text boxes in the sample image and the extended image is used as a training sample, and the aesthetic quality score of the text box in the extended image is used as a label corresponding to the training sample.

12. The method according to claim 11, characterized in that Determining the aesthetic quality score of the text box in the extended image based on the position information of the text box in the extended image corresponding to the sample image and the position information of the text box in the original image corresponding to the sample image includes: Determining an intersection-over-union ratio between the text box in the expanded image and the text box in the original image based on the position information of the text box in the expanded image and the position information of the text box in the original image; The intersection-over-union ratio between the text box in the expanded image and the text box in the original image is used as the aesthetic quality score of the text box in the expanded image.

13. A device for determining the position of a text box, characterized in that: It includes an acquisition module, a determination module and a processing module; The acquisition module is used to acquire the image to be processed; The determination module is used to determine a plurality of sample images similar to the image to be processed from a pre-constructed sample image set according to the image features of the image to be processed; wherein the sample images in the sample image set have corresponding text box position information; The determination module is further used to determine the position information of the candidate text boxes of the image to be processed according to the text box position information of the multiple sample images; The processing module is used for: for each of the candidate text boxes: inputting the position information of the image to be processed and the candidate text box into a pre-trained aesthetic quality scoring model to obtain the aesthetic quality score of the candidate text box output by the aesthetic quality scoring model, wherein the aesthetic quality score of each of the candidate text boxes is used to characterize the recommendation degree of the candidate text box in the image to be processed; The determination module is further used to determine the position information of the recommended text box in the image to be processed based on the aesthetic quality score and position information of each candidate text box.

14. An electronic device, characterized in that: The electronic device comprises: Memory; Communication interface; one or more processors; Wherein, one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the text box position determination method as described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the method for determining the position of a text box as claimed in any one of claims 1 to 12.

16. A computer program product comprising instructions, characterized in that When the instruction is executed on an electronic device, the electronic device executes the method for determining the position of a text box as described in any one of claims 1 to 12.