A method, device, terminal equipment and readable storage medium for generating a thumbnail

By performing target recognition and topic tag matching on the target image, thumbnails are generated, solving the problems of high human resource consumption and low efficiency in existing technologies, and achieving efficient thumbnail generation.

CN116416133BActive Publication Date: 2026-06-19CHINA MOBILE INT LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE INT LTD
Filing Date
2023-03-21
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing thumbnail generation methods require significant human resources and are inefficient.

Method used

By performing target recognition on the target image, the image content is determined, and a thumbnail is generated based on the recognized content and topic tags, avoiding manual cropping.

Benefits of technology

It saves on human resource costs and improves thumbnail generation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116416133B_ABST
    Figure CN116416133B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of image processing, and provides a method and device for generating a thumbnail, terminal equipment and a readable storage medium, the method comprising: performing target identification on a target image to obtain image identification content, the target image corresponding to a first theme label; in the case that the image identification content conforms to the first theme label, determining target image content based on the image identification content; and generating a thumbnail of the target image based on the target image content. The application does not need to artificially crop the target image, thereby saving a large amount of human resource cost and improving the generation efficiency of the thumbnail.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to a method, apparatus, terminal device and readable storage medium for generating thumbnails. Background Technology

[0002] A thumbnail is a smaller version of an image after compression. Current thumbnail generation methods typically involve manually cropping the image. This method is labor-intensive and inefficient. Summary of the Invention

[0003] This application provides a method, apparatus, terminal device, and readable storage medium for generating thumbnails, which improves the efficiency of thumbnail generation.

[0004] In a first aspect, embodiments of this application provide a method for generating thumbnails, the method comprising:

[0005] Target recognition is performed on the target image to obtain image recognition content, wherein the target image corresponds to a first topic tag;

[0006] If the image recognition content matches the first topic tag, the target image content is determined based on the image recognition content;

[0007] A thumbnail of the target image is generated based on the content of the target image.

[0008] Secondly, embodiments of this application provide an apparatus for generating thumbnails, the apparatus comprising:

[0009] The target recognition module is used to perform target recognition on the target image to obtain image recognition content, wherein the target image corresponds to a first topic tag;

[0010] The content determination module is used to determine the target image content based on the image recognition content when the image recognition content matches the first topic tag.

[0011] The generation module is used to generate a thumbnail of the target image based on the content of the target image.

[0012] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a method for generating thumbnails as described in the first aspect above.

[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for generating thumbnails as described in the first aspect above.

[0014] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute a method for generating thumbnails as described in the first aspect above.

[0015] The beneficial effects of this application's embodiments compared to the prior art are as follows: This application performs target recognition on a target image to obtain image recognition content, and the target image corresponds to a first topic tag; when the image recognition content matches the first topic tag, the target image content is determined based on the image recognition content; based on the target image content, a thumbnail of the target image is generated. This application determines the target image content based on the image recognition content and the first topic tag, and generates a thumbnail based on the target image content, eliminating the need for manual cropping of the target image, saving significant human resource costs, and improving the efficiency of thumbnail generation. Attached Figure Description

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

[0017] Figure 1 This is a schematic flowchart of a method for generating thumbnails provided in an embodiment of this application;

[0018] Figure 2 This is a flowchart illustrating a method for generating thumbnails according to another embodiment of this application;

[0019] Figure 3 This is a schematic diagram of the target image content provided in an embodiment of this application;

[0020] Figure 4 This is a thumbnail schematic diagram provided in one embodiment of this application;

[0021] Figure 5 This is a schematic structural block diagram of an apparatus for generating thumbnails according to an embodiment of this application;

[0022] Figure 6 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0023] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0024] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0025] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0026] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0027] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0028] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0029] Example 1:

[0030] Please see Figure 1 , Figure 1A schematic flow diagram of a method for generating thumbnails provided in this application is shown.

[0031] Step 101: Perform target recognition on the target image to obtain the image recognition content. The target image corresponds to the first topic tag.

[0032] Optionally, a target recognition model can be used to perform target recognition on the target image to obtain the image recognition content. The image recognition content can refer to the main image content in the target image. For example, if the target image is a person image, the image recognition content can refer to the person in the target image; if the target image is a landscape image, the image recognition content can refer to the landscape in the target image.

[0033] As an example and not a limitation, the object recognition model can be a Convolutional Block Attention Module (CBAM). It should be noted that this application does not limit the object recognition model; the object recognition model only needs to be able to recognize objects.

