Methods for determining the location of markers within an image, model training methods, devices and equipment

By generating feature maps of the target image and using a prediction model to determine the location of the markers, the problem of unreasonable marker placement within the image is solved, the accuracy and efficiency of marker placement are improved, and the aesthetics of the image are enhanced.

CN116681765BActive Publication Date: 2026-03-13BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-05
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, the placement of markers within images is often unreasonable, resulting in low setup efficiency and difficulty in ensuring the overall aesthetic appeal of the markers within the image.

Method used

By acquiring the target image, a first feature map is generated. The location of the marker is determined using a prediction model to ensure that the marker is located outside the target area and has a specific positional relationship with the area. A converter model with an encoder-decoder architecture is used for prediction.

Benefits of technology

It improves the accuracy of predicting sign location and the efficiency of setting it, ensures a reasonable relationship between signs and image elements, and enhances the overall visual effect of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116681765B_ABST
    Figure CN116681765B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, model training method, apparatus, and device for determining the location of an in-image identifier. The method involves acquiring a target image; processing the target image to obtain a first feature map, which indicates the target region containing at least one image element within the target image; and calling a first prediction model based on the first feature map to obtain the target location of the identifier to be inserted in the target image. The target location is located outside the target region and has a first positional relationship with the target region, determined based on the position of at least one image element within the target image. This reduces the training difficulty of the first prediction model and improves prediction accuracy, thereby solving the problems of unreasonable identifier location settings and low setting efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to a method for determining the location of markers within an image, a model training method, an apparatus, and a device. Background Technology

[0002] Images are a common medium for information dissemination and expression. By adding descriptive text and logos in appropriate places within an image, its content expression and visual appeal can be further enhanced.

[0003] In existing technologies, the process of adding markers to an image usually involves manually determining the marker position after obtaining the target image, and then adding the corresponding marker at that position. This results in problems such as unreasonable marker position settings and low setting efficiency. Summary of the Invention

[0004] This disclosure provides a method for determining the location of markers within an image, a model training method, an apparatus, and a device to overcome the problems of unreasonable marker location settings and low setting efficiency.

[0005] In a first aspect, embodiments of this disclosure provide a method for determining the location of an identifier within an image, including:

[0006] A target image is acquired; the target image is processed to obtain a first feature map, which is used to indicate the target region where at least one image element in the target image is located; based on the first feature map, a first prediction model is invoked to obtain the target position of the identifier to be inserted in the target image, wherein the target position is located outside the target region and has a first positional relationship with the target region, which is determined based on the position of at least one image element in the target image.

[0007] In a first aspect, embodiments of this disclosure provide a model training method, including:

[0008] A sample image is acquired, the sample image containing at least one image element and marked with a marker position where the identifier to be inserted is located. The marker position is located outside the image region where the image element is located and has a first positional relationship with the image region. The first positional relationship is determined based on the position of at least one image element in the sample image. The sample image is processed to obtain a first feature map, the first feature map being used to indicate the image region where at least one of the image elements in the sample image is located. An initial prediction model is trained based on the sample image and the first feature map to obtain a first prediction model, wherein the first prediction model is used to implement the image identifier position determination method described in the first aspect and various possible designs of the first aspect.

[0009] Thirdly, embodiments of this disclosure provide an image-in-image marker location determination device, comprising:

[0010] The acquisition module is used to acquire the target image;

[0011] The processing module is used to process the target image to obtain a first feature map, wherein the first feature map is used to indicate the target region where at least one image element in the target image is located;

[0012] The prediction module is used to call a first prediction model based on the first feature map to obtain the target location of the identifier to be inserted in the target image, wherein the target location is located outside the target region and has a first positional relationship with the target region, the first positional relationship being determined based on the position of at least one image element in the target image.

[0013] Fourthly, embodiments of this disclosure provide a model training apparatus, comprising:

[0014] A sample module is used to acquire a sample image, which contains at least one image element and is marked with a marker position where the identifier to be inserted is located. The marker position is located outside the image area where the image element is located and has a first positional relationship with the image area. The first positional relationship is determined based on the position of at least one image element in the sample image.

[0015] A preprocessing module is used to process the sample image to obtain a first feature map, wherein the first feature map is used to indicate the image region where at least one of the image elements in the sample image is located;

[0016] The training module is used to train the initial prediction model based on the sample image and the first feature map to obtain a first prediction model, wherein the first prediction model is used to implement the image in-situ identifier location determination method as described in the first aspect and various possible designs of the first aspect.

[0017] Fifthly, embodiments of this disclosure provide an electronic device, including:

[0018] A processor, and a memory communicatively connected to the processor;

[0019] The memory stores computer-executed instructions;

[0020] The processor executes computer execution instructions stored in the memory to implement the image intra-label location determination method as described in the first aspect and various possible designs of the first aspect, or to implement the model training method as described in the second aspect and various possible designs of the second aspect.

[0021] Sixthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the image intra-identifier location determination method as described in the first aspect and various possible designs of the first aspect, or implements the model training method as described in the second aspect and various possible designs of the second aspect.

[0022] In a seventh aspect, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the image intra-identifier location determination method as described in the first aspect and various possible designs of the first aspect, or implements the model training method as described in the second aspect and various possible designs of the second aspect.

