Image editing method and device, equipment and storage medium
By entering the target text description information in the graphical user interface, detecting and marking the target object, and batch eliminating and repairing it based on the peripheral background, the problem of low image editing efficiency in the existing technology is solved, and efficient target objects of the same type is achieved eliminate.
Patent Information
- Application Number
- CN202411330134.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-10
AI Technical Summary
When existing image processing software processes images containing multiple target objects of the same type, users need to manually cut and background fill one by one, resulting in inefficient editing.
Image editing is achieved by entering the target text description information in the graphical user interface, detecting and marking the target object, and batch eliminating and repairing based on the surrounding background.
This improves the efficiency of image editing, enables users to accurately identify and batch eliminate target objects of the same type in the image, significantly improving editing efficiency.
Smart Images

Figure CN119107387A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image editing method, apparatus, device and storage medium. Background Art
[0002] In existing image processing software (such as Adobe Photoshop software, also referred to as PS software), when a user wants to remove a target object from an image material, he needs to first use a cutout tool (such as the lasso tool in PS software) to select the target object to be removed from the image material, and then select the background image around the above target object from the image material as the selection area for the cutout fill background, so that the user can instruct the PS software to fill the blank area after the target object is removed according to the background image in the above selection area, and obtain the image material after the target object is removed.
[0003] However, in the above-mentioned existing image processing software, even if the image material contains multiple target objects of the same type, the user is required to use the above-mentioned manual cutout method to cut out and fill the background for each target object to be cut out one by one, which makes it impossible to eliminate the same type of target objects from the image material in batches, resulting in low editing efficiency for the image material. Summary of the Invention
[0004] In view of this, the present application provides an image editing method, apparatus, device and storage medium, so that the user only needs to input the target text description information of the target object to be deducted, and all target objects contained in the original image can be accurately identified based on the input target text description information, thereby being able to eliminate the same type of target objects from the original image in batches, effectively improving the editing efficiency of the original image.
[0005] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings.
[0006] In a first aspect, an embodiment of the present application provides an image editing method, wherein a terminal device provides a graphical user interface, wherein the graphical user interface displays a pre-imported original image and a target input box; the image editing method includes:
[0007] In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image;
[0008] In response to detecting the target object in the original image, marking the target object in the original image, and updating and displaying the original image as the marked original image on the graphical user interface;
[0009] In response to a target removal instruction for the marked original image, the target object is removed from the original image, and the original image after the target object is removed is repaired based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image;
[0010] On the graphical user interface, the marked original image is updated and displayed as the target image.
[0011] In a second aspect, an embodiment of the present application provides an image editing device, which provides a graphical user interface through a terminal device, wherein the graphical user interface displays a pre-imported original image and a target input box; the image editing device includes:
[0012] A detection module, configured to detect whether there is a target object matching the target text description information in the original image in response to a detection instruction for the target text description information input in the target input box;
[0013] a marking module, configured to mark the target object in the original image in response to detecting the target object in the original image, and update the original image to display the marked original image on the graphical user interface;
[0014] an elimination module, configured to eliminate the target object from the original image in response to a target elimination instruction for the marked original image, and repair the original image after eliminating the target object based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image;
[0015] The display module is configured to update and display the marked original image as the target image on the graphical user interface.
[0016] In a third aspect, an embodiment of the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned image editing method when executing the computer program.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned image editing method are executed.
[0018] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0019] The embodiment of the present application provides an image editing method, apparatus, device and storage medium, which responds to a detection instruction for target text description information input in a target input box, detects whether there is a target object matching the target text description information in the original image; responds to detecting the target object in the original image, marks the target object in the original image, and updates the original image to the marked original image on a graphical user interface; responds to a target elimination instruction for the marked original image, eliminates the target object from the original image, and repairs the original image after eliminating the target object based on the surrounding background image corresponding to the target object in the original image to obtain a repaired target image; updates the marked original image to the target image on a graphical user interface. In this way, the present application allows the user to only input the target text description information for the target object to be deducted, and can accurately identify all target objects contained in the original image based on the input target text description information, thereby being able to batch eliminate target objects of the same type from the original image, effectively improving the editing efficiency of the original image. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A schematic diagram showing a flow chart of an image editing method provided in an embodiment of the present application is shown;
[0022] Figure 2a A schematic diagram of an interface interaction for detecting and marking a target object in an original image provided by an embodiment of the present application is shown;
[0023] Figure 2b A schematic diagram of an interface interaction for removing and repairing a target object in a marked original image provided by an embodiment of the present application is shown;
[0024] Figure 3 A schematic diagram of an interface interaction for detecting and marking a target object in an original image provided by an embodiment of the present application is shown;
[0025] Figure 4A schematic diagram of a third interface interaction for detecting and marking target objects in an original image provided by an embodiment of the present application is shown;
[0026] Figure 5 A schematic diagram of an interface interaction for screening multiple marked target objects provided by an embodiment of the present application is shown;
[0027] Figure 6 A schematic diagram of an interface interaction for removing and repairing remaining target objects in a first target image provided by an embodiment of the present application is shown;
[0028] Figure 7 A schematic structural diagram of an image editing device provided in an embodiment of the present application is shown;
[0029] Figure 8 A schematic structural diagram of an electronic device 800 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of illustration and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art, under the guidance of the contents of this application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0031] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0032] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0033] At present, in existing image processing software, even if the image material contains multiple target objects of the same type, the user is required to manually cut out and fill in the background for each target object to be cut out one by one, resulting in the inability to batch eliminate target objects of the same type from the image material, making the editing efficiency of the image material low.
[0034] Based on this, the embodiments of the present application provide an image editing method, apparatus, device and storage medium, so that the user only needs to input the target text description information of the target object to be deducted, and all target objects contained in the original image can be accurately identified according to the input target text description information, thereby being able to eliminate the same type of target objects from the original image in batches, effectively improving the editing efficiency of the original image.
[0035] In one embodiment of the present application, an image editing method can be run on a terminal device or a server. The terminal device can be a local terminal device. When the image editing method is run on a server, the image editing method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device (i.e., a terminal device).
[0036] To facilitate understanding of the embodiments of the present application, an image editing method, apparatus, device, and storage medium provided in the embodiments of the present application are described in detail below.
[0037] Reference Figure 1 As shown, Figure 1 A flow chart of an image editing method provided in an embodiment of the present application is shown, wherein a graphical user interface is provided by a terminal device, and the graphical user interface displays a pre-imported original image and a target input box. The image editing method includes steps S101-S104; specifically:
[0038] S101 : In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image.
[0039] S102 : In response to detecting the target object in the original image, marking the target object in the original image, and updating and displaying the original image as the marked original image on the graphical user interface.
[0040] S103, in response to the target elimination instruction for the marked original image, eliminating the target object from the original image, and repairing the original image after eliminating the target object based on the surrounding background image corresponding to the target object in the original image to obtain a repaired target image.
[0041] S104: Update and display the marked original image as the target image on the graphical user interface.
[0042] The above-mentioned image editing method provided by the embodiment of the present application, in response to the detection instruction for the target text description information input in the target input box, detects whether there is a target object matching the target text description information in the original image; in response to detecting the target object in the original image, marks the target object existing in the original image, and updates the original image to be displayed as the marked original image on the graphical user interface; in response to the target elimination instruction for the marked original image, eliminates the target object from the original image, and based on the surrounding background image corresponding to the target object in the original image, repairs the original image after eliminating the target object to obtain the repaired target image; and updates the marked original image to be displayed as the target image on the graphical user interface. In this way, the present application allows the user to only input the target text description information for the target object to be deducted, and can accurately identify all target objects contained in the original image according to the input target text description information, so that the same type of target objects can be eliminated from the original image in batches, effectively improving the editing efficiency of the original image.
[0043] The following is an exemplary description of each step in the above-mentioned image editing method provided in the embodiment of the present application:
[0044] S101 : In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image.
[0045] In an embodiment of the present application, the above-mentioned image editing method can be applied to an image editing application, wherein, when the image editing application is running on a terminal device, a graphical user interface of the image editing application can be provided by the terminal device, and the user can select the original image that needs to be imported into the image editing application for editing from outside the image editing application (such as an external browser, a locally stored image directory, etc.), and the terminal device responds to the import instruction for the original image and displays the imported original image in the graphical user interface (specifically, it can be displayed in the image display area in the graphical user interface).
[0046] here, Figure 2a FIG. 1 shows a schematic diagram of an interface interaction for detecting and marking a target object in an original image provided by an embodiment of the present application. Figure 2aAs shown, in addition to the above-mentioned image display area 201 for displaying the imported original image 210, the graphical user interface 200 of the image editing application also displays: a target input box 202 (for receiving target text description information input by the user), a detection button (for responding to the user's detection instruction for the target text description information input in the target input box), a cleanup button (for responding to the user's elimination instruction for the target object detected in the original image), an undo button (for responding to the undo instruction for the above-mentioned elimination instruction), a download button (for responding to the download instruction for the edited image), a manual elimination button (for responding to the user's manual elimination instruction for the original image), and other virtual buttons for implementing different image editing functions. The embodiment of the present application does not impose any limitation on the specific display content on the graphical user interface 200.
[0047] Specifically, in a specific implementation of executing the above-mentioned step S101 within an image editing application, the terminal device may input the target text description information into a target detection model in response to a detection instruction for the target text description information input in the target input box, and detect through the target detection model whether there is a target object matching the target text description information in the original image, and output a target detection result for the target object; wherein the target detection result includes an image detection box where the target object detected in the original image is located (equivalent to using an image detection box to represent the image position of the target object in the original image) and the probability that the image in the image detection box belongs to the target object (that is, the confidence level corresponding to the above-mentioned target detection result output by the target detection model).
[0048] It should be noted that the above-mentioned target detection model can be a target detection model based on an open set (such as the Grounding DINO model) or a YOLO model; the embodiment of the present application does not impose any limitation on the specific model type of the above-mentioned target detection model.
[0049] Specifically, the Grounding DINO model is an open set-based target detection model that can extract features from the original image and target text description information based on the input target text description information and the original image, respectively, to obtain image features corresponding to the original image and text features corresponding to the target text description information (i.e., features of different modalities corresponding to data of two different modalities), and fuse the above image features and text features through the attention mechanism to obtain fused features, thereby generating the target detection result of the above target object based on the obtained fused features (i.e., the image detection box where the target object detected in the original image is located and the probability that the image in the image detection box belongs to the target object).
[0050] It should be noted that when using the YOLO model as the above-mentioned target detection model, unlike the Grounding DINO model, the YOLO model can only detect multiple specific types of target objects contained in the model training dataset. Therefore, if the YOLO model is used as the above-mentioned target detection model, it is necessary to collect a large amount of image data containing multiple types of target objects in advance to train the YOLO model.
[0051] S102 : In response to detecting the target object in the original image, marking the target object in the original image, and updating and displaying the original image as the marked original image on the graphical user interface.
[0052] Here, in combination with the relevant instructions at the above step S101, it can be seen that the terminal device can input the target text description information into the target detection model in response to the detection instruction for the target text description information input in the target input box, and obtain the target detection result for the target object through the target detection model output; wherein, according to the confidence corresponding to each image detection box in the target detection result (that is, the probability that the image in each image detection box belongs to the target object), the image in the image detection box with a confidence higher than the preset confidence threshold can be determined as the above-mentioned target object detected. At this time, the image position of the target object in the original image can be determined according to the image detection box where the target object is located, and the target object at the image position can be marked.
[0053] Specifically, as an optional embodiment, when executing the above step S102, the terminal device can update and display the target object on the original image as a target object carrying a target mark (i.e., update and display the original image as the marked original image) in response to detecting the target object in the original image.
[0054] Specifically, as another optional embodiment, when executing the above step S102, the terminal device can update the target object on the original image to display it as a target object carrying a target tag in response to detecting the target object in the original image, and display a target prompt logo corresponding to the target object carrying the target tag on the graphical user interface.
[0055] It should be noted that in the above optional embodiments, different types of target objects correspond to different target prompt identifiers, so that users can more intuitively determine the specific type of target object in the original image that matches the target text description information based on the number and identification style of the target prompt identifiers.
[0056] For example, let's take the target text description information entered by the user in the target input box as "logo". Figure 2aAs shown, an original image 210 is displayed in the image display area 201 of the graphical user interface 200. The original image 210 contains four logos (two of which are logos with only patterns, and the other two are logos with text and graphics containing the letters A and N) and two text patterns (i.e., the letters C and D). When the user wants to remove all logos from the original image, he can enter the target text description information "logo" in the target input box 202 and then click the detection button (equivalent to sending a detection instruction for the target text description information). At this time, the terminal device In response to the detection instruction for the target text description information "logo", it is possible to detect whether there is a logo mark (i.e., a target object matching the target text description information "logo") in the original image 210. When the four logo marks are detected in the original image 210, the terminal device marks the logo marks in the original image 210 and updates the original image 210 to be displayed as a marked original image 220 on the graphical user interface 200; wherein, the marked original image 220 displays the target mark carried by each logo mark (such as Figure 2a As shown, two logo marks with only patterns and another two logo marks combined with graphics and text are highlighted using target marks of different colors respectively). In addition, while displaying the original image 220 after the above marking, the terminal device can also display a first mark 301 corresponding to the logo mark with text and a second mark 302 corresponding to the logo mark without text on the graphical user interface 200 (the above first mark 301 and the second mark 302 both belong to the above target prompt marks).
[0057] It should be noted that the marking methods corresponding to different types of target objects may be the same or different; for example, a general marking method (such as highlighting, marking with a rectangular box, etc.) may be used to mark different types of target objects, or a specific marking method corresponding to each type of target object may be preset (such as each type of target object corresponds to a mark of a different color, etc.); the embodiments of this application do not impose any restrictions on the specific marking methods corresponding to the above-mentioned target objects and the specific marking styles of the target marks carried by the target objects.
[0058] S103, in response to the target elimination instruction for the marked original image, eliminating the target object from the original image, and repairing the original image after eliminating the target object based on the surrounding background image corresponding to the target object in the original image to obtain a repaired target image.
[0059] Here, in conjunction with the relevant description of step S102, it can be seen that the target mark corresponding to each target object is displayed in the marked original image. At this time, it is equivalent to providing the user with a preview of the solution for removing the target object through the marked original image. If the user determines that each target object marked in the marked original image needs to be removed, Figure 2a As shown, a cleanup button on the graphical user interface can be triggered (equivalent to sending a target removal instruction for the marked original image to the terminal device). In response to the target removal instruction for the marked original image, the terminal device can obtain the repaired target image in the manner shown in the following steps a1-a2 within the image editing application. Specifically:
[0060] Step a1: input the marked original image into an image segmentation model, and output a segmentation mask corresponding to the target object through the image segmentation model.
[0061] Here, the above-mentioned marked original image is equivalent to the original image with detection frame information (that is, the image detection frame where the above-mentioned target object is located and the confidence that the image in the image detection frame belongs to the target object). The terminal device inputs the above-mentioned detection frame information and the original image (that is, the marked original image) into the image segmentation model. The image segmentation model can use the above-mentioned detection frame information as a segmentation hint to predict the local image area belonging to the same entity category as the above-mentioned segmentation hint from the original image, and generate a segmentation mask corresponding to each predicted local area as the segmentation mask corresponding to the above-mentioned target object.
[0062] It should be noted that the above-mentioned image segmentation models include but are not limited to: SAM model (Segment Anything model), Mask-RCNN model, etc.; the embodiments of this application do not impose any restrictions on the specific model structure of the above-mentioned image segmentation models.
[0063] Step a2: input the segmentation mask and the original image into an image restoration model, and output the restored target image through the image restoration model.
[0064] Here, after obtaining the above-mentioned segmentation mask output by the image segmentation model, the terminal device can input the segmentation mask of the target object (equivalent to a black and white image of the same size as the original image; wherein the white image area corresponds to the image area where the target object is located, that is, the white image area represents the local image area that the image restoration model needs to repair) and the original image into the image restoration model. The encoder in the image restoration model can perform feature extraction on the input above-mentioned segmentation mask and original image to generate a multi-scale feature map (that is, multiple feature maps, each feature map corresponds to a different feature extraction scale), and input the generated multi-scale feature map into the decoder in the image restoration model. The decoder can gradually fuse the multi-scale feature maps to generate a restoration area corresponding to the above-mentioned white image area (that is, repair the original image after eliminating the target object), so that its texture and color can naturally merge with the surrounding background image corresponding to the target object in the original image, and output the image restoration result as the above-mentioned repaired target image.
[0065] Specifically, the above-mentioned image restoration model includes but is not limited to: Lama inpainting model, Stable Diffusion model, etc.; the embodiment of the present application does not impose any limitation on the specific model structure of the above-mentioned image restoration model.
[0066] It should be noted that when the above-mentioned target object is a tattoo pattern, the surrounding background image based on the tattoo pattern usually belongs to the skin image area. At this time, the Stable Diffusion model with a more accurate repair effect on the skin image area can be preferentially selected as the above-mentioned image repair model.
[0067] S104: Update and display the marked original image as the target image on the graphical user interface.
[0068] Specifically, in Figure 2a Based on the marked original image 220, Figure 2b FIG. 1 shows an interface interaction diagram for removing and repairing a target object in a marked original image provided by an embodiment of the present application. Figure 2bAs shown, when the user confirms that he wants to batch eliminate all logo marks (i.e., target objects) contained in the marked original image 220, the user can directly trigger the cleanup button displayed on the graphical user interface 200 (i.e., send a target elimination instruction for the marked original image to the terminal device). At this time, the terminal device responds to the target elimination instruction for the marked original image 220, can eliminate all logo marks from the original image, and based on the surrounding background image corresponding to each logo mark in the original image, repair the original image after all logo marks are eliminated to obtain a repaired target image 230. After obtaining the repaired target image 230, the terminal device can update the marked original image 220 to display as the repaired target image 230 on the graphical user interface 200.
[0069] The following describes in detail the specific implementation process of each of the above steps in the embodiment of this application:
[0070] Regarding the specific implementation process of the above step S101, considering that in actual applications, the original image to be edited may include multiple entity objects of similar types, and the entity objects of similar types need to be subdivided into multiple groups of sub-entity objects of different types under a certain classification dimension, for example, Figure 2a-2b As shown, although the four logo signs in the original image 210 can all be defined as entity objects with the entity type of "logo", the above four logo signs can be further subdivided into two logo signs without text information and two graphic and text combined logo signs containing text information according to whether they contain text information.
[0071] Based on this, as another optional embodiment, in the embodiment of the present application, it is also possible to support when the user enters text description information in the target input box, by inserting different types of separators between adjacent word segments, sending text description information in different formats to the terminal device, so that the terminal device can achieve refined detection between multiple entity objects of similar types based on text description information in different formats, which is conducive to improving the accuracy of detection and elimination of target objects in the original image.
[0072] Specifically, as an optional embodiment, the above step S101 may be performed in the manner shown in the following step b1:
[0073] Step b1: In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a first separator, detect from the original image whether there is a target object matching any one of the target word combinations.
[0074] Here, the above-mentioned target word combination is composed of adjacent word segments located before and after the above-mentioned first separator in the target text description information, wherein each word in the target text description information can represent an entity type matched by the target object to be detected (which is also equivalent to a matching condition that the target object needs to meet), and the above-mentioned first separator can play the role of the "or" operator in the logical operator.
[0075] Specifically, when the user wants to eliminate two different types of target objects, the first entity type and the second entity type, at the same time, the target text description information can be entered in the target input box in the format of "first participle (i.e., the participle describing the first entity type), first separator, second participle (i.e., the participle describing the second entity type)" (the above-mentioned "," may not be included) to instruct the terminal device to detect whether the original image contains a target object matching the first participle or a target object matching the second participle.
[0076] It should be noted that the above-mentioned first separator can be a specific symbol such as "." that is preset to function as the "or" operator in a logical operator, or it can be a text symbol such as "or" that functions as an "or" operator; the embodiment of this application does not impose any limitation on the specific symbol content of the above-mentioned first separator.
[0077] For example, Figure 2a As an example, the original image 210 shown in Figure 3 FIG. 1 shows a second interface interaction diagram for detecting and marking target objects in an original image provided by an embodiment of the present application, wherein, Figure 3 As shown, the first separator can be ".". If the target text description information input by the user in the target input box 202 is "logo.text", then after the user triggers the detection button (i.e., sends a detection instruction for the above target text description information to the terminal device), the terminal device responds to the detection instruction for the above target text description information, and based on the fact that the target text description information contains the first separator ".", it can detect from the original image 210 whether there is a target object matching "logo" and whether there is a target object matching "text".
[0078] Specifically, such as Figure 3As shown, after detecting that there are four logos matching the above “logo” and two letters (C and D) matching the above “text” and two logos combining images and text (i.e., logos with letters A and N) in the original image 210, the terminal device can mark the logos and two letters in the original image 210 respectively, and update the original image 210 to be displayed as a marked original image 220 on the graphical user interface 200; wherein, the marked original image 220 displays the target tags carried by each logo and the two letters (such as Figure 3 As shown, two logos with only patterns, two other logos with a combination of graphics and text, and two letters are highlighted using target marks of different colors). In addition, while displaying the original image 220 after the above markings, the terminal device can also display a first mark 301 corresponding to the logo with text, a second mark 302 corresponding to the logo without text, and a third mark 303 corresponding to the two letters on the graphical user interface 200 (the above first mark 301, the second mark 302, and the third mark 303 all belong to the above target prompt marks).
[0079] Specifically, as another optional embodiment, the above step S101 may also be performed in the manner shown in the following step b2:
[0080] Step b2: In response to a detection instruction for the target text description information input in the target input box, if the target text description information includes a second separator, detecting whether there is a target object matching the target segmentation combination in the original image.
[0081] Here, the above-mentioned target word combination is composed of adjacent word segments located before and after the above-mentioned second separator in the target text description information, wherein each word in the target text description information can represent an entity type matched by the target object to be detected (which is also equivalent to a matching condition that the target object needs to meet), and the above-mentioned second separator can play the role of the "and" operator in the logical operator.
[0082] Specifically, when the user wants to eliminate target objects that belong to both the first entity type and the second entity type at the same time, the target text description information can be entered in the target input box in the format of "first participle (i.e., participle describing the first entity type), second separator, second participle (i.e., participle describing the second entity type)" (the above-mentioned "," may not be included) to instruct the terminal device to detect whether the original image contains target objects that match both the first participle and the second participle.
[0083] It should be noted that the above-mentioned first separator can be a specific symbol such as "." that is preset to function as the "or" operator in a logical operator, or it can be a text symbol such as "or" that functions as an "or" operator; the embodiment of this application does not impose any limitation on the specific symbol content of the above-mentioned first separator.
[0084] It should be noted that the above-mentioned second separator can be a specific symbol such as "&" that is preset to play the role of the "and" operator in the logical operator, or it can be a text symbol such as "with" that has the role of the "and" operator; the embodiment of this application does not impose any limitation on the specific symbol content of the above-mentioned second separator.
[0085] For example, Figure 2a As an example, the original image 210 shown in Figure 4 FIG. 4 shows a third interface interaction diagram for detecting and marking target objects in an original image provided by an embodiment of the present application, wherein, Figure 4 As shown, the second separator can be "with". If the target text description information input by the user in the target input box 202 is "logo with text", then after the user triggers the detection button (i.e., sends a detection instruction for the above target text description information to the terminal device), the terminal device responds to the detection instruction for the above target text description information, and based on the fact that the target text description information contains the second separator "with", it can detect from the original image 210 whether there is a target object that matches both "logo" and "text" at the same time.
[0086] Specifically, such as Figure 4 As shown, after detecting that two graphic-text combined logos (i.e., logos with letters A and N) that match the above-mentioned "logo" and "text" are present in the original image 210, the terminal device can mark the two graphic-text combined logos in the original image 210, and update the original image 210 to be displayed as a marked original image 220 on the graphical user interface 200; wherein, the marked original image 220 displays the target tags (such as the target tags carried by the two graphic-text combined logos) respectively. Figure 4 As shown, the two graphic-text combined logo marks can be highlighted using a target mark of the same color). In addition, while displaying the original image 220 after the above mark, the terminal device can also display a fourth mark 400 corresponding to the two graphic-text combined logo marks on the graphical user interface 200 (the above fourth mark 400 also belongs to the above target prompt mark).
[0087] Regarding the specific implementation of the above steps S102-S104, it can be seen from the relevant description of the above step S102 that the target mark corresponding to each target object is displayed in the marked original image. At this time, it is equivalent to providing the user with a preview of the solution for eliminating the target object through the marked original image, and the target prompt mark corresponding to each target object is also displayed on the graphical user interface (refer to Figure 2a As shown), as an optional embodiment, the embodiment of the present application also supports the user to instruct the terminal device to cancel the mark of the target object corresponding to the deleted target prompt identifier by deleting the target prompt identifier, so that the user can more flexibly adjust the elimination and repair results of the target object according to the actual image editing needs.
[0088] Here, in the embodiment of the present application, after executing the above step S102, the target marks of some target objects may be deleted from the currently detected target objects in the manner shown in the following step c1. Specifically:
[0089] Step c1: in response to a delete instruction for the first target prompt identifier, the marked original image is updated and displayed as the first target image on the graphical user interface, and the first target prompt identifier is canceled.
[0090] Here, the first target prompt identifier represents the target prompt identifier corresponding to the first target object among the target objects; wherein, the first target image represents the image after deleting the target mark carried by the first target object from the marked original image.
[0091] Specifically, Figure 2a Taking the marked original image 220 as an example, Figure 5 The schematic diagram of an interface interaction for filtering a plurality of marked target objects provided by an embodiment of the present application is shown. When the target text description information is "logo", the target mark carried by each logo mark (such as Figure 2aAs shown, two logo marks with only patterns and another two logo marks with a combination of graphics and text are highlighted using target marks of different colors respectively). In addition, while displaying the above-mentioned marked original image 220, the terminal device can also display a first mark 301 corresponding to the logo mark with text and a second mark 302 corresponding to the logo mark without text on the graphical user interface 200 (the above-mentioned first mark 301 and second mark 302 both belong to the above-mentioned target prompt marks); wherein, in response to the user's deletion instruction for the second mark 302 (that is, the first target prompt mark is the second mark 302), the terminal device updates the marked original image 220 on the graphical user interface 200 to display the first target image 500, and cancels the display of the deleted second mark 302; wherein, compared with the marked original image 220, the terminal device only deletes the target marks carried by the two logo marks without text corresponding to the second mark 302, and obtains the above-mentioned first target image 500.
[0092] Here, after executing the above step c1, if the user triggers the cleanup button displayed on the graphical user interface (i.e., sends a target removal instruction for the above first target image to the terminal device), the terminal device can remove the remaining target objects (i.e., other target objects except the above deleted first target object) from the original image and repair the first target image in the manner shown in the following steps d1-d2. Specifically:
[0093] Step d1: In response to a target elimination instruction for the first target image, the remaining target objects are eliminated from the first target image, and based on the surrounding background image corresponding to each of the remaining target objects in the first target image, the first target image after eliminating the remaining target objects is repaired to obtain a repaired first target image.
[0094] Here, the remaining target objects represent other target objects remaining except the first target object.
[0095] Step d2: updating and displaying the first target image as the restored first target image on the graphical user interface.
[0096] Specifically, Figure 5 Taking the first target image 500 as an example, Figure 6A schematic diagram of an interface interaction for eliminating and repairing the remaining target objects in the first target image provided by an embodiment of the present application is shown. When the user confirms that he wants to batch eliminate all logo marks with text information contained in the first target image 500 (i.e., the remaining target objects), the user can directly trigger the cleanup button displayed on the graphical user interface 200 (i.e., send a target elimination instruction for the marked original image to the terminal device). At this time, the terminal device responds to the target elimination instruction for the first target image 500 and can eliminate all logo marks with text information from the first target image 500. Based on the surrounding background image corresponding to each logo mark with text information in the first target image 500, the first target image 500 after all logo marks with text information are eliminated is repaired to obtain a repaired first target image 600. After obtaining the repaired first target image 600, the terminal device can update the first target image 500 to display the repaired first target image 600 on the graphical user interface 200.
[0097] Here, it should be noted that, compared to the image editing method in the prior art (refer to the description in the background technology section), in which the user needs to manually cut out and fill in the target objects one by one, the image editing method shown in steps S101-S104 provided in the embodiment of the present application is more suitable for one-time batch elimination and repair of multiple target objects of the same type contained in the original image. However, the image editing method shown in the above steps S101-S104 provided in the embodiment of the present application does not conflict with the manual cutout and filling method in the above prior art. Based on this, in the embodiment of the present application, the user is also supported to manually eliminate the entity objects in the original image by the method shown in the following steps e1-e3. Specifically:
[0098] Step e1: In response to a manual erasure instruction for the original image, controlling the graphical user interface to enter a manual erasure mode.
[0099] Specifically, refer to Figure 2a As shown, after importing and displaying the original image, the user can also trigger the manual elimination button displayed on the graphical user interface 200 (i.e., send a manual elimination instruction for the original image to the terminal device). In response to the manual elimination instruction for the original image, the terminal device can control the graphical user interface to enter the manual elimination mode.
[0100] Step e2: In the manual elimination mode, in response to an elimination instruction for the entity object in the original image, the entity object is eliminated from the original image, and based on the surrounding background image corresponding to the entity object in the original image, the original image after the entity object is eliminated is repaired to obtain a repaired second target image.
[0101] Here, referring to the specific implementation shown in the above steps a1-a2, in the manual elimination mode, the terminal device responds to the elimination instruction for the entity object in the original image (such as the user's click operation on a certain entity object in the original image), and can input the trigger position information of the above elimination instruction (that is, the click position of the above click operation in the original image) and the original image into the image segmentation model. The image segmentation model can use the above trigger position information as a segmentation prompt to predict the local image area belonging to the same entity category as the above segmentation prompt from the original image, and generate a segmentation mask corresponding to each predicted local area as the segmentation mask corresponding to the above entity object; the terminal device can input the obtained segmentation mask and the original image into the image restoration model, and output the restored second target image through the image restoration model.
[0102] Step e3: Update and display the original image as the second target image on the graphical user interface.
[0103] Here, the specific implementation of step e3 can refer to the specific implementation of the aforementioned step S104, and the repeated parts will not be repeated here.
[0104] Based on the above-mentioned image editing method provided by the embodiment of the present application, in response to the detection instruction for the target text description information input in the target input box, it is detected whether there is a target object matching the target text description information in the original image; in response to the detection of the target object in the original image, the target object existing in the original image is marked, and the original image is updated and displayed as the marked original image on the graphical user interface; in response to the target elimination instruction for the marked original image, the target object is eliminated from the original image, and based on the surrounding background image corresponding to the target object in the original image, the original image after eliminating the target object is repaired to obtain the repaired target image; on the graphical user interface, the marked original image is updated and displayed as the target image. In this way, the present application allows the user to only input the target text description information for the target object to be deducted, and all target objects contained in the original image can be accurately identified according to the input target text description information, so that the same type of target objects can be eliminated from the original image in batches, effectively improving the editing efficiency of the original image.
[0105] Based on the same inventive concept, the present application also provides an image editing device corresponding to the above-mentioned image editing method. Since the principle of solving the problem by the image editing device in the embodiment of the present application is similar to the above-mentioned image editing method in the embodiment of the present application, the implementation of the image editing device can refer to the implementation of the above-mentioned image editing method, and the repeated parts will not be repeated.
[0106] Reference Figure 7 As shown, Figure 7 A schematic diagram of the structure of an image editing device provided in an embodiment of the present application is shown, wherein a graphical user interface is provided by a terminal device, and the graphical user interface displays a pre-imported original image and a target input box; the image editing device includes:
[0107] A detection module 701 is configured to detect whether there is a target object matching the target text description information in the original image in response to a detection instruction for the target text description information input in the target input box;
[0108] a marking module 702 for marking the target object in the original image in response to detecting the target object in the original image, and updating and displaying the original image as the marked original image on the graphical user interface;
[0109] an elimination module 703 for eliminating the target object from the marked original image in response to a target elimination instruction, and repairing the original image after eliminating the target object based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image;
[0110] The display module 704 is configured to update and display the marked original image as the target image on the graphical user interface.
[0111] In an optional embodiment, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the detection module 701 is configured to:
[0112] In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a first separator, detect from the original image whether there is a target object that matches any one of the target segmentation combinations; wherein the target segmentation combination is composed of adjacent segmentations located before and after the first separator in the target text description information.
[0113] In an optional embodiment, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the detection module 701 is configured to:
[0114] In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a second separator, detect from the original image whether there is a target object that matches the target segmentation combination; wherein the target segmentation combination is composed of adjacent segmentations located before and after the second separator in the target text description information.
[0115] In an optional implementation, when updating and displaying the original image as the marked original image on the graphical user interface, the marking module 702 is configured to:
[0116] The target object on the original image is updated and displayed as a target object carrying a target mark, and a target prompt mark corresponding to the target object carrying the target mark is displayed on the graphical user interface.
[0117] In an optional embodiment, the image editing device further includes an updating module, wherein the updating module is configured to:
[0118] In response to a deletion instruction for the first target prompt identifier, the marked original image is updated and displayed as the first target image on the graphical user interface, and the first target prompt identifier is cancelled; wherein, the first target prompt identifier represents the target prompt identifier corresponding to the first target object among the target objects; and the first target image represents the image after the target mark carried by the first target object is deleted from the marked original image.
[0119] In an optional implementation, after canceling the display of the first target prompt identifier, the updating module is further configured to:
[0120] In response to a target elimination instruction for the first target image, the remaining target objects are eliminated from the first target image, and based on a surrounding background image corresponding to each of the remaining target objects in the first target image, the first target image after the elimination of the remaining target objects is repaired to obtain a repaired first target image; wherein the remaining target objects represent other target objects remaining except the first target object;
[0121] On the graphical user interface, the first target image is updated and displayed as the restored first target image.
[0122] In an optional embodiment, the image editing device further includes a manual elimination module, wherein the manual elimination module is configured to:
[0123] In response to a manual erasure instruction for the original image, controlling the graphical user interface to enter a manual erasure mode;
[0124] In the manual removal mode, in response to an removal instruction for the physical object in the original image, the physical object is removed from the original image, and the original image after the physical object is removed is repaired based on a surrounding background image corresponding to the physical object in the original image to obtain a repaired second target image;
[0125] On the graphical user interface, the original image is updated and displayed as the second target image.
[0126] In an optional embodiment, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the detection module 701 is configured to:
[0127] In response to a detection instruction for the target text description information input in the target input box, the target text description information is input into a target detection model, and the target detection model is used to detect whether there is a target object matching the target text description information in the original image, and a target detection result for the target object is output.
[0128] In an optional embodiment, when eliminating the target object from the original image and repairing the original image after eliminating the target object based on the surrounding background image corresponding to the target object in the original image to obtain the repaired target image, the elimination module 703 is configured to:
[0129] Inputting the marked original image into an image segmentation model, and outputting a segmentation mask corresponding to the target object through the image segmentation model;
[0130] The segmentation mask and the original image are input into an image restoration model, and the restored target image is output through the image restoration model.
[0131] Based on the above-mentioned image editing device provided by the embodiment of the present application, in response to the detection instruction for the target text description information input in the target input box, it is detected whether there is a target object matching the target text description information in the original image; in response to the detection of the target object in the original image, the target object existing in the original image is marked, and the original image is updated and displayed as the marked original image on the graphical user interface; in response to the target elimination instruction for the marked original image, the target object is eliminated from the original image, and based on the surrounding background image corresponding to the target object in the original image, the original image after the target object is eliminated is repaired to obtain the repaired target image; on the graphical user interface, the marked original image is updated and displayed as the target image. In this way, the present application allows the user to only input the target text description information for the target object to be deducted, and all target objects contained in the original image can be accurately identified according to the input target text description information, so that the same type of target objects can be eliminated from the original image in batches, effectively improving the editing efficiency of the original image.
[0132] Based on the same inventive concept, the present application also provides an electronic device corresponding to the above-mentioned image editing method. Since the principle of solving the problem by the electronic device in the embodiment of the present application is similar to the above-mentioned image editing method in the embodiment of the present application, the implementation of the electronic device can refer to the implementation of the above-mentioned image editing method, and the repeated parts will not be repeated.
[0133] Figure 8 This is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of the present application, including: a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs an image editing method such as in the embodiment, the processor 801 communicates with the memory 802 via the bus 803, and the processor 801 executes the machine-readable instructions. A graphical user interface is provided by the terminal device, and the graphical user interface displays a pre-imported original image and a target input box. When the processor 801 executes the machine-readable instructions, the following steps are implemented, specifically:
[0134] In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image;
[0135] In response to detecting the target object in the original image, marking the target object in the original image, and updating and displaying the original image as the marked original image on the graphical user interface;
[0136] In response to a target removal instruction for the marked original image, the target object is removed from the original image, and the original image after the target object is removed is repaired based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image;
[0137] On the graphical user interface, the marked original image is updated and displayed as the target image.
[0138] In an optional implementation, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the processor 801 is configured to:
[0139] In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a first separator, detect from the original image whether there is a target object that matches any one of the target segmentation combinations; wherein the target segmentation combination is composed of adjacent segmentations located before and after the first separator in the target text description information.
[0140] In an optional implementation, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the processor 801 is configured to:
[0141] In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a second separator, detect from the original image whether there is a target object that matches the target segmentation combination; wherein the target segmentation combination is composed of adjacent segmentations located before and after the second separator in the target text description information.
[0142] In an optional implementation, when updating and displaying the original image as the marked original image on the graphical user interface, the processor 801 is configured to:
[0143] The target object on the original image is updated and displayed as a target object carrying a target mark, and a target prompt mark corresponding to the target object carrying the target mark is displayed on the graphical user interface.
[0144] In an optional implementation, after updating and displaying the original image as the marked original image, the processor 801 is further configured to:
[0145] In response to a deletion instruction for the first target prompt identifier, the marked original image is updated and displayed as the first target image on the graphical user interface, and the first target prompt identifier is cancelled; wherein, the first target prompt identifier represents the target prompt identifier corresponding to the first target object among the target objects; and the first target image represents the image after the target mark carried by the first target object is deleted from the marked original image.
[0146] In an optional implementation, after canceling the display of the first target prompt identifier, the processor 801 is further configured to:
[0147] In response to a target elimination instruction for the first target image, the remaining target objects are eliminated from the first target image, and based on a surrounding background image corresponding to each of the remaining target objects in the first target image, the first target image after the elimination of the remaining target objects is repaired to obtain a repaired first target image; wherein the remaining target objects represent other target objects remaining except the first target object;
[0148] On the graphical user interface, the first target image is updated and displayed as the restored first target image.
[0149] In an optional implementation, the processor 801 is further configured to:
[0150] In response to a manual erasure instruction for the original image, controlling the graphical user interface to enter a manual erasure mode;
[0151] In the manual removal mode, in response to an removal instruction for the physical object in the original image, the physical object is removed from the original image, and the original image after the physical object is removed is repaired based on a surrounding background image corresponding to the physical object in the original image to obtain a repaired second target image;
[0152] On the graphical user interface, the original image is updated and displayed as the second target image.
[0153] In an optional implementation, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the processor 801 is configured to:
[0154] In response to a detection instruction for the target text description information input in the target input box, the target text description information is input into a target detection model, and the target detection model is used to detect whether there is a target object matching the target text description information in the original image, and a target detection result for the target object is output.
[0155] In an optional embodiment, when eliminating the target object from the original image and repairing the original image after eliminating the target object based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image, the processor 801 is configured to:
[0156] Inputting the marked original image into an image segmentation model, and outputting a segmentation mask corresponding to the target object through the image segmentation model;
[0157] The segmentation mask and the original image are input into an image restoration model, and the restored target image is output through the image restoration model.
[0158] The electronic device provided by the embodiment of the present application detects whether there is a target object matching the target text description information in the original image in response to a detection instruction for the target text description information input in the target input box; marks the target object in the original image in response to detecting the target object in the original image, and updates the original image to the marked original image on the graphical user interface; eliminates the target object from the original image in response to a target elimination instruction for the marked original image, and repairs the original image after eliminating the target object based on the surrounding background image corresponding to the target object in the original image to obtain a repaired target image; updates the marked original image to the target image on the graphical user interface. In this way, the present application allows the user to only input the target text description information for the target object to be deducted, and can accurately identify all target objects contained in the original image based on the input target text description information, thereby being able to eliminate target objects of the same type from the original image in batches, effectively improving the editing efficiency of the original image.
[0159] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed when a processor is run, and the processor performs the following steps:
[0160] In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image;
[0161] In response to detecting the target object in the original image, marking the target object in the original image, and updating and displaying the original image as the marked original image on the graphical user interface;
[0162] In response to a target removal instruction for the marked original image, the target object is removed from the original image, and the original image after the target object is removed is repaired based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image;
[0163] On the graphical user interface, the marked original image is updated and displayed as the target image.
[0164] In an optional embodiment, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the processor is configured to:
[0165] In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a first separator, detect from the original image whether there is a target object that matches any one of the target segmentation combinations; wherein the target segmentation combination is composed of adjacent segmentations located before and after the first separator in the target text description information.
[0166] In an optional embodiment, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the processor is configured to:
[0167] In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a second separator, detect from the original image whether there is a target object that matches the target segmentation combination; wherein the target segmentation combination is composed of adjacent segmentations located before and after the second separator in the target text description information.
[0168] In an optional embodiment, when updating and displaying the original image as the marked original image on the graphical user interface, the processor is configured to:
[0169] The target object on the original image is updated and displayed as a target object carrying a target mark, and a target prompt mark corresponding to the target object carrying the target mark is displayed on the graphical user interface.
[0170] In an optional implementation, after updating and displaying the original image as the marked original image, the processor is further configured to:
[0171] In response to a deletion instruction for the first target prompt identifier, the marked original image is updated and displayed as the first target image on the graphical user interface, and the first target prompt identifier is cancelled; wherein, the first target prompt identifier represents the target prompt identifier corresponding to the first target object among the target objects; and the first target image represents the image after the target mark carried by the first target object is deleted from the marked original image.
[0172] In an optional implementation, after canceling the display of the first target prompt mark, the processor is further configured to:
[0173] In response to a target elimination instruction for the first target image, the remaining target objects are eliminated from the first target image, and based on a surrounding background image corresponding to each of the remaining target objects in the first target image, the first target image after the elimination of the remaining target objects is repaired to obtain a repaired first target image; wherein the remaining target objects represent other target objects remaining except the first target object;
[0174] On the graphical user interface, the first target image is updated and displayed as the restored first target image.
[0175] In an optional implementation, the processor is further configured to:
[0176] In response to a manual erasure instruction for the original image, controlling the graphical user interface to enter a manual erasure mode;
[0177] In the manual removal mode, in response to an removal instruction for the physical object in the original image, the physical object is removed from the original image, and the original image after the physical object is removed is repaired based on a surrounding background image corresponding to the physical object in the original image to obtain a repaired second target image;
[0178] On the graphical user interface, the original image is updated and displayed as the second target image.
[0179] In an optional embodiment, when, in response to the detection instruction for the target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image, the processor is configured to:
[0180] In response to a detection instruction for the target text description information input in the target input box, the target text description information is input into a target detection model, and the target detection model is used to detect whether there is a target object matching the target text description information in the original image, and a target detection result for the target object is output.
[0181] In an optional embodiment, when eliminating the target object from the original image and repairing the original image after eliminating the target object based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image, the processor is configured to:
[0182] Inputting the marked original image into an image segmentation model, and outputting a segmentation mask corresponding to the target object through the image segmentation model;
[0183] The segmentation mask and the original image are input into an image restoration model, and the restored target image is output through the image restoration model.
[0184] The computer-readable storage medium provided by the embodiment of the present application responds to a detection instruction for the target text description information input in the target input box, detects whether there is a target object matching the target text description information in the original image; responds to detecting the target object in the original image, marks the target object in the original image, and updates the original image to the marked original image on the graphical user interface; responds to a target elimination instruction for the marked original image, eliminates the target object from the original image, and repairs the original image after eliminating the target object based on the surrounding background image corresponding to the target object in the original image to obtain a repaired target image; updates the marked original image to the target image on the graphical user interface. In this way, the present application allows the user to only input the target text description information for the target object to be deducted, and can accurately identify all target objects contained in the original image based on the input target text description information, thereby being able to eliminate target objects of the same type from the original image in batches, effectively improving the editing efficiency of the original image.
[0185] In an embodiment of the present application, the computer-readable storage medium can also execute other machine-readable instructions when run by the processor to execute the image editing method as described in other embodiments. For the specific steps and principles of the image editing method, please refer to the description of the method side embodiment, which will not be repeated here.
[0186] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of the system or unit, which may be electrical, mechanical or other forms.
[0187] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0188] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0189] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0190] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0191] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present application, or make equivalent replacements for some of the technical features thereof. However, these modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An image editing method, characterized in that: Providing a graphical user interface through a terminal device, wherein the graphical user interface displays a pre-imported original image and a target input box; The image editing method comprises: In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image; In response to detecting the target object in the original image, marking the target object in the original image, and updating and displaying the original image as the marked original image on the graphical user interface; In response to a target elimination instruction for the marked original image, the target object is eliminated from the original image, and based on a surrounding background image corresponding to the target object in the original image, the original image after the target object is eliminated is repaired to obtain a repaired target image; On the graphical user interface, the marked original image is updated and displayed as the target image.
2. The image editing method according to claim 1, characterized in that: In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image includes: In response to a detection instruction for target text description information input in the target input box, if the target text description information contains a first separator, detect from the original image whether there is a target object that matches any one of the target word segments in the target word combination; wherein the target word combination is composed of adjacent word segments located before and after the first separator in the target text description information.
3. The image editing method according to claim 1, characterized in that: In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image includes: In response to a detection instruction for the target text description information input in the target input box, if the target text description information contains a second separator, detect from the original image whether there is a target object matching the target word combination; wherein the target word combination is composed of adjacent words located before and after the second separator in the target text description information.
4. The image editing method according to claim 1, characterized in that: The updating and displaying of the original image as the marked original image on the graphical user interface comprises: The target object on the original image is updated and displayed as a target object carrying a target mark, and a target prompt mark corresponding to the target object carrying the target mark is displayed on the graphical user interface.
5. The image editing method according to claim 4, characterized in that: After updating and displaying the original image as the marked original image, the image editing method further includes: In response to a deletion instruction for the first target prompt identifier, on the graphical user interface, the marked original image is updated and displayed as the first target image, and the first target prompt identifier is cancelled; wherein, the first target prompt identifier represents the target prompt identifier corresponding to the first target object among the target objects; and the first target image represents the image after the target mark carried by the first target object is deleted from the marked original image.
6. The image editing method according to claim 5, characterized in that: After canceling the display of the first target prompt mark, the image editing method further includes: In response to a target elimination instruction for the first target image, the remaining target objects are eliminated from the first target image, and based on a surrounding background image corresponding to each of the remaining target objects in the first target image, the first target image after the remaining target objects are eliminated is repaired to obtain a repaired first target image; wherein the remaining target objects represent other target objects remaining except the first target object; On the graphical user interface, the first target image is updated and displayed as the restored first target image.
7. The image editing method according to claim 1, characterized in that: The image editing method further comprises: In response to a manual erasure instruction for the original image, controlling the graphical user interface to enter a manual erasure mode; In the manual elimination mode, in response to an elimination instruction for the entity object in the original image, the entity object is eliminated from the original image, and based on a surrounding background image corresponding to the entity object in the original image, the original image after the entity object is eliminated is repaired to obtain a repaired second target image; On the graphical user interface, the original image is updated and displayed as the second target image.
8. The image editing method according to claim 1, characterized in that: In response to a detection instruction for target text description information input in the target input box, detecting whether there is a target object matching the target text description information in the original image includes: In response to a detection instruction for the target text description information input in the target input box, the target text description information is input into a target detection model, and the target detection model is used to detect whether there is a target object matching the target text description information in the original image, and a target detection result for the target object is output.
9. The image editing method according to claim 1, characterized in that: The step of eliminating the target object from the original image and repairing the original image after eliminating the target object based on a surrounding background image corresponding to the target object in the original image to obtain a repaired target image includes: Inputting the marked original image into an image segmentation model, and outputting a segmentation mask corresponding to the target object through the image segmentation model; The segmentation mask and the original image are input into an image restoration model, and the restored target image is output through the image restoration model.
10. An image editing device, characterized in that: Providing a graphical user interface through a terminal device, wherein the graphical user interface displays a pre-imported original image and a target input box; The image editing device comprises: A detection module, configured to detect whether there is a target object matching the target text description information in the original image in response to a detection instruction for the target text description information input in the target input box; a marking module, configured to mark the target object existing in the original image in response to detecting the target object in the original image, and update and display the original image as the marked original image on the graphical user interface; an elimination module, configured to eliminate the target object from the original image in response to a target elimination instruction for the marked original image, and to repair the original image after the target object is eliminated based on a surrounding background image corresponding to the target object in the original image, so as to obtain a repaired target image; The display module is used to update and display the marked original image as the target image on the graphical user interface.
11. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the image editing method as described in any one of claims 1 to 9 are performed.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image editing method as claimed in any one of claims 1 to 9 are executed.