[0034] Optionally, the first topic tag corresponding to the target image can represent the subject of the target image. Different images may have different topic tags. For example, if the target image is a portrait, the corresponding first topic tag is "portrait"; if the target image is a mountain scene, the corresponding first topic tag is "mountain scene". As an example and not a limitation, topic tags include tags such as "portrait", "mountain scene", "seascape", and "street scene".

[0035] The image recognition content obtained by the target recognition model through normal training may not match the first topic label of the target image. For example, if the target image is a mountain scene, but the image recognition content obtained by the target recognition model is trees, this will result in the image content in the final generated thumbnail being inconsistent with the image content in the target image.

[0036] Therefore, in order to ensure that the image recognition content obtained by the target recognition model matches the first topic label of the target image, and to ensure that the image content in the final generated thumbnail is consistent with the image content in the target image, before performing target recognition on the target image and obtaining the image recognition content, this application further includes: obtaining the image recognition content corresponding to the training image based on the model to be trained, wherein the training image corresponds to a first training topic label, and the image recognition content corresponding to the training image corresponds to a second training topic label; and training the model to be trained based on the first training topic label and the second training topic label to obtain the target recognition model.

[0037] Optionally, a loss function can be constructed based on the first and second training topic labels. As an example, the loss function could be the similarity loss between the first and second training topic labels, where the similarity loss can be obtained based on the Euclidean distance between the first and second training topic labels.

[0038] The more similar the first training topic label and the second training topic label are, the better the training effect, and the more the image recognition content obtained by target recognition of the training image conforms to the first training topic label; the less similar the first training topic label and the second training topic label are, the worse the training effect, and the less the image recognition content obtained by target recognition of the training image conforms to the first training topic label.

[0039] Optionally, this application also provides a method for obtaining topic tags of an image. The following uses a target image as an example to illustrate the process of obtaining the first topic tag:

[0040] Obtain multiple pre-classified topic labels; take the target image and the pre-classified topic labels as input data, process the topic labels through the model, and obtain the first output topic label.

[0041] The process of the topic tag acquisition model is as follows: the topic tag acquisition model extracts the feature vector of the target image, calculates the similarity between the feature vector and each topic tag, and the topic tag that is most similar to the feature vector is the first topic tag.

[0042] Optionally, the topic tag acquisition model can be a contrastive language-image pre-training (CLIP) model, which can achieve zero-shot learning.

[0043] Step 102: If the image recognition content matches the first topic tag, determine the target image content based on the image recognition content.

[0044] The image recognition content obtained by performing target recognition on the target image may not match the first topic tag. In order to avoid a large deviation between the image content of the thumbnail and the image content of the target image, and to avoid wasting computing resources, it is possible to determine whether the image recognition content matches the first topic tag before determining the target image content.

[0045] Optionally, before determining the target image content based on the image recognition content, the method further includes: obtaining a second topic tag for the image recognition content; if the second topic tag is the same as the first topic tag, then determining that the image recognition content conforms to the first topic tag.

[0046] Optionally, the similarity between the second topic tag and the first topic tag can be calculated, and the similarity can be used to determine whether the second topic tag and the first topic tag are the same.

[0047] Optionally, determining the target image content based on the image recognition content includes: obtaining a magnification ratio; and magnifying the area where the image recognition content is located based on the magnification ratio, wherein the image content contained in the magnified area is the target image content.

[0048] Step 103: Generate a thumbnail of the target image based on the content of the target image.

[0049] Optionally, generating a thumbnail of the target image based on the target image content includes: obtaining a preset scaling ratio; and reducing the target image content based on the preset scaling ratio to obtain a thumbnail.

[0050] Optionally, generating a thumbnail of the target image based on the target image content includes: determining a scaling ratio of the target image content based on a set thumbnail geometry size; scaling the target image content based on the scaling ratio to generate the thumbnail.

[0051] When generating a thumbnail, the size of the thumbnail to be generated, i.e. the thumbnail geometry size, is usually preset. Therefore, the scaling ratio can be obtained based on the size of the target image content and the thumbnail geometry size. Based on the scaling ratio, the target image content is reduced to an image with the same size as the thumbnail geometry size. The reduced image is the thumbnail of the target image.

[0052] Optionally, when generating a thumbnail of a target image based on its content, the target image can be cropped based on the location of the target image content to obtain a cropped image corresponding to the target image content, and the thumbnail of the target image can be generated based on the cropped image; alternatively, the target image can be generated directly based on its content without cropping it.