[0023] The image-in-image marker location determination method, model training method, apparatus, and device provided in this embodiment acquire a target image; process the target image to obtain a first feature map, which indicates the target region where at least one image element in the target image is located; based on the first feature map, call a first prediction model to obtain the target location of the marker to be inserted in the target image, wherein the target location is located outside the target region and has a first positional relationship with the target region, the first positional relationship being determined based on the position of at least one image element in the target image. By preprocessing the target image to obtain a first feature map indicating the target region where image elements in the target image are located, and then calling the first prediction model based on the first feature map to predict the target location of the marker to be inserted, it is equivalent to setting reference information for the first prediction model, enabling the target location output by the first prediction model to have the characteristics of being located outside the target region and having a first positional relationship with the target region, reducing the training difficulty of the first prediction model, improving prediction accuracy, and thus solving the problems of unreasonable marker location setting and low setting efficiency. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is an application scenario diagram of the image intra-marker location determination method provided in the embodiments of this disclosure;

[0026] Figure 2 Flowchart of the image intra-marker location determination method provided in the embodiments of this disclosure Figure 1 ;

[0027] Figure 3 for Figure 2 A flowchart illustrating the specific implementation of step S102 in the illustrated embodiment;

[0028] Figure 4 This is a schematic diagram illustrating a process for generating a target location, provided in an embodiment of the present disclosure.

[0029] Figure 5 This is a schematic diagram illustrating the mapping relationship between the shape features of an identifier to be inserted and the target position, provided in an embodiment of this disclosure.

[0030] Figure 6 A flowchart illustrating the image intra-marker location determination method provided in this embodiment of the disclosure. Figure 2 ;

[0031] Figure 7 for Figure 6 A flowchart illustrating the specific implementation of step S204 in the illustrated embodiment;

[0032] Figure 8 A flowchart illustrating the image intra-marker location determination method provided in this embodiment of the disclosure. Figure 3 ;

[0033] Figure 9 A schematic diagram illustrating a process for predicting the title position provided in an embodiment of this disclosure;

[0034] Figure 10 A schematic flowchart of a model training method provided in an embodiment of this disclosure;

[0035] Figure 11 This is a structural block diagram of an image marker location determination device provided in an embodiment of the present disclosure;

[0036] Figure 12 This is a structural block diagram of the model training device provided in the embodiments of this disclosure;

[0037] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;

[0038] Figure 14 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0040] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0041] The application scenarios of the embodiments of this disclosure are explained below:

[0042] Figure 1 This diagram illustrates an application scenario of the image identifier location determination method provided in this embodiment. The image identifier location determination method provided in this embodiment can be applied to image generation scenarios such as video cover generation and poster generation, and more specifically, in application scenarios such as automatically generating image titles. Specifically, as... Figure 1 As shown, the method provided in this disclosure can be applied to terminal devices, such as smartphones. After the terminal device loads a target image to be processed from the local area or the network, it uses the image in-image identifier position determination method provided in this disclosure to detect the target image and obtain the position in the target image for inserting descriptive text such as titles and symbols, such as the title position shown in the figure. Then, the text manually entered by the user or the text automatically generated based on the content of the target image is filled into the title position to generate an output image with title text, thus realizing the process of automatically generating image titles.

[0043] In existing technologies, the process of adding icons, text, and other identifying information to an image typically involves manually determining the location of the identifier after obtaining the target image, and then adding the corresponding identifier information at that location. This is because adding an identifier to an image requires consideration of whether the identifier will obscure the main content of the image and whether it will affect the overall aesthetics of the image, i.e., whether the placement is reasonable. However, existing technologies cannot effectively judge whether the placement of the identifier to be inserted in the image is reasonable. Therefore, the identifier is usually placed in a fixed position in the image, such as the lower right corner; or simply placed in a blank background in the image. However, it is difficult to guarantee the overall aesthetics of the inserted identifier and the image, resulting in problems such as unreasonable identifier placement and low efficiency.

[0044] This disclosure provides a method for determining the location of an identifier within an image to solve the above-mentioned problems.

[0045] refer to Figure 2 , Figure 2 Flowchart of the image intra-marker location determination method provided in the embodiments of this disclosure Figure 1 The method of this embodiment can be applied to electronic devices such as terminal devices and servers. The method for determining the location of an identifier within an image includes:

[0046] Step S101: Obtain the target image.

[0047] Step S102: Process the target image to obtain a first feature map, which is used to indicate the target region where at least one image element in the target image is located.

[0048] In this embodiment, the provided method is described by way of example using a terminal device as the execution subject, with reference to... Figure 1 The illustrated application scenario diagram shows that, firstly, the terminal device is, for example, a smartphone used by the user. In response to the user's operation, the terminal device loads a target image located locally or on the network. This target image is the image for which a title and descriptive information are to be generated. More specifically, the target image is, for example, a photo taken by the user. Using the method provided in this embodiment, a target location can be determined in the photo, and then a photo title can be automatically generated at that target location.

[0049] Further, exemplarily, after loading the target image, the terminal device first preprocesses the target image to obtain a first feature map characterizing the features of the target image. This first feature map indicates the target region where at least one image element within the target image is located. An image element refers to an object that constitutes the target image in terms of content. For example, rivers, trees, and people in the target image can all be considered image elements. The first feature map obtained after preprocessing can indicate the target region where at least one of the aforementioned image elements is located, effectively locating at least one image element. Subsequently, by performing subsequent steps on the first feature map, the information in the first feature map (the target region where the image element is located) can be used to describe and restrict the predicted target location, thereby achieving target location positioning, for example, making the predicted target location outside the target region.

[0050] In one possible implementation, the first feature map includes an object feature map, and the specific implementation of step S102 includes:

[0051] Step S1021: Perform image recognition on the human figure in the target image to obtain the facial region corresponding to the human figure.

[0052] Step S1022: Perform image segmentation on the facial region to obtain the object feature map.

[0053] For example, the object feature map can be a feature map representing a specific object in the target image, such as the torso of a person, the face of a person, or a specific object in the target image. Taking the case of a person's face as an example, after obtaining the target image, the person's face in the target image is first detected and identified. If a person's face exists, the area where the person's face is located is obtained, i.e., the face region. Then, image segmentation is performed based on the contour of the obtained face region. The image corresponding to the face region is retained, and the image outside the face region is discarded to obtain the object feature map. The above process of image recognition of a person to obtain the face region can be implemented by a face recognition algorithm; image segmentation of the face region can be implemented by mask calculation. The specific implementation process is prior art known to those skilled in the art and will not be described in detail here. In this embodiment, by recognizing and segmenting the person's face, the first feature map obtained contains descriptive information related to the person's face. In subsequent processing steps, by using the information in the object feature map, the location of the specific object (e.g., the face) can be used as a reference position to limit the positional relationship between the specific object and the predicted identifier to be inserted, thereby avoiding interference between the identifier to be inserted and the specific object.

[0054] In another possible implementation, the first feature map includes a salient feature map, and the specific implementation of step S102 includes:

[0055] Step S1023: Perform saliency detection on the target image to obtain the saliency value corresponding to the pixel in the target image.

[0056] Step S1024: Obtain the saliency feature map based on the saliency value corresponding to the pixel.

[0057] For example, saliency detection refers to an algorithm that evaluates the visual saliency of an image. In an image, certain regions are visually more prominent than others and attract more attention from the viewer; that is, the pixels constituting these regions have higher saliency values. An image typically consists of a background and a foreground. Image elements in the image are usually content from the foreground and therefore typically have higher saliency. By performing saliency detection on the target image, the saliency values ​​corresponding to each pixel in the target image are obtained. This saliency feature map is obtained by drawing the image based on the saliency values. In this embodiment, the target image is processed to generate a saliency feature map. The saliency feature map contains descriptive information about the visual saliency of the content in the target image. In subsequent steps, this saliency feature map is used as reference information to predict the target location of the identifier to be inserted, thereby limiting the positional relationship between highly saliency image elements and the predicted identifier to be inserted, thus avoiding interference between the identifier to be inserted and highly saliency image elements.

[0058] In another possible implementation, the terminal device simultaneously performs face detection and saliency detection on the target image to obtain an object feature map and a pre-execution feature map. Then, based on the object feature map and the saliency feature map, a first feature map is obtained, such as... Figure 3 As shown, exemplarily, the specific implementation of step S102 includes:

[0059] Step S1021: Perform image recognition on the human figure in the target image to obtain the facial region corresponding to the human figure.

[0060] Step S1022: Perform image segmentation on the facial region to obtain the object feature map.

[0061] Step S1023: Perform saliency detection on the target image to obtain the saliency value corresponding to the pixel in the target image.

[0062] Step S1024: Obtain the saliency feature map based on the saliency value corresponding to the pixel.

[0063] Step S1025: Perform image fusion based on the object feature map and the saliency feature map to obtain the first feature map.

[0064] The specific implementation methods of each step in generating the object feature map and the saliency feature map in this embodiment have been described in detail in previous embodiments, and can be referred to the descriptions in the steps of previous embodiments, so they will not be repeated here. Next, the object feature map and the saliency feature map are fused to obtain the first feature map. For example, the object feature map and the saliency feature map can be fused by channel to generate the first feature map. For example, if the object feature map is a 1x255x255 feature matrix and the saliency feature map is a 1x255x255 feature matrix, the fusion of the two results in a 2x255x255 feature matrix, which is the first feature map. It should be noted that the steps of generating the object feature map (steps S1021-S1022) and generating the saliency feature map (steps S1023-S1024) can be executed separately to obtain the first feature map, or they can be executed together to utilize the object feature map and the saliency feature map to obtain the first feature map. When executed together, the execution order of the steps of generating the saliency feature map can be set as needed, and no specific restrictions are made here.

[0065] Step S103: Based on the first feature map, call the first prediction model to obtain the target location of the identifier to be inserted in the target image, wherein the target location is located outside the target region and has a first positional relationship with the target region, the first positional relationship being determined based on the position of at least one image element in the target image.

[0066] For example, after obtaining the first feature map, a pre-trained first prediction model is acquired, and the first feature map is used as input parameters to execute the first prediction model. Utilizing the ability of the first prediction model to predict the appropriate location (i.e., the target location) of the identifier to be inserted in the target image based on the first feature map, the target location of the identifier to be inserted is obtained. This first prediction model can be an encoder-decoder architecture. More specifically, this first prediction model is a transformer model. The specific implementation principle of the transformer model is existing technology and will not be elaborated here.