[0053] The cropping of the target image based on the location of the target image content includes: obtaining the bounding box of the target image content, and cropping the target image based on the bounding box.

[0054] This application performs target recognition on a target image to obtain image recognition content, and the target image corresponds to a first topic tag; if the image recognition content matches the first topic tag, the target image content is determined based on the image recognition content; based on the target image content, a thumbnail of the target image is generated. This application determines the target image content based on the image recognition content and the first topic tag, and generates a thumbnail based on the target image content, eliminating the need for manual cropping of the target image, saving significant human resource costs, and improving the efficiency of thumbnail generation.

[0055] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0056] Example 2:

[0057] Please see Figure 2 , Figure 2 A schematic flow diagram of a method for generating thumbnails provided in this application is shown.

[0058] Step 201: Perform target recognition on the target image to obtain image recognition content. The target image corresponds to a first topic tag.

[0059] The relevant content in step 201 can be found in the relevant description in step 101, and will not be repeated here.

[0060] Step 202: If the image recognition content matches the first topic tag, based on the image recognition content, determine the associated image content that meets the composition requirements from the target image according to the composition method, and obtain the target image content that includes the image recognition content and the associated image content.

[0061] Associated image content can refer to the image content surrounding and adjacent to the target image content. The purpose of determining the target image content based on the composition method in this application is to ensure that the generated thumbnail conforms to the requirements of photographic aesthetic composition.

[0062] Optionally, the associated image content that meets the composition requirements is determined from the target image according to the composition method to obtain the target image content containing image recognition content and associated image content, including: generating a first bounding box based on the image recognition content, the size of the first bounding box being larger than the size of the second bounding box corresponding to the image recognition content, the second bounding box being the smallest outer bounding box of the image recognition content; when the first bounding box contains the second bounding box, moving the first bounding box, and after each movement, performing an aesthetic composition score on the image content in the first bounding box; when the aesthetic composition score is the highest, the image content contained in the first bounding box is the target image content, and the image content contained in the first bounding box other than the image recognition content is the associated image content.

[0063] Please see Figure 3 , Figure 3 This is a schematic diagram of the target image content. The first topic label corresponding to the target image is "mountain scenery", so the corresponding image recognition content is "mountain", that is, the image recognition content is the image content contained in the smaller bounding box in the figure; the image content contained in the larger bounding box in the figure is the target image content determined based on the composition method.

[0064] It should be noted that this application does not limit the methods for obtaining target image content that meets aesthetic composition requirements based on composition methods.

[0065] Step 203: Determine the scaling ratio of the target image content based on the set thumbnail geometry size; scale the target image content based on the scaling ratio to generate a thumbnail.

[0066] Optionally, determining the scaling ratio of the target image content based on the set thumbnail geometry size includes: obtaining a first distance and a second distance, wherein the first distance is the distance between a geometric point in the target image content and a vertex of the target content, and the second distance is the distance between a geometric point in the thumbnail geometry and a vertex of the target geometry; and calculating the scaling ratio based on the first distance and the second distance.

[0067] The geometric location point within the target image content can be the centroid or center of the target image content. The centroid is the center of mass and can represent the location of the main content within the target image content. Target content vertices can be any vertex within the target image content; however, to ensure the thumbnail contains minimal useless background information, the target content vertex can be the vertex closest to the geometric location point within the target image content.

[0068] To center the main content of the target image on the thumbnail, a geometric point within the thumbnail geometry can be its center point. When the geometric point in the thumbnail geometry is its center point, any vertex of the target geometry can be any vertex of the thumbnail geometry. Furthermore, a geometric point in the thumbnail geometry can correspond to a geometric point in the target image content, and a vertex of the target geometry can correspond to a vertex of the target content. In other words, the relative positional relationship between the geometric point in the target image content and the vertex of the target content can be the same as the relative positional relationship between the geometric point and the vertex of the target geometry.

[0069] The following example illustrates the scaling process, where a geometric point in the target image content can be the centroid of the target image content, a vertex in the target content can be the vertex closest to the geometric point in the target image content, and a geometric point in the thumbnail geometry is the center of the thumbnail geometry:

[0070] Scale = d1 / d2

[0071] Where Scale is the scaling factor, d1 is the first distance, and d2 is the second distance.