[0067] Furthermore, the trained first prediction model can use a first feature map and a target image as input to predict the target location of the identifier to be inserted in the target image. Since the first feature map is used as reference information, the obtained target location is related to the information contained in the first feature map, i.e., the target region where the image element is located. Specifically, the target location is located outside the target region and has a first positional relationship with the target region. The first positional relationship is determined based on the position of at least one image element in the target image. The first positional relationship can be implemented, for example, by placing the target location between image element A and image element B in the target image; or by placing the target location at a predetermined distance below the midpoint of the line connecting image element A and image element B in the target image. The prediction capability of this first prediction model is obtained after training with training samples. The training process of the first prediction model will be described in detail in subsequent embodiments and will not be elaborated here.

[0068] Figure 4 This is a schematic diagram illustrating a process for generating a target location, as provided in an embodiment of this disclosure. Figure 4 As shown, after obtaining the target image, image recognition and saliency detection are performed on the image to obtain object feature maps and saliency feature maps. Then, the object feature maps and saliency feature maps are fused to obtain the first feature map. Next, the target image and the first reference image are input into the first prediction model to obtain the target position. The target position can be identified by position coordinates, such as position coordinates [p1, p2], which represent the coordinates of the two endpoints of the diagonal of the rectangular text box. Then, based on the specific input content, a marker to be inserted, such as an icon or text, is inserted at the target position, realizing the process of inserting a marker into the image.

[0069] In another possible implementation, before step S103, the following is also included:

[0070] Step S100: Obtain the shape features of the identifier to be inserted, whereby the shape features characterize the shape of the identifier to be inserted. Correspondingly, the specific implementation of step S103 includes: using the first feature map and shape features as input, calling the first prediction model to obtain the target location of the identifier to be inserted in the target image.

[0071] For example, different shapes of the marker to be inserted will produce different visual effects, and therefore, the target position matching it in the target image may also change accordingly. That is, the shape characteristics of the marker to be inserted are one of the factors affecting the prediction of the target position of the marker to be inserted. Figure 5 This is a schematic diagram illustrating the mapping relationship between the shape features of an identifier to be inserted and the target position, provided in an embodiment of this disclosure. Figure 5As shown, when the outline of the identifier to be inserted is circular (shape feature A), the target position predicted by the first prediction model is P1; when the outline of the identifier to be inserted is a rectangle with an aspect ratio of 1:2 (shape feature B), the target position predicted by the first prediction model is P2.

[0072] In this embodiment, before calling the first prediction model, the shape features of the identifier to be inserted are first obtained. These shape features include, for example, the appearance shape of the identifier, its aspect ratio (for rectangles), and its flatness ratio (for ellipses). Then, using these shape features as another piece of reference information, along with the first feature map function as input, the first prediction model is called. This allows the target position predicted by the first prediction model to take into account the influence of the shape features of the identifier to be inserted, thereby improving the accuracy and reasonableness of the target position prediction and enhancing the overall visual appeal of the target image.

[0073] For example, step S100 can be specifically implemented as follows:

[0074] Step S1001: Obtain the input text.

[0075] Step S1002: Determine the aspect ratio of the text box based on the input text.

[0076] Step S1003: Based on the parameter dimensions corresponding to the first prediction model, encode the aspect ratio of the text box to obtain shape features.

[0077] Exemplarily, this embodiment provides a more specific method for obtaining shape features. Specifically, the identifier to be inserted includes a text box. First, the input text corresponding to the identifier to be inserted, i.e., the content to be entered into the text box, is obtained. Then, based on the content and / or length of the input text, the aspect ratio of the text box is determined, such as 1:3 (vertical), 4:1 (horizontal), etc. This aspect ratio is then encoded to obtain a shape encoding vector of a target length. The target length is determined by the parameter dimension corresponding to the first prediction model, i.e., the aspect ratio of the text box is formatted into a data length that can be processed by the first prediction model, thereby obtaining shape features that are convenient for subsequent processing.

[0078] In this embodiment, a target image is acquired; the target image is processed to obtain a first feature map, which indicates the target region where at least one image element in the target image is located; based on the first feature map, a first prediction model is invoked to obtain the target position of the identifier to be inserted in the target image, wherein the target position is located outside the target region and has a first positional relationship with the target region, the first positional relationship being determined based on the position of at least one image element in the target image. By preprocessing the target image to obtain the first feature map indicating the target region where the image element in the target image is located, and then invoking the first prediction model based on the first feature map to predict the target position of the identifier to be inserted, it is equivalent to setting reference information for the first prediction model, so that the target position output by the first prediction model can have the feature of being located outside the target region and having a first positional relationship with the target region, reducing the training difficulty of the first prediction model, improving the prediction accuracy, and thus solving the problems of unreasonable identifier position setting and low setting efficiency.

[0079] refer to Figure 6 , Figure 6 A flowchart illustrating the image intra-marker location determination method provided in this embodiment of the disclosure. Figure 2 This embodiment describes it in detail. Figure 2 Based on the illustrated embodiment, step S103 is further refined. The method for determining the location of the marker within the image includes:

[0080] Step S201: Obtain the target image.

[0081] Step S202: Process the target image to obtain a first feature map, which includes an object feature map and a saliency feature map.

[0082] Step S203: Perform feature fusion between the object feature map and / or saliency feature map and the target image to obtain a fused image.

[0083] For example, in one possible implementation, the first feature map includes an object feature map and a saliency feature map. The object feature map and / or the saliency feature map and the target image can be images of the same size (or the same size after processing). Channel fusion is performed on the three to obtain a fused image. The process of generating the fused image can be referred to... Figure 2 The process of generating the first feature map in the illustrated embodiment will not be described in detail here.

[0084] Step S204: Call the first prediction model to process the fused image and obtain the target location.

[0085] For example, after obtaining the fused image, the first prediction model is called to process it using the fused image as input. Utilizing the predictive capability of the first prediction model, the target location in the target image can be obtained. For example, the first prediction model includes an encoder unit and a decoder unit connected in sequence, such as... Figure 7 As shown, the specific implementation of step S204 includes:

[0086] Step S2041: Perform self-attention calculation on the fused image through the encoder unit to obtain the first fusion feature corresponding to each image region in the fused image. The first fusion feature represents the attention weighted sum of the image features of the corresponding image region and the image features of other image regions.

[0087] Step S2042: The decoder unit performs decoding calculation on the fused features to obtain the decoding vector corresponding to the target position. The decoding vector represents the features of the target position in the global receptive field of the target image.

[0088] Step S2043: Based on the pre-trained second prediction model, map the decoded vector to the coordinates of the target location.

[0089] For example, the first prediction model can be a transformer model based on an encoder-decoder architecture. This first prediction model includes an encoder unit and a decoder unit connected in sequence. After the fused image is input into the first prediction model, the encoder unit first performs self-attention calculation on the fused image. Self-attention calculation is an algorithm derived from attention calculation, which reduces dependence on external information and is more conducive to capturing the correlation between data and features. In the field of image processing technology, self-attention calculation can be used to weight targets with certain relevant features in the global field of view of the target image, thereby achieving the purpose of feature selection. Specifically, the encoder unit includes a self-attention calculation layer and a forward propagation layer. By sequentially inputting the fused image into the self-attention calculation layer and the forward propagation layer, a first fused feature is obtained. The first fused feature represents the attention-weighted sum of image features of the corresponding image region and image features of other image regions. The specific generation method of the first fused feature is based on the self-attention algorithm. The specific principle and implementation method of the self-attention algorithm are existing technologies and will not be elaborated here. Further, after generating the first fusion feature, the decoder unit decodes the fusion feature to obtain the corresponding decoded vector. The attention-weighted sum of each image region represented by the first fusion feature is equivalent to the hidden layer generated after mapping the fused image. The decoder unit maps this hidden layer to features representing the target location, i.e., the decoded vector. Then, based on a second prediction model, the decoded vector is mapped to the coordinates of the target location. This second prediction model, such as a pre-trained forward propagation model, has the ability to map the decoded vector to the target location coordinates. In this embodiment, the first fusion feature is obtained after self-attention calculation, and then the first fusion feature is decoded to obtain the decoded vector. This decoded vector can represent the features of the target location within the global receptive field of the target image, i.e., it considers global information in the target image. Therefore, the target location obtained based on this decoded vector theoretically has global optimality, i.e., it is the most suitable location in the target image to be used as the inserted identifier, thereby improving the predictability of the target location and enhancing the visual perception effect.

[0090] Figure 8 A flowchart illustrating the image intra-marker location determination method provided in this embodiment of the disclosure. Figure 3 This embodiment describes it in detail. Figure 6 Based on the illustrated embodiment, a further step of processing shape features is added. The method for determining the location of the marker within the image includes:

[0091] Step S301: Acquire the target image.

[0092] Step S302: Process the target image to obtain a first feature map, which includes an object feature map and a saliency feature map.

[0093] Step S303: Perform feature fusion between the object feature map and / or saliency feature map and the target image to obtain a fused image.

[0094] Step S304: Perform self-attention calculation on the fused image through the encoder unit to obtain the first fusion feature corresponding to each image region in the fused image. The first fusion feature represents the attention weighted sum of the image features of the corresponding image region and the image features of other image regions.

[0095] Step S305: Obtain shape features, which represent the shape of the identifier to be inserted.

[0096] Step S306: Perform self-attention calculation on the shape features through the encoder unit to obtain the second fusion feature. The second fusion feature represents the attention-weighted sum of the shape features and the image features of each image region.

[0097] Step S307: The decoder unit performs decoding calculations on the first fusion feature and the second fusion feature to obtain the decoding vector corresponding to the target position.

[0098] Step S308: Based on the pre-trained second prediction model, map the decoded vector to the coordinates of the target location.

[0099] The specific implementation process of steps S301-S304 in this embodiment is as follows: Figure 6 The embodiments shown have been described in detail and will not be repeated here. On the other hand, exemplarily, the terminal device obtains shape features characterizing the shape of the identifier to be inserted. These shape features may be, for example, an outline shape, an aspect ratio, etc. Specific steps for obtaining the shape features can be found in [reference needed]. Figure 2 The specific implementation of step S100 in the illustrated embodiment will not be repeated here. Next, the shape features are used as another input item and sequentially input into the encoder and decoder units of the first prediction model for processing. The processing procedure is similar to... Figure 7 The processing of the first fused feature in the illustrated embodiment is similar and will not be repeated here. Then, the first and second fused features are input as a whole into the decoder unit for decoding calculation to obtain the decoded vector corresponding to the target position. Afterwards, the vector mapping is processed based on the pre-trained second prediction model to obtain the coordinates of the target position. The specific implementation process is similar to... Figure 6 The process in the illustrated embodiment is similar and will not be repeated here.