[0072] Optionally, scaling the target image content based on the scaling ratio to generate a thumbnail includes: determining the content to be scaled within the target image content based on the scaling ratio, geometric position points in the target image content, and the distances between the geometric position points in the thumbnail geometry and the vertices of each geometric shape; and reducing the size of the content to be scaled based on the scaling ratio to generate a thumbnail.

[0073] Based on the scaling ratio, the geometric locations within the target image content, and the distances between the geometric locations in the thumbnail geometry and the vertices of each geometric shape, the content to be scaled within the target image content is determined, including:

[0074] When the geometric position points in the thumbnail geometry coincide with the geometric position points in the target image content, the distance between the geometric position points in the thumbnail geometry and the vertices of the thumbnail geometry is extended according to the scaling ratio along the direction from the geometric position points in the thumbnail geometry to each vertices of the thumbnail geometry, thus obtaining the extended vertex positions; based on the extended vertex positions, the content to be scaled is obtained.

[0075] The target distance is obtained by multiplying the distance between the geometric position point in the thumbnail geometry and the vertex of the thumbnail geometry by the scaling ratio. The vertex position after the distance is extended is obtained by extending the distance by extending the distance between the geometric position point in the thumbnail geometry and the vertex of the thumbnail geometry.

[0076] Please see Figure 4 , Figure 4 This diagram illustrates the thumbnails corresponding to three different thumbnail geometric sizes. Different thumbnail geometric sizes result in different calculated scaling ratios, which in turn lead to different content to be scaled, resulting in different final thumbnail sizes and different image content within the thumbnails.

[0077] This application performs target recognition on a target image to obtain image recognition content, and the target image corresponds to a first theme tag. If the image recognition content matches the first theme tag, based on the image recognition content, and according to a composition method, it determines related image content from the target image that meets the composition requirements, thus obtaining target image content containing both the image recognition content and the related image content. Based on the target image content, a thumbnail of the target image is generated. This application can ensure that the theme tag of the thumbnail is consistent with the first theme tag, and that the thumbnail conforms to the composition requirements of photographic aesthetics without changing the original compositional concept of the target image.

[0078] Example 3:

[0079] Please see Figure 5 , Figure 5A schematic structure of an apparatus for generating thumbnails according to this application is shown. For ease of explanation, only the parts relevant to the embodiments of this application are shown in the figure.

[0080] Reference Figure 5 The device includes a target recognition module 51, a content determination module 52, and a generation module 53; the specific functions of each module are as follows:

[0081] Target recognition module 51 is used to perform target recognition on target images to obtain image recognition content, and the target image corresponds to a first topic tag;

[0082] Content determination module 52 is used to determine the target image content based on the image recognition content when the image recognition content matches the first topic tag;

[0083] The generation module 53 is used to generate a thumbnail of the target image based on the content of the target image.

[0084] Optionally, the image recognition content is obtained through target recognition model, and the device further includes:

[0085] The training module is used to obtain the image recognition content corresponding to the training image based on the model to be trained before performing target recognition on the target image and obtaining the image recognition content. The training image has a first training topic label, and the image recognition content corresponding to the training image has a second training topic label. Based on the first training topic label and the second training topic label, the model to be trained is trained to obtain the target recognition model.

[0086] Optionally, the device further includes:

[0087] The determination module is used to obtain a second topic tag for the image recognition content before determining the target image content based on the image recognition content; if the second topic tag is the same as the first topic tag, then the image recognition content is determined to match the first topic tag.

[0088] Optionally, the content determination module 52 is specifically used for:

[0089] Based on image recognition content, the associated image content that meets the composition requirements is determined from the target image according to the composition method, so as to obtain the target image content containing image recognition content and associated image content.

[0090] Optionally, the generation module 53 is specifically used for:

[0091] Based on the set thumbnail geometry size, determine the scaling ratio of the target image content;

[0092] Based on the scaling ratio, the content of the target image is scaled to generate a thumbnail.

[0093] Optionally, the generation module 53 is specifically used for:

[0094] Obtain a first distance and a second distance. The first distance is the distance between a geometric point in the target image content and a vertex of the target content. The second distance is the distance between a geometric point in the thumbnail geometry and a vertex of the target geometry.

[0095] Calculate the scaling ratio based on the first distance and the second distance.

[0096] Optionally, the generation module 53 is specifically used for:

[0097] Based on the scaling ratio, the geometric location points in the target image content, and the distances between the geometric location points in the thumbnail geometry and the vertices of each geometric shape, the content to be scaled in the target image content is determined.