[0100] Figure 9 This is a schematic diagram illustrating a process for predicting the title position provided in an embodiment of this disclosure. The following is in conjunction with... Figure 9 The above process will be further described in reference. Figure 9 As shown, saliency detection and face region segmentation are performed on the target image to obtain object feature maps and / or saliency feature maps. Then, the object feature maps and / or saliency feature maps are fused with the target image to obtain a fused image. A feature extraction network is used to extract region features from the fused image, resulting in multiple region features (shown as region features T_1, T_2, ..., T_n in the figure). On the other hand, the aspect ratio of the title input by the user is received and encoded to obtain shape features M. The region features and shape features M are combined and input into the encoder unit. The encoder unit performs self-attention calculation on the region features and shape features to obtain fused region features (shown as region features Te_1, Te_2, ..., Te_n in the figure) (i.e., the first fused feature) and fused shape features Me (i.e., the second fused feature). These are then decoded by the decoder unit to obtain the title feature vector. The title feature vector is then processed by a forward propagation network to obtain the title position coordinates.

[0101] In this embodiment, the shape features are used as reference information to be input into the encoder unit for calculation to obtain the second fusion feature. The first and second fusion features are then input into the decoder unit as a whole for decoding calculation. This allows the decoded vector representing the target position to be influenced by the shape of the identifier, making the target position of the identifier with specific shape features predicted by the model in the target image more reasonable and improving visual perception.

[0102] Figure 10 This is a flowchart illustrating a model training method provided in an embodiment of this disclosure. The method can be applied to electronic devices such as terminal devices and servers. The model training method provided in this embodiment is used to train the first prediction model shown in the above embodiment. The model training method includes:

[0103] Step S401: Obtain a sample image containing at least one image element and marking the location of the identifier to be inserted. The marking location is outside the image area where the image element is located and has a first positional relationship with the image area. The first positional relationship is determined based on the position of at least one image element in the sample image.

[0104] Step S402: Process the sample image to obtain a first feature map, which is used to indicate the image region where at least one image element in the sample image is located;

[0105] Step S403: Train the initial prediction model based on the sample image and the first feature map to obtain the first prediction model.

[0106] For example, the initial prediction model is Figures 2 to 9 The corresponding embodiment uses the first prediction model before training. Specifically, for example, it is a Transformer model. The sample image is a labeled image, meaning the sample image contains the label positions corresponding to the identifier to be inserted. See [reference needed] for details. Figure 1 The target image in the illustrated application scenario diagram. The marked positions in this sample image can be manually input by the user. The marked positions are located outside the image area where the image element is located, and have a first positional relationship with the image area. The first positional relationship is determined based on the position of at least one image element within the sample image. This can be understood as the marked positions in the sample image being user-inputted positions that conform to the user's aesthetic preferences (i.e., have a first positional relationship with the image area) and do not interfere with the target image element.

[0107] After obtaining the sample image, the target image is first processed to obtain the first feature map. The specific method for generating the first feature map can be found in the previous embodiments and will not be repeated here. Then, using the first feature map and the target image as input, the initial prediction model is called to obtain a predicted position. The predicted position is then compared with the marked position to obtain the residual. Based on the residual, backpropagation is performed to adjust the model parameters of the initial prediction model. This process is repeated until the residual is less than a preset value, at which point the initial prediction model is considered to have converged to the first prediction model. The first prediction model is then used to implement... Figures 2 to 9 The first prediction model of the image intra-identifier location determination method provided in any embodiment.

[0108] In this embodiment, by preprocessing the sample image, a first feature map is obtained indicating the image region where the image elements in the sample image are located. Then, the initial prediction model is trained based on the first feature map and the marked positions in the sample image. This is equivalent to setting reference information for the initial prediction model, so that the predicted position output by the initial prediction model can have the feature of being located outside the target region and having a first positional relationship with the target region. This reduces the training difficulty of the first prediction model and improves the prediction accuracy of the model.

[0109] Corresponding to the image intra-marker location determination method in the above embodiment, Figure 11 This is a structural block diagram of an image marker location determination device provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 11 The image-based marker location determination device 5 includes:

[0110] Acquisition module 51 is used to acquire the target image;

[0111] Processing module 52 is used to process the target image to obtain a first feature map, which is used to indicate the target region where at least one image element in the target image is located.

[0112] The prediction module 53 is used to call the first prediction model based on the first feature map to obtain the target location of the identifier to be inserted in the target image, wherein the target location is located outside the target region and has a first positional relationship with the target region, and the first positional relationship is determined based on the position of at least one image element in the target image.

[0113] In one embodiment of this disclosure, the first feature map includes an object feature map and a saliency feature map; the prediction module 53 is specifically used to: fuse the object feature map and / or the saliency feature map with the target image to obtain a fused image; and call the first prediction model to process the fused image to obtain the target location.

[0114] In one embodiment of this disclosure, the first prediction model includes an encoder unit and a decoder unit connected in sequence. When the prediction module 53 calls the first prediction model to process the fused image and obtain the target position, it is specifically used to: perform self-attention calculation on the fused image through the encoder unit to obtain the first fusion feature corresponding to each image region in the fused image, wherein the first fusion feature represents the attention-weighted sum of the image features of the corresponding image region and the image features of other image regions; perform decoding calculation on the fusion feature through the decoder unit to obtain the decoding vector corresponding to the target position, wherein the decoding vector represents the feature of the target position in the global receptive field of the target image; and map the decoding vector to the coordinates of the target position based on the pre-trained second prediction model.

[0115] In one embodiment of this disclosure, the prediction module 53 is further configured to: acquire shape features, wherein the shape features represent the shape of the identifier to be inserted; perform self-attention calculation on the shape features through the encoder unit to obtain a second fusion feature, wherein the second fusion feature represents the attention weighted sum of the shape features and the image features of each image region; when the prediction module 53 performs decoding calculation on the fusion features through the decoder unit to obtain the decoding vector corresponding to the target position, it is specifically configured to: perform decoding calculation on the first fusion feature and the second fusion feature through the decoder unit to obtain the decoding vector corresponding to the target position.

[0116] In one embodiment of this disclosure, the fused image includes at least two image sub-regions. After fusing the object feature map and / or saliency feature map with the target image to obtain the fused image, the prediction module 53 is further configured to: extract features from the image sub-regions in the fused image to obtain a fused feature matrix, wherein the fused feature matrix characterizes the regional features corresponding to each image sub-region in the fused image; when the prediction module 53 calls the first prediction model to process the fused image to obtain the target location, it is specifically configured to: call the first prediction model to process the fused feature matrix to obtain the target location.

[0117] In one embodiment of this disclosure, the acquisition module 51 is further configured to: acquire the shape features of the identifier to be inserted, wherein the shape features characterize the identifier shape of the identifier to be inserted; the prediction module 53 is specifically configured to: take the first feature map and the shape features as input, call the first prediction model, and obtain the target position of the identifier to be inserted in the target image.

[0118] In one embodiment of this disclosure, the identifier to be inserted includes a text box; when the acquisition module 51 acquires the shape features of the identifier to be inserted, it is specifically used to: acquire input text; determine the aspect ratio of the text box based on the input text; and encode the aspect ratio of the text box based on the parameter dimension corresponding to the first prediction model to obtain the shape features.

[0119] In one embodiment of this disclosure, the processing module 52 is specifically used for: performing image recognition on the portrait in the target image to obtain the facial region corresponding to the portrait; and performing image segmentation on the facial region to obtain a first feature map.

[0120] In one embodiment of this disclosure, the processing module 52 is specifically used for: performing saliency detection on the target image to obtain the saliency value corresponding to the pixel in the target image; and obtaining a first feature map based on the saliency value corresponding to the pixel.

[0121] The acquisition module 31, processing module 32, and prediction module 33 are connected in sequence. The image intra-marker location determination device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0122] Corresponding to the image intra-marker location determination method in the above embodiment, Figure 12 This is a structural block diagram of a model training apparatus provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 12 The model training device 6 includes:

[0123] The sample module 61 is used to acquire a sample image, which contains at least one image element and is marked with a marker position where the identifier to be inserted is located. The marker position is located outside the image area where the image element is located and has a first positional relationship with the image area. The first positional relationship is determined based on the position of at least one image element in the sample image.

[0124] Preprocessing module 62 is used to process the sample image to obtain a first feature map, which is used to indicate the image region where at least one image element in the sample image is located.

[0125] Training module 63 is used to train the initial prediction model based on the sample image and the first feature map to obtain the first prediction model, wherein the first prediction model is used to achieve, for example, Figures 2-9 The method for determining the position of an in-image identifier provided in any of the corresponding embodiments.

[0126] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 13 As shown, the electronic device 7 includes:

[0127] Processor 701, and memory 702 communicatively connected to processor 701;

[0128] Memory 702 stores instructions executed by the computer;

[0129] The processor 701 executes computer execution instructions stored in the memory 702 to achieve, for example, Figures 2-10 The method in the illustrated embodiment.

[0130] Optionally, the processor 701 and the memory 702 are connected via a bus 703.

[0131] For relevant instructions, please refer to the corresponding text. Figures 2-10 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.

[0132] This disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this disclosure. Figures 2-10 The method provided in any of the corresponding embodiments.

[0133] This disclosure provides a computer program product, including a computer program that, when executed by a processor, implements as follows: Figures 2-10 The method in the illustrated embodiment.

[0134] refer to Figure 14The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 14 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0135] like Figure 14 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0136] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 14 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0137] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.

[0138] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0139] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0140] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0141] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0142] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0143] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0144] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0145] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0146] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0147] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0148] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. An image-intrinsic position determination method, characterized by, The method comprises: obtaining a target image; processing the target image to obtain a first feature map, the first feature map being used to indicate a target region in which at least one image element in the target image is located; based on the first feature map, calling a first prediction model to obtain a target position in the target image in which an identification to be inserted is located, wherein the target position is located outside the target region and has a first positional relationship with the target region, and the first positional relationship is determined based on the position of at least one image element in the target image; the first prediction model comprises an encoder unit and a decoder unit connected in sequence, and the calling of the first prediction model to obtain the target position in the target image in which the identification to be inserted is located comprises: performing feature fusion on the first feature map and the target image to obtain a fused image; performing self-attention calculation on the fused image through the encoder unit to obtain first fused features corresponding to each image region in the fused image, the first fused features representing the attention weighted sum of the image features of the corresponding image region and the image features of other image regions; performing decoding calculation on the fused features through the decoder unit to obtain a decoding vector corresponding to the target position, the decoding vector representing the features of the target position under the global receptive field of the target image; based on a pre-trained second prediction model, mapping the decoding vector to the coordinates of the target position.