[0098] Based on the scaling ratio, the content to be scaled is reduced in size, and a thumbnail is generated.

[0099] The apparatus for generating thumbnails provided in this application can be applied to the aforementioned method embodiments one and two. For details, please refer to the descriptions of the aforementioned method embodiments one and two, which will not be repeated here.

[0100] Example 4:

[0101] Please see Figure 6 , Figure 6 A schematic structure of a terminal device according to an embodiment of this application is shown. The terminal device 6 of this embodiment includes: at least one processor 60 ( Figure 6 Only one is shown in the diagram), memory 61, and computer program 62 stored in the memory 61 and executable on the at least one processor 60, wherein the processor 60 executes the computer program 62 to implement the steps of a method for generating thumbnails as described in Embodiments 1 and 2 above.

[0102] The terminal device 6 can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that... Figure 6 This is merely an example of terminal device 6 and does not constitute a limitation on terminal device 6. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0103] The processor 60 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0104] In some embodiments, the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 61 may be an external storage device of the terminal device 6, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 6. Furthermore, the memory 61 may include both internal and external storage units of the terminal device 6. The memory 61 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 61 can also be used to temporarily store data that has been output or will be output.

[0105] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0107] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0108] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a terminal device, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0109] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0110] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0111] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0112] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method of generating a thumbnail, characterized by, The method includes: Target recognition is performed on the target image to obtain image recognition content, wherein the target image corresponds to a first topic tag; If the image recognition content matches the first topic tag, the target image content is determined based on the image recognition content; The step of generating a thumbnail of the target image based on the target image content includes: determining a scaling ratio of the target image content based on a set thumbnail geometric size; scaling the target image content based on the scaling ratio to generate the thumbnail; The step of determining the scaling ratio of the target image content based on the set thumbnail geometry size includes: obtaining a first distance and a second distance, wherein the first distance is the distance between a geometric point in the target image content and a vertex of the target content, and the second distance is the distance between a geometric point in the thumbnail geometry and a vertex of the target geometry; and calculating the scaling ratio based on the first distance and the second distance. A thumbnail of the target image is generated based on the content of the target image.

2. The method of claim 1, wherein, The image recognition content is obtained through target recognition model. Before performing target recognition on the target image to obtain the image recognition content, the method further includes: The image recognition content corresponding to the training image is obtained based on the model to be trained. The training image corresponds to a first training topic label, and the image recognition content corresponding to the training image corresponds to a second training topic label. The target recognition model is obtained by training the model to be trained based on the first training topic label and the second training topic label.

3. The method as described in claim 1, characterized in that, Before determining the target image content based on the image recognition content, the method further includes: Obtain the second topic tag of the image recognition content; If the second topic tag is the same as the first topic tag, then the image recognition content is determined to match the first topic tag.

4. The method of claim 1, wherein, Determining the target image content based on the image recognition content includes: Based on the image recognition content, associated image content that meets the composition requirements is determined from the target image according to the composition method, thereby obtaining the target image content that includes the image recognition content and the associated image content.

5. The method of claim 1, wherein, The process of scaling the target image content based on the scaling ratio to generate the thumbnail includes: Based on the scaling ratio, the geometric location points in the target image content, and the distances between the geometric location points in the thumbnail geometry and the vertices of each geometric shape, the content to be scaled in the target image content is determined. Based on the scaling ratio, the content to be scaled is reduced in size to generate the thumbnail.

6. An apparatus for generating a thumbnail, characterized by comprising: The device includes: The target recognition module is used to perform target recognition on the target image to obtain image recognition content, wherein the target image corresponds to a first topic tag; The content determination module is used to determine the target image content based on the image recognition content when the image recognition content matches the first topic tag. The step of generating a thumbnail of the target image based on the target image content includes: determining a scaling ratio of the target image content based on a set thumbnail geometric size; scaling the target image content based on the scaling ratio to generate the thumbnail; The step of determining the scaling ratio of the target image content based on the set thumbnail geometry size includes: obtaining a first distance and a second distance, wherein the first distance is the distance between a geometric point in the target image content and a vertex of the target content, and the second distance is the distance between a geometric point in the thumbnail geometry and a vertex of the target geometry; and calculating the scaling ratio based on the first distance and the second distance. The generation module is used to generate a thumbnail of the target image based on the content of the target image.

7. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.