2. The method of claim 1, wherein, The first feature map comprises an object feature map and / or a saliency feature map; the feature fusion on the first feature map and the target image to obtain a fused image comprises: performing feature fusion on the object feature map and / or the saliency feature map and the target image to obtain a fused image.

3. The method of claim 2, wherein, The method further comprises: obtaining a shape feature, the shape feature representing the shape of the identification to be inserted; performing self-attention calculation on the shape feature through the encoder unit to obtain second fused features, the second fused features representing the attention weighted sum of the shape feature and the image features of each image region; performing decoding calculation on the fused features through the decoder unit to obtain a decoding vector corresponding to the target position, comprising: performing decoding calculation on the first fused features and the second fused features through the decoder unit to obtain a decoding vector corresponding to the target position.

4. The method of claim 2, wherein, The fused image comprises at least two image sub-regions, and after the feature fusion on the object feature map and / or the saliency feature map and the target image to obtain a fused image, the method further comprises: performing feature extraction on the image sub-regions in the fused image to obtain a fused feature matrix, the fused feature matrix representing the region features corresponding to each image sub-region in the fused image; calling the first prediction model to process the fused image to obtain the target position comprises: calling the first prediction model to process the fused feature matrix to obtain the target position.

5. The method of claim 1, wherein, The method further comprises: obtaining a shape feature of the identification to be inserted, the shape feature representing the shape of the identification to be inserted; The first prediction model is called based on the first feature map, and a target position where the to-be-inserted identifier is located in the target image is obtained. The first prediction model is called with the first feature map and the shape feature as input, and the target position where the to-be-inserted identifier is located in the target image is obtained.

6. The method of claim 5, wherein, The to-be-inserted identifier includes a text box; and the shape feature of the to-be-inserted identifier is obtained by: obtaining input text; determining an aspect ratio of the text box according to the input text; encoding the aspect ratio of the text box based on a parameter dimension corresponding to the first prediction model to obtain the shape feature.

7. The method of claim 1, wherein, The target image is processed to obtain a first feature map, including: performing image recognition on a portrait in the target image to obtain a face region corresponding to the portrait; performing image segmentation on the face region to obtain the first feature map.

8. The method of claim 1, wherein, The target image is processed to obtain a first feature map, including: performing saliency detection on the target image to obtain a saliency value corresponding to a pixel point in the target image; obtaining the first feature map based on the saliency value corresponding to the pixel point.

9. A model training method, comprising: including: obtaining a sample image, the sample image containing at least one image element and being marked with a marked position where a to-be-inserted identifier is located, the marked position being located outside an image region where the image element is located and having a first positional relationship with the image region, the first positional relationship being determined based on a position of at least one image element in the sample image; processing the sample image to obtain a first feature map, the first feature map being used to indicate an image region where at least one image element in the sample image is located; training an initial prediction model based on the sample image and the first feature map to obtain a first prediction model, wherein the first prediction model is used to implement the image-in identifier position determination method according to any one of claims 1-8.

10. An image-in identifier position determination apparatus, characterized in that: an acquisition module is configured to acquire a target image; a processing module is configured to process the target image to obtain a first feature map, the first feature map being used to indicate a target region where at least one image element in the target image is located; a prediction module is configured to call a first prediction model based on the first feature map, and obtain a target position where a to-be-inserted identifier is located in the target image, wherein the target position is located outside the target region and has a first positional relationship with the target region, and the first positional relationship is determined based on a position of at least one image element in the target image. The prediction module is specifically configured to perform feature fusion on the first feature map and the target image to obtain a fused image; perform self-attention calculation on the fused image by the encoder unit to obtain first fused features corresponding to each image region in the fused image, the first fused features representing attention weighted sums of image features of the corresponding image region and image features of other image regions; perform decoding calculation on the fused features by the decoder unit to obtain a decoding vector corresponding to the target position, the decoding vector representing features of the target position under a global receptive field of the target image; and map the decoding vector to coordinates of the target position based on a pre-trained second prediction model.

11. A model training apparatus, comprising: The method comprises: a sample module configured to obtain a sample image, the sample image containing at least one image element and marked with a marked position where a to-be-inserted identifier is located, the marked position being located outside an image region where the image element is located and having a first positional relationship with the image region, the first positional relationship being determined based on positions of at least one image element in the sample image; a preprocessing module configured to perform preprocessing on the sample image to obtain a first feature map, the first feature map being used to indicate an image region where at least one image element in the sample image is located; a training module configured to train an initial prediction model based on the sample image and the first feature map to obtain a first prediction model, wherein the first prediction model is used to implement the method for determining a position of an identifier in an image according to any one of claims 1-8.

12. An electronic device, comprising: The method comprises: a processor, and a memory connected to the processor in communication; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1-9.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1-9 is implemented.

14. A computer program product, characterised in that, The computer program is executed by the processor to implement the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Image processing apparatus and computer readable medium

    CN113409421A

  • Dark watermark adding method and system, dark watermark extracting method and system, storage medium and terminal

    CN115482142A