CN117236284A - Font generation method and device based on adaptation of style information and content information - Google Patents

Font generation method and device based on adaptation of style information and content information Download PDF

Info

Publication number
CN117236284A
CN117236284A CN202311503006.6A CN202311503006A CN117236284A CN 117236284 A CN117236284 A CN 117236284A CN 202311503006 A CN202311503006 A CN 202311503006A CN 117236284 A CN117236284 A CN 117236284A
Authority
CN
China
Prior art keywords
style
font
feature
content
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311503006.6A
Other languages
Chinese (zh)
Inventor
曾锦山
杨孙哲
汪叶飞
熊康悦
章燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangxi Normal University
Original Assignee
Jiangxi Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangxi Normal University filed Critical Jiangxi Normal University
Priority to CN202311503006.6A priority Critical patent/CN117236284A/en
Publication of CN117236284A publication Critical patent/CN117236284A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Controls And Circuits For Display Device (AREA)

Abstract

本发明公开了一种基于风格信息与内容信息适配的字体生成方法及装置,该方法包括:获取当前源字体图片及当前参考风格字体图片集合,将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片。本方案通过预先构建的预设字体生成模型自动生成目标风格字体图片,提高了生成目标风格字体图片的效率;并且,该预设字体生成模型充分利用了多张当前参考风格字体图片的风格特征,提高了生成目标风格字体图片的准确性;同时,由于预设数量的多张历史参考风格字体图片是随机选取的,因此使得预设字体生成模型能够学习到更多的特征,从而进一步提高生成目标风格字体图片的准确性。

The invention discloses a font generation method and device based on the adaptation of style information and content information. The method includes: obtaining a current source font picture and a current reference style font picture set, and combining the current source font picture and the current reference style font picture set. Input it into the preset font generation model for calculation to generate a target style font image corresponding to the current source font image. This solution automatically generates target style font pictures through a pre-built preset font generation model, which improves the efficiency of generating target style font pictures; moreover, the preset font generation model makes full use of the style characteristics of multiple current reference style font pictures. The accuracy of generating target style font images is improved; at the same time, since the preset number of historical reference style font images are randomly selected, the preset font generation model can learn more features, thereby further improving the generation target Style font image accuracy.

Description

基于风格信息与内容信息适配的字体生成方法及装置Font generation method and device based on adaptation of style information and content information

技术领域Technical Field

本发明涉及计算机技术领域,尤其涉及基于风格信息与内容信息适配的字体生成方法及装置。The present invention relates to the field of computer technology, and in particular to a font generation method and device based on adaptation of style information and content information.

背景技术Background Art

中国汉字字体数量庞大且结构复杂,每种字体的风格更是千差万别,由于人工字体设计既耗时又耗力,而且需要专业设计师进行设计,因此字体生成任务成为了一个重要的研究方向。Chinese fonts are huge in number and complex in structure, and the styles of each font vary greatly. Since manual font design is time-consuming and labor-intensive, and requires professional designers to design, the font generation task has become an important research direction.

相关技术中,在生成不同风格的字体时,主要是通过人工对笔画、部件、结构等信息进行标注,从而将标注后的信息作为先验信息,从而生成所需要风格的字体。然而,采用上述方式生成字体时存在生成效率较低的问题。In the related art, when generating fonts of different styles, the strokes, components, structures and other information are manually annotated, and the annotated information is used as prior information to generate fonts of the required style. However, there is a problem of low generation efficiency when generating fonts using the above method.

发明内容Summary of the invention

本发明旨在至少解决现有技术中存在的技术问题,为此,本发明第一方面提出一种基于风格信息与内容信息适配的字体生成方法,该方法包括:The present invention aims to at least solve the technical problems existing in the prior art. To this end, the first aspect of the present invention proposes a font generation method based on adaptation of style information and content information, the method comprising:

获取当前源字体图片及当前参考风格字体图片集合;其中,当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各当前参考风格字体图片对应不同的内容信息,且各当前参考风格字体图片对应同一种风格信息;Obtaining a current source font image and a current reference style font image set; wherein the current reference style font image set includes a preset number of randomly selected current reference style font images, each current reference style font image corresponds to different content information, and each current reference style font image corresponds to the same style information;

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片;其中,目标风格字体图片的内容信息与当前源字体图片的内容信息相同,且目标风格字体图片的风格信息与各当前参考风格字体图片的风格信息相同。The current source font image and the current reference style font image set are input into a preset font generation model for calculation to generate a target style font image corresponding to the current source font image; wherein the content information of the target style font image is the same as the content information of the current source font image, and the style information of the target style font image is the same as the style information of each current reference style font image.

在一种可能的实施方式中,预设字体生成模型包括内容编码器、风格编码器、风格内容特征适配模块和解码器,将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片,包括:In a possible implementation, the preset font generation model includes a content encoder, a style encoder, a style content feature adaptation module and a decoder, and the current source font image and the current reference style font image set are input into the preset font generation model for calculation to generate a target style font image corresponding to the current source font image, including:

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中,通过内容编码器对当前源字体图片进行特征提取,生成第一内容特征;Inputting the current source font image and the current reference style font image set into a preset font generation model, performing feature extraction on the current source font image through a content encoder, and generating a first content feature;

通过风格编码器对当前参考风格字体图片集合进行特征提取,生成第一风格特征集合;其中,第一风格特征集合中包括与各当前参考风格字体图片对应的第一风格特征;Extracting features from the current reference style font picture set through a style encoder to generate a first style feature set; wherein the first style feature set includes first style features corresponding to each current reference style font picture;

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行融合处理,生成融合特征;The first content feature and the first style feature set are fused by a style content feature adaptation module to generate a fused feature;

通过解码器对融合特征进行解码处理,生成目标风格字体图片。The fused features are decoded through the decoder to generate the target style font image.

在一种可能的实施方式中,通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行融合处理,生成融合特征,包括:In a possible implementation, the first content feature and the first style feature set are fused by the style content feature adaptation module to generate a fused feature, including:

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行连接操作,生成连接特征;连接特征中包括与第一内容特征对应的第二内容特征,及与第一风格特征集合对应的第二风格特征集合,第二风格特征集合中包括与各第一风格特征对应的第二风格特征;The first content feature and the first style feature set are connected by the style content feature adaptation module to generate a connection feature; the connection feature includes a second content feature corresponding to the first content feature and a second style feature set corresponding to the first style feature set, and the second style feature set includes a second style feature corresponding to each first style feature;

计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重;Calculating a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set;

基于第一权重及第二权重,对第二内容特征及第二风格特征集合进行加权融合处理,生成融合特征。Based on the first weight and the second weight, a weighted fusion process is performed on the second content feature and the second style feature set to generate a fusion feature.

在一种可能的实施方式中,计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重,包括:In a possible implementation, calculating a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set includes:

对连接特征进行求和处理,生成组合特征;Sum the connected features to generate combined features;

对组合特征进行全局平均池化处理,生成特征向量;Perform global average pooling on the combined features to generate a feature vector;

对特征向量进行压缩处理,生成压缩特征;Compress the feature vector to generate compressed features;

对压缩特征进行转换处理,生成与第二内容特征对应的第一概率分布,及与第二风格特征集合对应的第二概率分布;Performing conversion processing on the compressed features to generate a first probability distribution corresponding to the second content feature and a second probability distribution corresponding to the second style feature set;

基于第一概率分布及第二概率分布,分别计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重。Based on the first probability distribution and the second probability distribution, a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set are calculated respectively.

在一种可能的实施方式中,预设数量的多张当前参考风格字体图片为小于或等于六张当前参考风格字体图片。In a possible implementation manner, the preset number of the multiple current reference style font images is less than or equal to six current reference style font images.

在一种可能的实施方式中,预设字体生成模型的构建过程,包括:In a possible implementation, the process of constructing the preset font generation model includes:

获取训练样本集及目标图片;其中,训练样本集中包括历史源字体图片及多种类型的历史参考风格字体图片集合,各种类型的历史参考风格字体图片集合对应不同的风格信息,历史参考风格字体图片集合中包括随机选取的预设数量的多张历史参考风格字体图片,各历史参考风格字体图片对应不同的内容信息,且各历史参考风格字体图片对应同一种风格信息;Acquire a training sample set and a target image; wherein the training sample set includes a historical source font image and a plurality of types of historical reference style font image sets, each type of historical reference style font image set corresponds to different style information, the historical reference style font image set includes a preset number of randomly selected historical reference style font images, each historical reference style font image corresponds to different content information, and each historical reference style font image corresponds to the same style information;

将训练样本集及目标图片输入至初始字体生成模型中进行训练,得到输出结果;Input the training sample set and the target image into the initial font generation model for training to obtain the output result;

基于输出结果计算整体损失值,并根据整体损失值更新模型参数,基于更新后的模型参数生成预设字体生成模型。An overall loss value is calculated based on the output result, and the model parameters are updated according to the overall loss value, and a preset font generation model is generated based on the updated model parameters.

在一种可能的实施方式中,基于输出结果计算整体损失值,包括:In a possible implementation, calculating the overall loss value based on the output result includes:

基于输出结果及目标图片,计算平均绝对误差损失值;Based on the output results and the target image, calculate the mean absolute error loss value;

基于输出结果及历史源字体图片,计算内容对抗损失值;Calculate the content adversarial loss value based on the output results and historical source font images;

针对各种类型的历史参考风格字体图片集合,基于输出结果及历史参考风格字体图片集合,计算风格对抗损失值;For various types of historical reference style font image collections, calculate the style adversarial loss value based on the output results and the historical reference style font image collections;

基于平均绝对误差损失值、内容对抗损失值及风格对抗损失值,生成整体损失值。Based on the mean absolute error loss value, content adversarial loss value and style adversarial loss value, an overall loss value is generated.

本发明第二方面提出一种基于风格信息与内容信息适配的字体生成装置,该装置包括:A second aspect of the present invention provides a font generation device based on adaptation of style information and content information, the device comprising:

获取模块,用于获取当前源字体图片及当前参考风格字体图片集合;其中,当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各当前参考风格字体图片对应不同的内容信息,且各当前参考风格字体图片对应同一种风格信息;An acquisition module, used to acquire a current source font image and a current reference style font image set; wherein the current reference style font image set includes a preset number of current reference style font images randomly selected, each current reference style font image corresponds to different content information, and each current reference style font image corresponds to the same style information;

生成模块,用于将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片;其中,目标风格字体图片的内容信息与当前源字体图片的内容信息相同,且目标风格字体图片的风格信息与各当前参考风格字体图片的风格信息相同。A generation module is used to input the current source font image and the current reference style font image set into a preset font generation model for calculation, and generate a target style font image corresponding to the current source font image; wherein the content information of the target style font image is the same as the content information of the current source font image, and the style information of the target style font image is the same as the style information of each current reference style font image.

在一种可能的实施方式中,预设字体生成模型包括内容编码器、风格编码器、风格内容特征适配模块和解码器,上述生成模块具体用于:In a possible implementation, the preset font generation model includes a content encoder, a style encoder, a style content feature adaptation module and a decoder, and the above generation module is specifically used for:

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中,通过内容编码器对当前源字体图片进行特征提取,生成第一内容特征;Inputting the current source font image and the current reference style font image set into a preset font generation model, performing feature extraction on the current source font image through a content encoder, and generating a first content feature;

通过风格编码器对当前参考风格字体图片集合进行特征提取,生成第一风格特征集合;其中,第一风格特征集合中包括与各当前参考风格字体图片对应的第一风格特征;Extracting features from the current reference style font picture set through a style encoder to generate a first style feature set; wherein the first style feature set includes first style features corresponding to each current reference style font picture;

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行融合处理,生成融合特征;The first content feature and the first style feature set are fused by a style content feature adaptation module to generate a fused feature;

通过解码器对融合特征进行解码处理,生成目标风格字体图片。The fused features are decoded through the decoder to generate the target style font image.

在一种可能的实施方式中,上述生成模块还用于:In a possible implementation manner, the generation module is further used to:

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行连接操作,生成连接特征;连接特征中包括与第一内容特征对应的第二内容特征,及与第一风格特征集合对应的第二风格特征集合,第二风格特征集合中包括与各第一风格特征对应的第二风格特征;The first content feature and the first style feature set are connected by the style content feature adaptation module to generate a connection feature; the connection feature includes a second content feature corresponding to the first content feature and a second style feature set corresponding to the first style feature set, and the second style feature set includes a second style feature corresponding to each first style feature;

计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重;Calculating a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set;

基于第一权重及第二权重,对第二内容特征及第二风格特征集合进行加权融合处理,生成融合特征。Based on the first weight and the second weight, a weighted fusion process is performed on the second content feature and the second style feature set to generate a fusion feature.

在一种可能的实施方式中,上述生成模块还用于:In a possible implementation manner, the generation module is further used to:

对连接特征进行求和处理,生成组合特征;Sum the connected features to generate combined features;

对组合特征进行全局平均池化处理,生成特征向量;Perform global average pooling on the combined features to generate a feature vector;

对特征向量进行压缩处理,生成压缩特征;Compress the feature vector to generate compressed features;

对压缩特征进行转换处理,生成与第二内容特征对应的第一概率分布,及与第二风格特征集合对应的第二概率分布;Performing conversion processing on the compressed features to generate a first probability distribution corresponding to the second content feature and a second probability distribution corresponding to the second style feature set;

基于第一概率分布及第二概率分布,分别计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重。Based on the first probability distribution and the second probability distribution, a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set are calculated respectively.

在一种可能的实施方式中,预设数量的多张当前参考风格字体图片为小于或等于六张当前参考风格字体图片。In a possible implementation manner, the preset number of the multiple current reference style font images is less than or equal to six current reference style font images.

在一种可能的实施方式中,上述基于风格信息与内容信息适配的字体生成装置还用于:In a possible implementation manner, the above-mentioned font generation device based on adaptation of style information and content information is further used for:

获取训练样本集及目标图片;其中,训练样本集中包括历史源字体图片及多种类型的历史参考风格字体图片集合,各种类型的历史参考风格字体图片集合对应不同的风格信息,历史参考风格字体图片集合中包括随机选取的预设数量的多张历史参考风格字体图片,各历史参考风格字体图片对应不同的内容信息,且各历史参考风格字体图片对应同一种风格信息;Acquire a training sample set and a target image; wherein the training sample set includes a historical source font image and a plurality of types of historical reference style font image sets, each type of historical reference style font image set corresponds to different style information, the historical reference style font image set includes a preset number of randomly selected historical reference style font images, each historical reference style font image corresponds to different content information, and each historical reference style font image corresponds to the same style information;

将训练样本集及目标图片输入至初始字体生成模型中进行训练,得到输出结果;Input the training sample set and the target image into the initial font generation model for training to obtain the output result;

基于输出结果计算整体损失值,并根据整体损失值更新模型参数,基于更新后的模型参数生成预设字体生成模型。An overall loss value is calculated based on the output result, and the model parameters are updated according to the overall loss value, and a preset font generation model is generated based on the updated model parameters.

在一种可能的实施方式中,上述基于风格信息与内容信息适配的字体生成装置还用于:In a possible implementation manner, the above-mentioned font generation device based on adaptation of style information and content information is further used for:

基于输出结果及目标图片,计算平均绝对误差损失值;Based on the output results and the target image, calculate the mean absolute error loss value;

基于输出结果及历史源字体图片,计算内容对抗损失值;Calculate the content adversarial loss value based on the output results and historical source font images;

针对各种类型的历史参考风格字体图片集合,基于输出结果及历史参考风格字体图片集合,计算风格对抗损失值;For various types of historical reference style font image collections, calculate the style adversarial loss value based on the output results and the historical reference style font image collections;

基于平均绝对误差损失值、内容对抗损失值及风格对抗损失值,生成整体损失值。Based on the mean absolute error loss value, content adversarial loss value and style adversarial loss value, an overall loss value is generated.

本发明第三方面提出一种电子设备,所述电子设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如第一方面所述的基于风格信息与内容信息适配的字体生成方法。A third aspect of the present invention proposes an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the font generation method based on adaptation of style information and content information as described in the first aspect.

本发明第四方面提出一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如第一方面所述的基于风格信息与内容信息适配的字体生成方法。A fourth aspect of the present invention proposes a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the font generation method based on adaptation of style information and content information as described in the first aspect.

本发明实施例具有以下有益效果:The embodiments of the present invention have the following beneficial effects:

本发明实施例提供的基于风格信息与内容信息适配的字体生成方法,该方法包括:获取当前源字体图片及当前参考风格字体图片集合;其中,当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各当前参考风格字体图片对应不同的内容信息,且各当前参考风格字体图片对应同一种风格信息;将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片。本方案通过预先构建的预设字体生成模型自动生成目标风格字体图片,提高了生成目标风格字体图片的效率;并且,该预设字体生成模型充分利用了多张当前参考风格字体图片的风格特征,通过有效地将这些风格特征与当前源字体图片的内容特征相匹配,提高了生成目标风格字体图片的准确性;同时,由于预设数量的多张历史参考风格字体图片是随机选取的,因此使得预设字体生成模型能够学习到更多的特征,从而进一步提高生成目标风格字体图片的准确性。The embodiment of the present invention provides a font generation method based on the adaptation of style information and content information, the method comprising: obtaining a current source font image and a current reference style font image set; wherein the current reference style font image set includes a preset number of current reference style font images randomly selected, each current reference style font image corresponds to different content information, and each current reference style font image corresponds to the same style information; the current source font image and the current reference style font image set are input into a preset font generation model for calculation to generate a target style font image corresponding to the current source font image. This scheme automatically generates a target style font image through a pre-constructed preset font generation model, thereby improving the efficiency of generating a target style font image; and the preset font generation model makes full use of the style features of multiple current reference style font images, and improves the accuracy of generating a target style font image by effectively matching these style features with the content features of the current source font image; at the same time, since the preset number of historical reference style font images are randomly selected, the preset font generation model can learn more features, thereby further improving the accuracy of generating a target style font image.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的一种不同的字体风格的示意图;FIG1 is a schematic diagram of a different font style provided in an embodiment of the present application;

图2为本申请实施例提供的一种计算机设备的框图;FIG2 is a block diagram of a computer device provided in an embodiment of the present application;

图3为本发明实施例提供的一种基于风格信息与内容信息适配的字体生成方法的步骤流程图;FIG3 is a flowchart of a method for generating a font based on adaptation of style information and content information provided by an embodiment of the present invention;

图4为本发明实施例提供的一种生成目标风格字体图片的流程图;FIG4 is a flow chart of generating a target style font image provided by an embodiment of the present invention;

图5为本发明实施例提供的一种生成目标风格字体图片的整体框架图;FIG5 is an overall framework diagram of generating a target style font image provided by an embodiment of the present invention;

图6为本发明实施例提供的一种生成融合特征的流程图;FIG6 is a flow chart of generating fusion features provided by an embodiment of the present invention;

图7为本发明实施例提供的一种计算第一权重及第二权重的流程图;FIG7 is a flow chart of calculating a first weight and a second weight provided by an embodiment of the present invention;

图8为本发明实施例提供的一种构建预设字体生成模型的流程图;FIG8 is a flow chart of constructing a preset font generation model provided by an embodiment of the present invention;

图9为本发明实施例提供的一种计算整体损失值的流程图;FIG9 is a flow chart of calculating an overall loss value provided by an embodiment of the present invention;

图10为本申请实施例提供的一种消融实验的结果示意图;FIG10 is a schematic diagram of the results of an ablation experiment provided in an embodiment of the present application;

图11为本申请实施例提供的一种预设字体生成模型与其他模型针对已见字体的未见字符集的测试结果示意图;FIG11 is a schematic diagram of test results of a preset font generation model and other models for an unseen character set of a seen font provided by an embodiment of the present application;

图12为本申请实施例提供的一种预设字体生成模型与其他模型针对未见字体已见字符集和未见字体未见字符集的测试结果示意图;FIG12 is a schematic diagram of test results of a preset font generation model and other models for a seen character set of an unseen font and an unseen character set of an unseen font provided by an embodiment of the present application;

图13为本发明实施例提供的基于风格信息与内容信息适配的字体生成装置的结构框图。FIG. 13 is a structural block diagram of a font generation device based on adaptation of style information and content information provided by an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

中国汉字字体数量庞大且结构复杂,每种字体的风格更是千差万别,由于人工字体设计既耗时又耗力,而且需要专业设计师进行设计,因此字体生成任务成为了一个重要的研究方向。相关技术中,在生成不同风格的字体时,主要是通过人工对笔画、部件、结构等信息进行标注,从而将标注后的信息作为先验信息,从而生成所需要风格的字体。There are a large number of Chinese fonts with complex structures, and the styles of each font vary greatly. Since manual font design is time-consuming and labor-intensive, and requires professional designers to design, font generation has become an important research direction. In related technologies, when generating fonts of different styles, the strokes, components, structures and other information are manually annotated, and the annotated information is used as prior information to generate the font of the required style.

具体地,现有的人工设计字体技术不仅耗时耗力,而且需要由专业人员完成,此外当前主流的小样本生成模型是基于风格-内容分离范式的,主要基于笔画、部件、结构等字体信息,没有考虑到同一风格中每个字符背后的风格特征是不同的。如图1所示,图1为本申请实施例提供的一种不同的字体风格的示意图,可以看出不同的字体风格主要在形状、粗细、角度、弧度等方面体现,这些因素对视觉呈现和情感传达产生不同的影响。因此,采用现有方法进行风格字体图片生成时的效率和准确性较低。Specifically, the existing manual font design technology is not only time-consuming and labor-intensive, but also needs to be completed by professionals. In addition, the current mainstream small sample generation model is based on the style-content separation paradigm, which is mainly based on font information such as strokes, components, and structures. It does not take into account that the style characteristics behind each character in the same style are different. As shown in Figure 1, Figure 1 is a schematic diagram of a different font style provided in an embodiment of the present application. It can be seen that different font styles are mainly reflected in shape, thickness, angle, curvature, etc. These factors have different effects on visual presentation and emotional communication. Therefore, the efficiency and accuracy of style font image generation using existing methods are low.

有鉴于此,本申请提出了一种基于风格信息与内容信息适配的字体生成方法及装置,通过预先构建的预设字体生成模型自动生成目标风格字体图片,提高了生成目标风格字体图片的效率;并且,该预设字体生成模型充分利用了多张当前参考风格字体图片的风格特征,通过有效地将这些风格特征与当前源字体图片的内容特征相匹配,提高了生成目标风格字体图片的准确性;同时,由于预设数量的多张历史参考风格字体图片是随机选取的,因此使得预设字体生成模型能够学习到更多的特征,从而进一步提高生成目标风格字体图片的准确性。In view of this, the present application proposes a font generation method and device based on the adaptation of style information and content information, which automatically generates a target style font image through a pre-constructed preset font generation model, thereby improving the efficiency of generating the target style font image; and, the preset font generation model makes full use of the style features of multiple current reference style font images, and improves the accuracy of generating the target style font image by effectively matching these style features with the content features of the current source font image; at the same time, since a preset number of multiple historical reference style font images are randomly selected, the preset font generation model can learn more features, thereby further improving the accuracy of generating the target style font image.

以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本公开实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。另外,“基于”或“根据”的使用意味着开放和包容性,因为“基于”或“根据”一个或多个所述条件或值的过程、步骤、计算或其他动作在实践中可以基于额外条件或超出所述的值。In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "multiple" means two or more. In addition, the use of "based on" or "according to" means openness and inclusiveness, because the process, steps, calculations or other actions "based on" or "according to" one or more of the conditions or values may be based on additional conditions or values beyond the described values in practice.

本申请提供的基于风格信息与内容信息适配的字体生成方法可以应用于计算机设备(电子设备)中,计算机设备可以是服务器,也可以是终端,其中,服务器可以为一台服务器也可以为由多台服务器组成的服务器集群,本申请实施例对此不作具体限定,终端可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。The font generation method based on adaptation of style information and content information provided in the present application can be applied to a computer device (electronic device), and the computer device can be a server or a terminal, wherein the server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not make specific limitations on this, and the terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices.

以计算机设备是服务器为例,图2示出了一种服务器的框图,如图2所示,服务器可以包括通过系统总线连接的处理器和存储器。其中,该服务器的处理器用于提供计算和控制能力。该服务器的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序以及数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机程序被处理器执行时以实现一种基于风格信息与内容信息适配的字体生成方法。Taking the computer device as a server as an example, FIG2 shows a block diagram of a server. As shown in FIG2, the server may include a processor and a memory connected via a system bus. The processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a font generation method based on the adaptation of style information and content information is implemented.

本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定,可选地服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 2 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. Optionally, the server may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

需要说明的是,本申请实施例的执行主体可以是计算机设备,也可以是基于风格信息与内容信息适配的字体生成装置,下述方法实施例中就以计算机设备为执行主体进行说明。It should be noted that the execution subject of the embodiments of the present application may be a computer device or a font generation device based on adaptation of style information and content information. The following method embodiments will be described with a computer device as the execution subject.

图3为本发明实施例提供的一种基于风格信息与内容信息适配的字体生成方法的步骤流程图。如图3所示,该方法包括以下步骤:FIG3 is a flowchart of a method for generating a font based on adaptation of style information and content information provided by an embodiment of the present invention. As shown in FIG3 , the method includes the following steps:

步骤302、获取当前源字体图片及当前参考风格字体图片集合。Step 302: Obtain the current source font image and the current reference style font image set.

其中,当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各当前参考风格字体图片对应不同的内容信息,且各当前参考风格字体图片对应同一种风格信息。The current reference style font picture set includes a preset number of current reference style font pictures randomly selected, each current reference style font picture corresponds to different content information, and each current reference style font picture corresponds to the same style information.

从而,在生成目标字体风格图片时,需要先获取到当前源字体图片及当前参考风格字体图片集合。当前源字体图片包含了对应的内容信息,即具体是什么字符,当前参考风格字体图片集合中包含了对应的风格信息,例如为楷体、宋体等不同的字体风格,从而可以基于当前源字体图片及当前参考风格字体图片集合生成目标风格字体图片。Therefore, when generating a target font style image, it is necessary to first obtain the current source font image and the current reference style font image set. The current source font image contains the corresponding content information, that is, what specific characters are, and the current reference style font image set contains the corresponding style information, such as different font styles such as Kaiti and Songti, so that the target style font image can be generated based on the current source font image and the current reference style font image set.

步骤304、将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片。Step 304: Input the current source font image and the current reference style font image set into a preset font generation model for calculation to generate a target style font image corresponding to the current source font image.

其中,目标风格字体图片的内容信息与当前源字体图片的内容信息相同,且目标风格字体图片的风格信息与各当前参考风格字体图片的风格信息相同。The content information of the target style font image is the same as the content information of the current source font image, and the style information of the target style font image is the same as the style information of each current reference style font image.

在一些可选地实施例中,上述预设字体生成模型是用于基于当前源字体图片及当前参考风格字体图片集合生成目标风格字体图片的模型,预设字体生成模型可以包括内容编码器、风格编码器、风格内容特征适配模块和解码器,将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片时,如图4所示,图4为本发明实施例提供的一种生成目标风格字体图片的流程图,包括:In some optional embodiments, the above-mentioned preset font generation model is a model for generating a target style font picture based on the current source font picture and the current reference style font picture set. The preset font generation model may include a content encoder, a style encoder, a style content feature adaptation module and a decoder. The current source font picture and the current reference style font picture set are input into the preset font generation model for calculation. When a target style font picture corresponding to the current source font picture is generated, as shown in FIG. 4, FIG. 4 is a flowchart of generating a target style font picture provided by an embodiment of the present invention, including:

步骤402、将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中,通过内容编码器对当前源字体图片进行特征提取,生成第一内容特征。Step 402: Input the current source font image and the current reference style font image set into a preset font generation model, perform feature extraction on the current source font image through a content encoder, and generate a first content feature.

步骤404、通过风格编码器对当前参考风格字体图片集合进行特征提取,生成第一风格特征集合。Step 404: extract features from the current reference style font image set through a style encoder to generate a first style feature set.

步骤406、通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行融合处理,生成融合特征。Step 406: The first content feature and the first style feature set are fused by the style content feature adaptation module to generate a fused feature.

步骤408、通过解码器对融合特征进行解码处理,生成目标风格字体图片。Step 408: decode the fused features through a decoder to generate a target style font image.

其中,请参考5,图5为本发明实施例提供的一种生成目标风格字体图片的整体框架图。当前源字体图片也即内容图片xc,当前参考风格字体图片集合也即风格图片,内容编码器为Ec,风格编码器为Es,解码器为D。Please refer to 5, which is an overall framework diagram of generating a target style font image provided by an embodiment of the present invention. The current source font image is also the content image xc , and the current reference style font image set is also the style image , the content encoder is E c , the style encoder is Es , and the decoder is D .

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型后,可以先通过内容编码器Ec对当前源字体图片进行特征提取,从而生成第一内容特征fc,该第一内容特征fc的大小为C×H×W,其中,C表示通道数,H和W分别表示第一内容特征fc的高度和宽度。并且,可以通过风格编码器Es对当前参考风格字体图片集合进行特征提取,从而生成第一风格特征集合fi。其中,第一风格特征集合fi中包括与各当前参考风格字体图片对应的第一风格特征,即f1至fk,第一风格特征集合fi的大小为k×C×H×W,k表示当前参考风格字体图片的数量最大值。After the current source font image and the current reference style font image set are input into the preset font generation model, the current source font image can be firstly feature extracted by the content encoder E c to generate a first content feature f c , the size of which is C×H×W, where C represents the number of channels, and H and W represent the height and width of the first content feature f c , respectively. In addition, the current reference style font image set can be feature extracted by the style encoder Es to generate a first style feature set fi . The first style feature set fi includes the first style features corresponding to each current reference style font image, i.e., f 1 to f k , and the size of the first style feature set fi is k×C×H×W, where k represents the maximum number of current reference style font images.

从而可以通过风格内容特征适配模块对第一内容特征fc及第一风格特征集合fi进行融合处理,生成融合特征。在一些可选地实施例中,如图6所示,图6为本发明实施例提供的一种生成融合特征的流程图,包括:Thus, the first content feature f c and the first style feature set fi can be fused by the style content feature adaptation module to generate a fused feature. In some optional embodiments, as shown in FIG6 , FIG6 is a flow chart of generating a fused feature provided by an embodiment of the present invention, including:

步骤602、通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行连接操作,生成连接特征。Step 602: Connect the first content feature and the first style feature set through the style content feature adaptation module to generate a connection feature.

步骤604、计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重。Step 604: Calculate a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set.

步骤606、基于第一权重及第二权重,对第二内容特征及第二风格特征集合进行加权融合处理,生成融合特征。Step 606: Based on the first weight and the second weight, perform weighted fusion processing on the second content feature and the second style feature set to generate a fusion feature.

其中,通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行连接操作生成连接特征后,连接特征中包括与第一内容特征fc对应的第二内容特征,及与第一风格特征集合fi对应的第二风格特征集合。第二风格特征集合中包括与各第一风格特征对应的第二风格特征,即为与f1至fk分别对应的。连接特征的大小为(k+1)×C×H×W。Among them, after the style content feature adaptation module performs a connection operation on the first content feature and the first style feature set to generate a connection feature, the connection feature includes the second content feature corresponding to the first content feature f c , and the second style feature set corresponding to the first style feature set fi The second style feature set The second style features corresponding to each first style feature are included, that is, the second style features corresponding to f 1 to f k respectively. to The size of the connected features is (k+1)×C×H×W.

接着,可以计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重,最终通过第一权重及第二权重,对第二内容特征及第二风格特征集合进行加权融合处理,生成融合特征。Next, the first weight corresponding to the second content feature and the second weight corresponding to the second style feature set may be calculated, and finally the second content feature and the second style feature set may be weighted fused using the first weight and the second weight to generate a fused feature.

本实施例中,由于当前参考风格字体图片集合中包含多张当前参考风格字体图片,该预设字体生成模型充分利用了多张当前参考风格字体图片的风格特征,通过有效地将这些风格特征与当前源字体图片的内容特征相匹配,实现了出色的字体生成效果;并且,通过将第二内容特征及第二风格特征集合进行有效的融合,进一步增强了生成目标风格字体图片的表现力和多样性,这种融合过程不仅提高了模型生成字体的能力,还能够产生出具有独特风格和艺术感的字体设计,为小样本字体生成领域提供了一种新的、有效的解决方案。In this embodiment, since the current reference style font image set contains multiple current reference style font images, the preset font generation model makes full use of the style features of the multiple current reference style font images, and achieves excellent font generation effect by effectively matching these style features with the content features of the current source font image; and, by effectively fusing the second content feature and the second style feature set, the expressiveness and diversity of the generated target style font image are further enhanced. This fusion process not only improves the model's ability to generate fonts, but also can produce font designs with unique style and artistic sense, providing a new and effective solution for the field of small sample font generation.

在一些可选地实施例中,如图7所示,图7为本发明实施例提供的一种计算第一权重及第二权重的流程图,包括:In some optional embodiments, as shown in FIG. 7 , FIG. 7 is a flowchart of calculating a first weight and a second weight provided by an embodiment of the present invention, including:

步骤702、对连接特征进行求和处理,生成组合特征。Step 702: sum the connection features to generate a combined feature.

步骤704、对组合特征进行全局平均池化处理,生成特征向量。Step 704: Perform global average pooling processing on the combined features to generate a feature vector.

步骤706、对特征向量进行压缩处理,生成压缩特征。Step 706: compress the feature vector to generate a compressed feature.

步骤708、对压缩特征进行转换处理,生成与第二内容特征对应的第一概率分布,及与第二风格特征集合对应的第二概率分布。Step 708: convert the compressed features to generate a first probability distribution corresponding to the second content feature and a second probability distribution corresponding to the second style feature set.

步骤710、基于第一概率分布及第二概率分布,分别计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重。Step 710: Calculate a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set based on the first probability distribution and the second probability distribution.

其中,可以先对连接特征进行求和处理,从而生成组合特征U,可选地,可以将连接特征中的各个特征进行相加,从而得到该组合特征U,该组合特征U的大小为C×H×W,具体可以通过公式(1)计算得到。接着,可以对该组合特征U进行全局平均池化处理提取全局信息,并将组合特征U的大小进行缩减,生成特征向量S,该特征向量S的大小为C×1×1,具体可以通过公式(2)计算得到。Among them, the connection features can be summed up first to generate a combined feature U. Optionally, the features in the connection features can be added together to obtain the combined feature U. The size of the combined feature U is C×H×W, which can be calculated by formula (1). Then, the combined feature U can be subjected to global average pooling to extract global information, and the size of the combined feature U can be reduced to generate a feature vector S. The size of the feature vector S is C×1×1, which can be calculated by formula (2).

(1) (1)

(2) (2)

为了进一步减小特征向量S的大小并提高效率,可以采用一个简单的全连接层(Full Connection,简称FC)对特征向量进行压缩处理,生成压缩特征Z,该压缩特征Z的大小为D×1×1。In order to further reduce the size of the feature vector S and improve efficiency, a simple fully connected layer (FC) can be used to compress the feature vector to generate a compressed feature Z whose size is D×1×1.

另外,可以通过softmax映射对压缩特征进行转换处理,生成与第二内容特征对应的第一概率分布,及与第二风格特征集合对应的第二概率分布。进而,基于第一概率分布及第二概率分布,可以分别计算得到与第二内容特征对应的第一权重wc,具体可以通过公式(3)计算得到,及与第二风格特征集合对应的第二权重wi,即为与分别对应的w1至wk,具体可以通过公式(4)计算得到。In addition, the compressed features can be transformed through softmax mapping to generate a first probability distribution corresponding to the second content feature and a second probability distribution corresponding to the second style feature set. Furthermore, based on the first probability distribution and the second probability distribution, the first weight w c corresponding to the second content feature can be calculated, which can be calculated by formula (3), and the second weight w i corresponding to the second style feature set can be calculated, which is to The corresponding w 1 to w k can be calculated by formula (4).

(3) (3)

(4) (4)

其中,表示与第二内容特征对应的第一概率分布,表示与第二风格特征集合对应的第二概率分布。in, represents a first probability distribution corresponding to the second content feature, represents a second probability distribution corresponding to the second style feature set.

接着,可以基于第一权重及第二权重,对第二内容特征及第二风格特征集合进行加权融合处理,生成融合特征F,该融合特征F的大小为C×H×W。可选地,可以将第二内容特征及第二风格特征集合分别乘以第一权重及第二权重,计算出每个分支对最终融合特征F的贡献。从本质上讲,这一过程涉及在各自权重的指导下,对来自各分支的特征信息进行加权融合,目的是创建一个统一而全面的特征表示。具体可以通过公式(5)计算得到。Next, the second content feature and the second style feature set can be weighted fused based on the first weight and the second weight to generate a fused feature F, the size of which is C×H×W. Optionally, the second content feature and the second style feature set can be multiplied by the first weight and the second weight respectively to calculate the contribution of each branch to the final fused feature F. In essence, this process involves weighted fusion of feature information from each branch under the guidance of their respective weights, with the goal of creating a unified and comprehensive feature representation. Specifically, it can be calculated using formula (5).

(5) (5)

最终,通过解码器D对该融合特征F进行解码处理后,就可以生成目标风格字体图片y。Finally, after decoding the fused feature F through the decoder D, the target style font image y can be generated.

在一些可选地实施例中,上述预设字体生成模型是用于基于当前源字体图片及当前参考风格字体图片集合生成目标风格字体图片的模型,上述预设字体生成模型的构建过程如图8所示,图8为本发明实施例提供的一种构建预设字体生成模型的流程图,包括:In some optional embodiments, the preset font generation model is a model for generating a target style font image based on a current source font image and a current reference style font image set. The construction process of the preset font generation model is shown in FIG8 , which is a flow chart of constructing a preset font generation model provided by an embodiment of the present invention, including:

步骤802、获取训练样本集及目标图片。Step 802: Obtain a training sample set and a target image.

步骤804、将训练样本集及目标图片输入至初始字体生成模型中进行训练,得到输出结果。Step 804: input the training sample set and the target image into the initial font generation model for training to obtain an output result.

步骤806、基于输出结果计算整体损失值,并根据整体损失值更新模型参数,基于更新后的模型参数生成预设字体生成模型。Step 806: Calculate the overall loss value based on the output result, update the model parameters according to the overall loss value, and generate a preset font generation model based on the updated model parameters.

其中,训练样本集中包括历史源字体图片及多种类型的历史参考风格字体图片集合,各种类型的历史参考风格字体图片集合对应不同的风格信息,历史参考风格字体图片集合中包括随机选取的预设数量的多张历史参考风格字体图片,各历史参考风格字体图片对应不同的内容信息,且各历史参考风格字体图片对应同一种风格信息。目标图片是预先设置的标准图片,用于在模型训练过程中计算相应的损失值。需要说明的是,历史源字体图片也可以采用xc表示,历史参考风格字体图片集合也可以采用Xs表示。The training sample set includes historical source font images and various types of historical reference style font image sets, each type of historical reference style font image set corresponds to different style information, and the historical reference style font image set includes a preset number of randomly selected historical reference style font images, each historical reference style font image corresponds to different content information, and each historical reference style font image corresponds to the same style information. It is a pre-set standard image used to calculate the corresponding loss value during the model training process. It should be noted that the historical source font image can also be represented by x c , and the historical reference style font image collection can also be represented by X s .

在将训练样本集及目标图片输入至初始字体生成模型中进行训练,得到输出结果时,输出结果也可以表示为y,且具体得到输出结果的过程可以参考上述实施例在使用该模型时生成目标风格字体图片y的过程,在此不再赘述。When the training sample set and the target image are input into the initial font generation model for training and the output result is obtained, the output result can also be represented as y, and the specific process of obtaining the output result can refer to the process of generating the target style font image y when using the model in the above embodiment, which will not be repeated here.

在一些可选地实施例中,在基于输出结果计算整体损失值时,如图9所示,图9为本发明实施例提供的一种计算整体损失值的流程图,包括:In some optional embodiments, when calculating the overall loss value based on the output result, as shown in FIG. 9 , FIG. 9 is a flow chart of calculating the overall loss value provided by an embodiment of the present invention, including:

步骤902、基于输出结果及目标图片,计算平均绝对误差损失值。Step 902: Calculate the mean absolute error loss value based on the output result and the target image.

步骤904、基于输出结果及历史源字体图片,计算内容对抗损失值。Step 904: Calculate the content resistance loss value based on the output result and the historical source font image.

步骤906、针对各种类型的历史参考风格字体图片集合,基于输出结果及历史参考风格字体图片集合,计算风格对抗损失值。Step 906: For various types of historical reference style font image sets, calculate the style adversarial loss value based on the output result and the historical reference style font image set.

步骤908、基于平均绝对误差损失值、内容对抗损失值及风格对抗损失值,生成整体损失值。Step 908: Generate an overall loss value based on the mean absolute error loss value, the content adversarial loss value, and the style adversarial loss value.

其中,上述预设字体生成模型整体为生成对抗网络架构,生成器网络通过学习训练样本集的分布生成新的数据,而判别器网络则尝试区分生成器生成的数据和真实的训练数据,两个网络相互对抗,最终,生成器网络可以生成与训练数据相似的新数据。Among them, the above-mentioned preset font generation model is a generative adversarial network architecture as a whole. The generator network generates new data by learning the distribution of the training sample set, while the discriminator network tries to distinguish the data generated by the generator from the real training data. The two networks compete with each other. Finally, the generator network can generate new data similar to the training data.

在训练过程中通过平均绝对误差损失值即L1损失与对抗损失来约束生成器与鉴别器之间的关系,对抗损失由内容对抗损失与风格对抗损失组成。从而,上述预设字体生成模型还可以包括风格判别器Ds和内容判别器Dc。风格判别器Ds用于计算风格对抗损失值,内容判别器Dc用于计算内容对抗损失值During the training process, the relationship between the generator and the discriminator is constrained by the mean absolute error loss value, i.e., the L1 loss and the adversarial loss. The adversarial loss consists of the content adversarial loss and the style adversarial loss. Thus, the above-mentioned preset font generation model may also include a style discriminator D s and a content discriminator D c . The style discriminator D s is used to calculate the style adversarial loss value. , the content discriminator D c is used to calculate the content adversarial loss value .

接着,可以基于输出结果及目标图片,计算平均绝对误差损失值L1,也即为输出结果及目标图片之间像素级的差别,具体可以通过公式(6)计算得到。Next, based on the output result and the target image, the mean absolute error loss value L 1 can be calculated, which is the pixel-level difference between the output result and the target image. Specifically, it can be calculated using formula (6).

(6) (6)

其中,表示当来自分布时,式子×的期望。in, Indicates when From When distributed, the expectation of the formula ×.

再基于输出结果及历史源字体图片,计算内容对抗损失值,内容对抗损失值由内容生成损失和内容鉴别损失组成,通过内容鉴别损失,鉴别器可以更好鉴别生成出的图片即输出结果是否与历史源字体图片具有一样的内容,通过内容生成损失,生成器可以使输出结果更加接近历史源字体图片的内容。具体可以通过公式(7)计算得到内容对抗损失值,通过公式(8)计算得到内容生成损失,通过公式(9)计算得到内容鉴别损失Then, based on the output results and historical source font images, calculate the content adversarial loss value , content adversarial loss value Generate loss from content and content identification loss Composition, loss identification by content , the discriminator can better identify whether the generated image, that is, the output result, has the same content as the historical source font image, through the content generation loss , the generator can make the output result closer to the content of the historical source font image. Specifically, the content adversarial loss value can be calculated by formula (7): , the content generation loss is calculated by formula (8) , the content identification loss is calculated by formula (9): .

(7) (7)

(8) (8)

(9) (9)

其中,表示当来自分布时,式子×的期望。表示将输入到内容鉴别器中的结果值。表示当来自分布时,式子×的期望。表示将输入到内容鉴别器中的结果值。in, Indicates when From When distributed, the expectation of the formula ×. Indicates that The resulting value that is input into the content discriminator. Indicates when From When distributed, the expectation of the formula ×. Indicates that The resulting value that is input into the content discriminator.

另外,可以针对各种类型的历史参考风格字体图片集合,基于输出结果及历史参考风格字体图片集合,计算风格对抗损失值。风格对抗损失值由风格生成损失和风格鉴别损失组成,通过风格鉴别损失,鉴别器可以更好鉴别生成出的图片即输出结果是否与历史参考风格字体图片具有一样的风格,通过风格生成损失,生成器可以使输出结果更加接近历史参考风格字体图片的风格。具体可以通过公式(10)计算得到风格对抗损失值,通过公式(11)计算得到风格生成损失,通过公式(12)计算得到风格鉴别损失In addition, for various types of historical reference style font image collections, the style adversarial loss value can be calculated based on the output results and the historical reference style font image collections. Style adversarial loss Generating loss from style and style discrimination loss Composition, through style identification loss , the discriminator can better identify whether the generated image, that is, whether the output result has the same style as the historical reference style font image, through the style generation loss , the generator can make the output result closer to the style of the historical reference font image. Specifically, the style adversarial loss value can be calculated by formula (10): , the style generation loss is calculated by formula (11) , the style identification loss is calculated by formula (12) .

(10) (10)

(11) (11)

(12) (12)

其中,表示当来自分布时,式子×的期望。表示将输入到风格鉴别器中的结果值。表示当来自分布时,式子×的期望。表示将输入到风格鉴别器中的结果值。in, Indicates when From When distributed, the expectation of the formula ×. Indicates that The resulting value that is input into the style discriminator. Indicates when From When distributed, the expectation of the formula ×. Indicates that The resulting value that is input into the style discriminator.

最终,就可以基于平均绝对误差损失值L1、内容对抗损失值Ladvc及风格对抗损失值Ladvs,生成整体损失值Ltotal。具体可以通过公式(13)计算得到。Finally, the overall loss value L total can be generated based on the mean absolute error loss value L 1 , the content adversarial loss value L advc and the style adversarial loss value L advs . Specifically, it can be calculated using formula (13).

(13) (13)

其中,表示从生成器角度尝试将该式子最小化,表示从鉴别器角度尝试将该式子最大化,λadv表示超参数,可以预先自定义设置,表示取值范围为1到100的数。in, It means trying to minimize the formula from the generator’s perspective. It means trying to maximize the formula from the perspective of the discriminator, and λ adv represents a hyperparameter that can be customized in advance. Represents a number ranging from 1 to 100.

本实施例中,通过综合平均绝对误差损失值、内容对抗损失值及风格对抗损失值这三种损失值得到整体损失值,能够更加合理、准确地调整模型的参数,使得最终生成你的预设字体生成模型的准确性更高。In this embodiment, the overall loss value is obtained by combining the three loss values of mean absolute error loss value, content adversarial loss value and style adversarial loss value, so that the parameters of the model can be adjusted more reasonably and accurately, so that the final accuracy of your preset font generation model is higher.

在一些可选地实施例中,在预设字体生成模型的使用过程中,预设数量的多张当前参考风格字体图片为小于或等于六张当前参考风格字体图片。同样地,在预设字体生成模型的构建过程中,各种类型的历史参考风格字体图片集合中包括随机选取的预设数量的多张历史参考风格字体图片也为小于或等于六张。In some optional embodiments, during the use of the preset font generation model, the preset number of multiple current reference style font images is less than or equal to six current reference style font images. Similarly, during the construction of the preset font generation model, the various types of historical reference style font image sets include a preset number of randomly selected historical reference style font images that are also less than or equal to six.

本实施例中,通过少量的样本数据就能够训练得到预设字体生成模型,用户仅需提供少量的样本字符即可生成出丰富多样的新字体,大大提高了字体设计的效率和创造性;另外,由于预设数量的多张历史参考风格字体图片是随机选取的,因此使得预设字体生成模型能够学习到更多的特征,从而提高生成目标风格字体图片的准确性。In this embodiment, the preset font generation model can be trained with a small amount of sample data, and the user only needs to provide a small amount of sample characters to generate a rich variety of new fonts, which greatly improves the efficiency and creativity of font design; in addition, since a preset number of historical reference style font images are randomly selected, the preset font generation model can learn more features, thereby improving the accuracy of generating target style font images.

并且,通过消融实验表明,当同一种类型的历史参考风格字体图片集合中的历史参考风格字体图片为六张的时候效果达到最优,如图10所示,图10为本申请实施例提供的一种消融实验的结果示意图。其中,X轴表示同一种类型的历史参考风格字体图片集合中的历史参考风格字体图片的数量k,Y轴表示图像相似度评价指标(Fréchet InceptionDistance,简称FID),它是用来计算真实图像与生成图像的特征向量间距离的一种度量。如果FID值越小,则相似程度越高,最好情况即是FID=0,两个图像相同。Moreover, the ablation experiment shows that the effect is optimal when there are six historical reference style font pictures in the same type of historical reference style font picture set, as shown in Figure 10, which is a schematic diagram of the results of an ablation experiment provided in an embodiment of the present application. Among them, the X-axis represents the number k of historical reference style font pictures in the same type of historical reference style font picture set, and the Y-axis represents the image similarity evaluation index (Fréchet Inception Distance, referred to as FID), which is a measure used to calculate the distance between the feature vectors of the real image and the generated image. If the FID value is smaller, the similarity is higher, and the best case is FID=0, and the two images are the same.

另外,为了评估该预设字体生成模型,可以使用已见字体的已见字符集(Seenfonts Seen characters,简称SFSC)作为训练,已见字体的未见字符集(Seen fontsUnseen characters,简称SFUC)作为测试,另一个任务我们将其分为两个子任务:未见字体已见字符集(Unseen fonts Unseen characters,简称UFSC)和未见字体未见字符集(Unseen fonts Seen characters,简称UFUC),并使用在已见字体已见字符集任务中训练的模型直接对这两个子任务进行测试。In addition, in order to evaluate the preset font generation model, we can use the seen fonts seen characters (SFSC) as training and the seen fonts unseen characters (SFUC) as testing. We divide the other task into two subtasks: unseen fonts unseen characters (UFSC) and unseen fonts unseen characters (UFUC), and use the model trained in the seen fonts seen characters task to directly test these two subtasks.

从而,如图11所示,图11为本申请实施例提供的一种预设字体生成模型与其他模型针对已见字体的未见字符集的测试结果示意图,图12为本申请实施例提供的一种预设字体生成模型与其他模型针对未见字体已见字符集和未见字体未见字符集的测试结果示意图。其中,图11和图12中框出来的部分是生成效果较差的字体,倒数第二行即为本申请所提供的预设字体生成模型所对应的生成结果,可以看出本申请中的预设字体生成模型的生成结果好,最后一行为目标图片。其他行中即为其他模型针对未见字体已见字符集和未见字体未见字符集的测试结果。另外,图12中用竖线隔开的左半部分为未见字体未见字符集对应的测试结果,右半部分为未见字体已见字符集对应的测试结果。Thus, as shown in Figure 11, Figure 11 is a schematic diagram of the test results of a preset font generation model provided in an embodiment of the present application and other models for an unseen character set of a seen font, and Figure 12 is a schematic diagram of the test results of a preset font generation model provided in an embodiment of the present application and other models for an unseen character set of an unseen font and an unseen character set of an unseen font. Among them, the framed parts in Figures 11 and 12 are fonts with poor generation effects, and the second to last row is the generation result corresponding to the preset font generation model provided in the present application. It can be seen that the generation result of the preset font generation model in the present application is good, and the last row is the target image. The other rows are the test results of other models for an unseen character set of an unseen font and an unseen character set of an unseen font. In addition, the left half of Figure 12 separated by a vertical line is the test result corresponding to the unseen character set of an unseen font, and the right half is the test result corresponding to the seen character set of an unseen font.

本申请实施例中,该方法包括:获取当前源字体图片及当前参考风格字体图片集合;其中,当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各当前参考风格字体图片对应不同的内容信息,且各当前参考风格字体图片对应同一种风格信息;将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片。本方案通过预先构建的预设字体生成模型自动生成目标风格字体图片,提高了生成目标风格字体图片的效率;并且,该预设字体生成模型充分利用了多张当前参考风格字体图片的风格特征,通过有效地将这些风格特征与当前源字体图片的内容特征相匹配,提高了生成目标风格字体图片的准确性;同时,由于预设数量的多张历史参考风格字体图片是随机选取的,因此使得预设字体生成模型能够学习到更多的特征,从而进一步提高生成目标风格字体图片的准确性。In an embodiment of the present application, the method includes: obtaining a current source font image and a current reference style font image set; wherein the current reference style font image set includes a preset number of randomly selected current reference style font images, each current reference style font image corresponds to different content information, and each current reference style font image corresponds to the same style information; the current source font image and the current reference style font image set are input into a preset font generation model for calculation to generate a target style font image corresponding to the current source font image. This scheme automatically generates a target style font image through a pre-constructed preset font generation model, thereby improving the efficiency of generating a target style font image; and, the preset font generation model makes full use of the style features of multiple current reference style font images, and improves the accuracy of generating a target style font image by effectively matching these style features with the content features of the current source font image; at the same time, since a preset number of multiple historical reference style font images are randomly selected, the preset font generation model can learn more features, thereby further improving the accuracy of generating a target style font image.

应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

图13为本发明实施例提供的一种基于风格信息与内容信息适配的字体生成装置的结构框图。FIG. 13 is a structural block diagram of a font generation device based on adaptation of style information and content information provided by an embodiment of the present invention.

如图13所示,该基于风格信息与内容信息适配的字体生成装置1300包括:As shown in FIG. 13 , the font generation device 1300 based on adaptation of style information and content information includes:

获取模块1302,用于获取当前源字体图片及当前参考风格字体图片集合;其中,所述当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各所述当前参考风格字体图片对应不同的内容信息,且各所述当前参考风格字体图片对应同一种风格信息。The acquisition module 1302 is used to obtain the current source font image and the current reference style font image set; wherein the current reference style font image set includes a preset number of randomly selected current reference style font images, each of which corresponds to different content information, and each of which corresponds to the same style information.

生成模块1304,用于将所述当前源字体图片及所述当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与所述当前源字体图片对应的目标风格字体图片;其中,所述目标风格字体图片的内容信息与所述当前源字体图片的内容信息相同,且所述目标风格字体图片的风格信息与各所述当前参考风格字体图片的风格信息相同。The generation module 1304 is used to input the current source font image and the current reference style font image set into a preset font generation model for calculation, and generate a target style font image corresponding to the current source font image; wherein the content information of the target style font image is the same as the content information of the current source font image, and the style information of the target style font image is the same as the style information of each of the current reference style font images.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。上述基于风格信息与内容信息适配的字体生成装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块的操作。Regarding the device in the above embodiment, the specific way in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here. Each module in the above font generation device based on the adaptation of style information and content information can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations of the above modules.

在本申请的一个实施例中,提供了一种计算机设备,该计算机设备包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment of the present application, a computer device is provided, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

获取当前源字体图片及当前参考风格字体图片集合;其中,当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各当前参考风格字体图片对应不同的内容信息,且各当前参考风格字体图片对应同一种风格信息;Obtaining a current source font image and a current reference style font image set; wherein the current reference style font image set includes a preset number of randomly selected current reference style font images, each current reference style font image corresponds to different content information, and each current reference style font image corresponds to the same style information;

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片;其中,目标风格字体图片的内容信息与当前源字体图片的内容信息相同,且目标风格字体图片的风格信息与各当前参考风格字体图片的风格信息相同。The current source font image and the current reference style font image set are input into a preset font generation model for calculation to generate a target style font image corresponding to the current source font image; wherein the content information of the target style font image is the same as the content information of the current source font image, and the style information of the target style font image is the same as the style information of each current reference style font image.

在本申请的一个实施例中,预设字体生成模型包括内容编码器、风格编码器、风格内容特征适配模块和解码器,处理器执行计算机程序时还实现以下步骤:In one embodiment of the present application, the preset font generation model includes a content encoder, a style encoder, a style content feature adaptation module and a decoder, and the processor further implements the following steps when executing the computer program:

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中,通过内容编码器对当前源字体图片进行特征提取,生成第一内容特征;Inputting the current source font image and the current reference style font image set into a preset font generation model, performing feature extraction on the current source font image through a content encoder, and generating a first content feature;

通过风格编码器对当前参考风格字体图片集合进行特征提取,生成第一风格特征集合;其中,第一风格特征集合中包括与各当前参考风格字体图片对应的第一风格特征;Extracting features from the current reference style font picture set through a style encoder to generate a first style feature set; wherein the first style feature set includes first style features corresponding to each current reference style font picture;

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行融合处理,生成融合特征;The first content feature and the first style feature set are fused by a style content feature adaptation module to generate a fused feature;

通过解码器对融合特征进行解码处理,生成目标风格字体图片。The fused features are decoded through the decoder to generate the target style font image.

在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行连接操作,生成连接特征;连接特征中包括与第一内容特征对应的第二内容特征,及与第一风格特征集合对应的第二风格特征集合,第二风格特征集合中包括与各第一风格特征对应的第二风格特征;The first content feature and the first style feature set are connected by the style content feature adaptation module to generate a connection feature; the connection feature includes a second content feature corresponding to the first content feature and a second style feature set corresponding to the first style feature set, and the second style feature set includes a second style feature corresponding to each first style feature;

计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重;Calculating a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set;

基于第一权重及第二权重,对第二内容特征及第二风格特征集合进行加权融合处理,生成融合特征。Based on the first weight and the second weight, a weighted fusion process is performed on the second content feature and the second style feature set to generate a fusion feature.

在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

对连接特征进行求和处理,生成组合特征;Sum the connected features to generate combined features;

对组合特征进行全局平均池化处理,生成特征向量;Perform global average pooling on the combined features to generate a feature vector;

对特征向量进行压缩处理,生成压缩特征;Compress the feature vector to generate compressed features;

对压缩特征进行转换处理,生成与第二内容特征对应的第一概率分布,及与第二风格特征集合对应的第二概率分布;Performing conversion processing on the compressed features to generate a first probability distribution corresponding to the second content feature and a second probability distribution corresponding to the second style feature set;

基于第一概率分布及第二概率分布,分别计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重。Based on the first probability distribution and the second probability distribution, a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set are calculated respectively.

在本申请的一个实施例中,预设数量的多张当前参考风格字体图片为小于或等于六张当前参考风格字体图片。In one embodiment of the present application, the preset number of the multiple current reference style font pictures is less than or equal to six current reference style font pictures.

在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

获取训练样本集及目标图片;其中,训练样本集中包括历史源字体图片及多种类型的历史参考风格字体图片集合,各种类型的历史参考风格字体图片集合对应不同的风格信息,历史参考风格字体图片集合中包括随机选取的预设数量的多张历史参考风格字体图片,各历史参考风格字体图片对应不同的内容信息,且各历史参考风格字体图片对应同一种风格信息;Acquire a training sample set and a target image; wherein the training sample set includes a historical source font image and a plurality of types of historical reference style font image sets, each type of historical reference style font image set corresponds to different style information, the historical reference style font image set includes a preset number of randomly selected historical reference style font images, each historical reference style font image corresponds to different content information, and each historical reference style font image corresponds to the same style information;

将训练样本集及目标图片输入至初始字体生成模型中进行训练,得到输出结果;Input the training sample set and the target image into the initial font generation model for training to obtain the output result;

基于输出结果计算整体损失值,并根据整体损失值更新模型参数,基于更新后的模型参数生成预设字体生成模型。An overall loss value is calculated based on the output result, and the model parameters are updated according to the overall loss value, and a preset font generation model is generated based on the updated model parameters.

在本申请的一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

基于输出结果及目标图片,计算平均绝对误差损失值;Based on the output results and the target image, calculate the mean absolute error loss value;

基于输出结果及历史源字体图片,计算内容对抗损失值;Calculate the content adversarial loss value based on the output results and historical source font images;

针对各种类型的历史参考风格字体图片集合,基于输出结果及历史参考风格字体图片集合,计算风格对抗损失值;For various types of historical reference style font image collections, calculate the style adversarial loss value based on the output results and the historical reference style font image collections;

基于平均绝对误差损失值、内容对抗损失值及风格对抗损失值,生成整体损失值。Based on the mean absolute error loss value, content adversarial loss value and style adversarial loss value, an overall loss value is generated.

本申请实施例提供的计算机设备,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The computer device provided in the embodiment of the present application has similar implementation principles and technical effects to those of the above-mentioned method embodiment, which will not be repeated here.

在本申请的一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

获取当前源字体图片及当前参考风格字体图片集合;其中,当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各当前参考风格字体图片对应不同的内容信息,且各当前参考风格字体图片对应同一种风格信息;Obtaining a current source font image and a current reference style font image set; wherein the current reference style font image set includes a preset number of randomly selected current reference style font images, each current reference style font image corresponds to different content information, and each current reference style font image corresponds to the same style information;

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中进行计算,生成与当前源字体图片对应的目标风格字体图片;其中,目标风格字体图片的内容信息与当前源字体图片的内容信息相同,且目标风格字体图片的风格信息与各当前参考风格字体图片的风格信息相同。The current source font image and the current reference style font image set are input into a preset font generation model for calculation to generate a target style font image corresponding to the current source font image; wherein the content information of the target style font image is the same as the content information of the current source font image, and the style information of the target style font image is the same as the style information of each current reference style font image.

在本申请的一个实施例中,预设字体生成模型包括内容编码器、风格编码器、风格内容特征适配模块和解码器,计算机程序被处理器执行时还实现以下步骤:In one embodiment of the present application, the preset font generation model includes a content encoder, a style encoder, a style content feature adaptation module and a decoder, and when the computer program is executed by the processor, the following steps are also implemented:

将当前源字体图片及当前参考风格字体图片集合输入至预设字体生成模型中,通过内容编码器对当前源字体图片进行特征提取,生成第一内容特征;Inputting the current source font image and the current reference style font image set into a preset font generation model, performing feature extraction on the current source font image through a content encoder, and generating a first content feature;

通过风格编码器对当前参考风格字体图片集合进行特征提取,生成第一风格特征集合;其中,第一风格特征集合中包括与各当前参考风格字体图片对应的第一风格特征;Extracting features from the current reference style font picture set through a style encoder to generate a first style feature set; wherein the first style feature set includes first style features corresponding to each current reference style font picture;

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行融合处理,生成融合特征;The first content feature and the first style feature set are fused by a style content feature adaptation module to generate a fused feature;

通过解码器对融合特征进行解码处理,生成目标风格字体图片。The fused features are decoded through the decoder to generate the target style font image.

在本申请的一个实施例中,计算机程序被处理器执行时实现以下步骤:In one embodiment of the present application, when the computer program is executed by a processor, the following steps are implemented:

通过风格内容特征适配模块对第一内容特征及第一风格特征集合进行连接操作,生成连接特征;连接特征中包括与第一内容特征对应的第二内容特征,及与第一风格特征集合对应的第二风格特征集合,第二风格特征集合中包括与各第一风格特征对应的第二风格特征;The first content feature and the first style feature set are connected by the style content feature adaptation module to generate a connection feature; the connection feature includes a second content feature corresponding to the first content feature and a second style feature set corresponding to the first style feature set, and the second style feature set includes a second style feature corresponding to each first style feature;

计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重;Calculating a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set;

基于第一权重及第二权重,对第二内容特征及第二风格特征集合进行加权融合处理,生成融合特征。Based on the first weight and the second weight, a weighted fusion process is performed on the second content feature and the second style feature set to generate a fusion feature.

在本申请的一个实施例中,计算机程序被处理器执行时实现以下步骤:In one embodiment of the present application, when the computer program is executed by a processor, the following steps are implemented:

对连接特征进行求和处理,生成组合特征;Sum the connected features to generate combined features;

对组合特征进行全局平均池化处理,生成特征向量;Perform global average pooling on the combined features to generate a feature vector;

对特征向量进行压缩处理,生成压缩特征;Compress the feature vector to generate compressed features;

对压缩特征进行转换处理,生成与第二内容特征对应的第一概率分布,及与第二风格特征集合对应的第二概率分布;Performing conversion processing on the compressed features to generate a first probability distribution corresponding to the second content feature and a second probability distribution corresponding to the second style feature set;

基于第一概率分布及第二概率分布,分别计算与第二内容特征对应的第一权重,及与第二风格特征集合对应的第二权重。Based on the first probability distribution and the second probability distribution, a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set are calculated respectively.

在本申请的一个实施例中,预设数量的多张当前参考风格字体图片为小于或等于六张当前参考风格字体图片。In one embodiment of the present application, the preset number of the multiple current reference style font pictures is less than or equal to six current reference style font pictures.

在本申请的一个实施例中,计算机程序被处理器执行时实现以下步骤:In one embodiment of the present application, when the computer program is executed by a processor, the following steps are implemented:

获取训练样本集及目标图片;其中,训练样本集中包括历史源字体图片及多种类型的历史参考风格字体图片集合,各种类型的历史参考风格字体图片集合对应不同的风格信息,历史参考风格字体图片集合中包括随机选取的预设数量的多张历史参考风格字体图片,各历史参考风格字体图片对应不同的内容信息,且各历史参考风格字体图片对应同一种风格信息;Acquire a training sample set and a target image; wherein the training sample set includes a historical source font image and a plurality of types of historical reference style font image sets, each type of historical reference style font image set corresponds to different style information, the historical reference style font image set includes a preset number of randomly selected historical reference style font images, each historical reference style font image corresponds to different content information, and each historical reference style font image corresponds to the same style information;

将训练样本集及目标图片输入至初始字体生成模型中进行训练,得到输出结果;Input the training sample set and the target image into the initial font generation model for training to obtain the output result;

基于输出结果计算整体损失值,并根据整体损失值更新模型参数,基于更新后的模型参数生成预设字体生成模型。An overall loss value is calculated based on the output result, and the model parameters are updated according to the overall loss value, and a preset font generation model is generated based on the updated model parameters.

在本申请的一个实施例中,计算机程序被处理器执行时实现以下步骤:In one embodiment of the present application, when the computer program is executed by a processor, the following steps are implemented:

基于输出结果及目标图片,计算平均绝对误差损失值;Based on the output results and the target image, calculate the mean absolute error loss value;

基于输出结果及历史源字体图片,计算内容对抗损失值;Calculate the content adversarial loss value based on the output results and historical source font images;

针对各种类型的历史参考风格字体图片集合,基于输出结果及历史参考风格字体图片集合,计算风格对抗损失值;For various types of historical reference style font image collections, calculate the style adversarial loss value based on the output results and the historical reference style font image collections;

基于平均绝对误差损失值、内容对抗损失值及风格对抗损失值,生成整体损失值。Based on the mean absolute error loss value, content adversarial loss value and style adversarial loss value, an overall loss value is generated.

本实施例提供的计算机可读存储介质,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The computer-readable storage medium provided in this embodiment has similar implementation principles and technical effects to those of the above method embodiments, and will not be described in detail here.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and/or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (8)

1.一种基于风格信息与内容信息适配的字体生成方法,其特征在于,所述方法包括:1. A font generation method based on adaptation of style information and content information, characterized in that the method includes: 获取当前源字体图片及当前参考风格字体图片集合;其中,所述当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各所述当前参考风格字体图片对应不同的内容信息,且各所述当前参考风格字体图片对应同一种风格信息;Obtain the current source font picture and the current reference style font picture set; wherein the current reference style font picture set includes a randomly selected preset number of current reference style font pictures, and each of the current reference style font pictures corresponds to different content information, and each of the current reference style font pictures corresponds to the same style information; 将所述当前源字体图片及所述当前参考风格字体图片集合输入至预设字体生成模型中,通过所述预设字体生成模型中的内容编码器对所述当前源字体图片进行特征提取,生成第一内容特征;The current source font picture and the current reference style font picture set are input into the preset font generation model, and the content encoder in the preset font generation model performs feature extraction on the current source font picture to generate First content characteristics; 通过所述预设字体生成模型中的风格编码器对所述当前参考风格字体图片集合进行特征提取,生成第一风格特征集合;其中,所述第一风格特征集合中包括与各所述当前参考风格字体图片对应的第一风格特征;The style encoder in the preset font generation model performs feature extraction on the current reference style font picture set to generate a first style feature set; wherein the first style feature set includes the same as each of the current reference The first style feature corresponding to the style font picture; 通过所述预设字体生成模型中的风格内容特征适配模块对所述第一内容特征及所述第一风格特征集合进行连接操作,生成连接特征;所述连接特征中包括与所述第一内容特征对应的第二内容特征,及与所述第一风格特征集合对应的第二风格特征集合,所述第二风格特征集合中包括与各所述第一风格特征对应的第二风格特征;The first content feature and the first style feature set are connected through the style content feature adaptation module in the preset font generation model to generate a connection feature; the connection feature includes the first content feature and the first style feature set. a second content feature corresponding to the content feature, and a second style feature set corresponding to the first style feature set, where the second style feature set includes a second style feature corresponding to each of the first style features; 计算与所述第二内容特征对应的第一权重,及与所述第二风格特征集合对应的第二权重;Calculate a first weight corresponding to the second content feature and a second weight corresponding to the second set of style features; 基于所述第一权重及所述第二权重,对所述第二内容特征及所述第二风格特征集合进行加权融合处理,生成融合特征;Based on the first weight and the second weight, perform a weighted fusion process on the second content feature and the second style feature set to generate a fusion feature; 通过所述预设字体生成模型中的解码器对所述融合特征进行解码处理,生成与所述当前源字体图片对应的目标风格字体图片;所述目标风格字体图片的内容信息与所述当前源字体图片的内容信息相同,且所述目标风格字体图片的风格信息与各所述当前参考风格字体图片的风格信息相同。The decoder in the preset font generation model decodes the fusion features to generate a target style font picture corresponding to the current source font picture; the content information of the target style font picture is consistent with the current source font picture. The content information of the font pictures is the same, and the style information of the target style font picture is the same as the style information of each of the current reference style font pictures. 2.根据权利要求1所述的方法,其特征在于,所述计算与所述第二内容特征对应的第一权重,及与所述第二风格特征集合对应的第二权重,包括:2. The method according to claim 1, characterized in that the calculation of the first weight corresponding to the second content feature and the second weight corresponding to the second style feature set includes: 对所述连接特征进行求和处理,生成组合特征;Perform summation processing on the connection features to generate combined features; 对所述组合特征进行全局平均池化处理,生成特征向量;Perform global average pooling processing on the combined features to generate feature vectors; 对所述特征向量进行压缩处理,生成压缩特征;Perform compression processing on the feature vector to generate compressed features; 对所述压缩特征进行转换处理,生成与所述第二内容特征对应的第一概率分布,及与所述第二风格特征集合对应的第二概率分布;Convert the compression features to generate a first probability distribution corresponding to the second content feature and a second probability distribution corresponding to the second style feature set; 基于所述第一概率分布及所述第二概率分布,分别计算与所述第二内容特征对应的第一权重,及与所述第二风格特征集合对应的第二权重。Based on the first probability distribution and the second probability distribution, a first weight corresponding to the second content feature and a second weight corresponding to the second style feature set are respectively calculated. 3.根据权利要求1或2所述的方法,其特征在于,所述预设数量的多张当前参考风格字体图片为小于或等于六张当前参考风格字体图片。3. The method according to claim 1 or 2, characterized in that the preset number of multiple current reference style font pictures is less than or equal to six current reference style font pictures. 4.根据权利要求1或2所述的方法,其特征在于,所述预设字体生成模型的构建过程,包括:4. The method according to claim 1 or 2, characterized in that the construction process of the preset font generation model includes: 获取训练样本集及目标图片;其中,所述训练样本集中包括历史源字体图片及多种类型的历史参考风格字体图片集合,各种类型的所述历史参考风格字体图片集合对应不同的风格信息,所述历史参考风格字体图片集合中包括随机选取的预设数量的多张历史参考风格字体图片,各所述历史参考风格字体图片对应不同的内容信息,且各所述历史参考风格字体图片对应同一种风格信息;Obtain a training sample set and a target image; wherein, the training sample set includes historical source font images and multiple types of historical reference style font image sets, and various types of historical reference style font image sets correspond to different style information, The collection of historical reference style font pictures includes a preset number of randomly selected historical reference style font pictures, each of the historical reference style font pictures corresponds to different content information, and each of the historical reference style font pictures corresponds to the same style information; 将所述训练样本集及所述目标图片输入至初始字体生成模型中进行训练,得到输出结果;Input the training sample set and the target image into the initial font generation model for training to obtain an output result; 基于所述输出结果计算整体损失值,并根据所述整体损失值更新模型参数,基于更新后的模型参数生成所述预设字体生成模型。Calculate an overall loss value based on the output result, update model parameters based on the overall loss value, and generate the preset font generation model based on the updated model parameters. 5.根据权利要求4所述的方法,其特征在于,所述基于所述输出结果计算整体损失值,包括:5. The method of claim 4, wherein calculating the overall loss value based on the output result includes: 基于所述输出结果及所述目标图片,计算平均绝对误差损失值;Based on the output result and the target image, calculate an average absolute error loss value; 基于所述输出结果及所述历史源字体图片,计算内容对抗损失值;Based on the output result and the historical source font image, calculate the content confrontation loss value; 针对各种类型的所述历史参考风格字体图片集合,基于所述输出结果及所述历史参考风格字体图片集合,计算风格对抗损失值;For various types of historical reference style font picture sets, calculate a style confrontation loss value based on the output result and the historical reference style font picture set; 基于所述平均绝对误差损失值、所述内容对抗损失值及所述风格对抗损失值,生成所述整体损失值。The overall loss value is generated based on the mean absolute error loss value, the content adversarial loss value, and the style adversarial loss value. 6.一种基于风格信息与内容信息适配的字体生成装置,其特征在于,所述装置包括:6. A font generation device based on adaptation of style information and content information, characterized in that the device includes: 获取模块,用于获取当前源字体图片及当前参考风格字体图片集合;其中,所述当前参考风格字体图片集合中包括随机选取的预设数量的多张当前参考风格字体图片,各所述当前参考风格字体图片对应不同的内容信息,且各所述当前参考风格字体图片对应同一种风格信息;The acquisition module is used to obtain the current source font picture and the current reference style font picture set; wherein the current reference style font picture set includes a randomly selected preset number of current reference style font pictures, each of the current reference style font pictures is The style font pictures correspond to different content information, and each of the current reference style font pictures corresponds to the same style information; 生成模块,用于将所述当前源字体图片及所述当前参考风格字体图片集合输入至预设字体生成模型中,通过所述预设字体生成模型中的内容编码器对所述当前源字体图片进行特征提取,生成第一内容特征;通过所述预设字体生成模型中的风格编码器对所述当前参考风格字体图片集合进行特征提取,生成第一风格特征集合;其中,所述第一风格特征集合中包括与各所述当前参考风格字体图片对应的第一风格特征;通过所述预设字体生成模型中的风格内容特征适配模块对所述第一内容特征及所述第一风格特征集合进行连接操作,生成连接特征;所述连接特征中包括与所述第一内容特征对应的第二内容特征,及与所述第一风格特征集合对应的第二风格特征集合,所述第二风格特征集合中包括与各所述第一风格特征对应的第二风格特征;计算与所述第二内容特征对应的第一权重,及与所述第二风格特征集合对应的第二权重;基于所述第一权重及所述第二权重,对所述第二内容特征及所述第二风格特征集合进行加权融合处理,生成融合特征;通过所述预设字体生成模型中的解码器对所述融合特征进行解码处理,生成与所述当前源字体图片对应的目标风格字体图片;所述目标风格字体图片的内容信息与所述当前源字体图片的内容信息相同,且所述目标风格字体图片的风格信息与各所述当前参考风格字体图片的风格信息相同。A generation module, configured to input the current source font picture and the current reference style font picture set into a preset font generation model, and use the content encoder in the preset font generation model to encode the current source font picture. Perform feature extraction to generate first content features; perform feature extraction on the current reference style font picture set through the style encoder in the preset font generation model to generate a first style feature set; wherein, the first style The feature set includes a first style feature corresponding to each of the current reference style font pictures; the first content feature and the first style feature are configured through a style content feature adaptation module in the preset font generation model. The set performs a connection operation to generate connection features; the connection features include a second content feature corresponding to the first content feature, and a second style feature set corresponding to the first style feature set, and the second The style feature set includes second style features corresponding to each of the first style features; calculating a first weight corresponding to the second content feature, and a second weight corresponding to the second style feature set; based on The first weight and the second weight perform a weighted fusion process on the second content feature and the second style feature set to generate a fusion feature; the decoder in the preset font generation model performs a weighted fusion process on all the features. The fusion features are decoded to generate a target style font picture corresponding to the current source font picture; the content information of the target style font picture is the same as the content information of the current source font picture, and the target style font picture is The style information of is the same as the style information of each of the current reference style font pictures. 7.一种电子设备,其特征在于,所述电子设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1-5任一项所述的基于风格信息与内容信息适配的字体生成方法。7. An electronic device, characterized in that the electronic device includes a processor and a memory, and the memory stores at least one instruction, at least a program, a code set or an instruction set, the at least one instruction, the at least A program, the code set or the instruction set is loaded and executed by the processor to implement the font generation method based on the adaptation of style information and content information as described in any one of claims 1-5. 8.一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如权利要求1-5任一项所述的基于风格信息与内容信息适配的字体生成方法。8. A computer-readable storage medium, characterized in that the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code The set or instruction set is loaded and executed by the processor to implement the font generation method based on the adaptation of style information and content information as described in any one of claims 1 to 5.
CN202311503006.6A 2023-11-13 2023-11-13 Font generation method and device based on adaptation of style information and content information Pending CN117236284A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311503006.6A CN117236284A (en) 2023-11-13 2023-11-13 Font generation method and device based on adaptation of style information and content information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311503006.6A CN117236284A (en) 2023-11-13 2023-11-13 Font generation method and device based on adaptation of style information and content information

Publications (1)

Publication Number Publication Date
CN117236284A true CN117236284A (en) 2023-12-15

Family

ID=89096958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311503006.6A Pending CN117236284A (en) 2023-11-13 2023-11-13 Font generation method and device based on adaptation of style information and content information

Country Status (1)

Country Link
CN (1) CN117236284A (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109255772A (en) * 2018-08-27 2019-01-22 平安科技(深圳)有限公司 License plate image generation method, device, equipment and medium based on Style Transfer
CN111553246A (en) * 2020-04-15 2020-08-18 山东大学 Chinese character style migration method and system based on multi-task antagonistic learning network
CN113052143A (en) * 2021-04-26 2021-06-29 中国建设银行股份有限公司 Handwritten digit generation method and device
CN113393370A (en) * 2021-06-02 2021-09-14 西北大学 Method, system and intelligent terminal for migrating Chinese calligraphy character and image styles
CN113962192A (en) * 2021-04-28 2022-01-21 江西师范大学 Method and device for generating Chinese character font generation model and Chinese character font generation method and device
CN114139495A (en) * 2021-11-29 2022-03-04 合肥高维数据技术有限公司 Chinese font style migration method based on adaptive generation countermeasure network
CN114418834A (en) * 2021-12-29 2022-04-29 北京字跳网络技术有限公司 Character generation method and device, electronic equipment and storage medium
US20220147695A1 (en) * 2021-09-09 2022-05-12 Beijing Baidu Netcom Science Technology Co., Ltd. Model training method and apparatus, font library establishment method and apparatus, and storage medium
CN114820871A (en) * 2022-06-29 2022-07-29 北京百度网讯科技有限公司 Font generation method, model training method, device, equipment and medium
CN115222845A (en) * 2022-08-01 2022-10-21 北京元亦科技有限公司 Method and device for generating style font picture, electronic equipment and medium
CN115311130A (en) * 2022-07-16 2022-11-08 西北大学 Method, system and terminal for migrating styles of Chinese, calligraphy and digital images in multiple lattices
CN115828848A (en) * 2021-09-15 2023-03-21 浙江大学 Font generation model training method, device, equipment and storage medium
CN116152368A (en) * 2022-12-23 2023-05-23 浙江大学 Font generation method, font generation model training method, device and equipment
CN116416628A (en) * 2023-06-06 2023-07-11 广州宏途数字科技有限公司 Handwriting font recognition based method and recognition system
CN116433474A (en) * 2023-05-09 2023-07-14 北京华文众合科技有限公司 Model training method, font migration device and medium
CN116469111A (en) * 2023-06-08 2023-07-21 江西师范大学 A text generation model training method and target text generation method
CN116681581A (en) * 2023-05-17 2023-09-01 网易(杭州)网络有限公司 Font generation method and device, electronic equipment and readable storage medium

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109255772A (en) * 2018-08-27 2019-01-22 平安科技(深圳)有限公司 License plate image generation method, device, equipment and medium based on Style Transfer
CN111553246A (en) * 2020-04-15 2020-08-18 山东大学 Chinese character style migration method and system based on multi-task antagonistic learning network
CN113052143A (en) * 2021-04-26 2021-06-29 中国建设银行股份有限公司 Handwritten digit generation method and device
CN113962192A (en) * 2021-04-28 2022-01-21 江西师范大学 Method and device for generating Chinese character font generation model and Chinese character font generation method and device
CN113393370A (en) * 2021-06-02 2021-09-14 西北大学 Method, system and intelligent terminal for migrating Chinese calligraphy character and image styles
US20220147695A1 (en) * 2021-09-09 2022-05-12 Beijing Baidu Netcom Science Technology Co., Ltd. Model training method and apparatus, font library establishment method and apparatus, and storage medium
CN115828848A (en) * 2021-09-15 2023-03-21 浙江大学 Font generation model training method, device, equipment and storage medium
CN114139495A (en) * 2021-11-29 2022-03-04 合肥高维数据技术有限公司 Chinese font style migration method based on adaptive generation countermeasure network
CN114418834A (en) * 2021-12-29 2022-04-29 北京字跳网络技术有限公司 Character generation method and device, electronic equipment and storage medium
WO2023125361A1 (en) * 2021-12-29 2023-07-06 北京字跳网络技术有限公司 Character generation method and apparatus, electronic device, and storage medium
CN114820871A (en) * 2022-06-29 2022-07-29 北京百度网讯科技有限公司 Font generation method, model training method, device, equipment and medium
CN115311130A (en) * 2022-07-16 2022-11-08 西北大学 Method, system and terminal for migrating styles of Chinese, calligraphy and digital images in multiple lattices
CN115222845A (en) * 2022-08-01 2022-10-21 北京元亦科技有限公司 Method and device for generating style font picture, electronic equipment and medium
CN116152368A (en) * 2022-12-23 2023-05-23 浙江大学 Font generation method, font generation model training method, device and equipment
CN116433474A (en) * 2023-05-09 2023-07-14 北京华文众合科技有限公司 Model training method, font migration device and medium
CN116681581A (en) * 2023-05-17 2023-09-01 网易(杭州)网络有限公司 Font generation method and device, electronic equipment and readable storage medium
CN116416628A (en) * 2023-06-06 2023-07-11 广州宏途数字科技有限公司 Handwriting font recognition based method and recognition system
CN116469111A (en) * 2023-06-08 2023-07-21 江西师范大学 A text generation model training method and target text generation method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
刘明昊;: "基于VGG-16的图像风格迁移", 电子制作, no. 12 *
李进;高静;陈俊杰;王永军;: "基于条件生成对抗网络的蒙古文字体风格迁移模型", 中文信息学报, no. 04 *
王晓红;卢辉;麻祥才;: "基于生成对抗网络的风格化书法图像生成", 包装工程, no. 11 *
白海娟;周未;王存睿;王磊;: "基于生成式对抗网络的字体风格迁移方法", 大连民族大学学报, no. 03 *

Similar Documents

Publication Publication Date Title
US11328523B2 (en) Image composites using a generative neural network
CN112330685B (en) Image segmentation model training method, image segmentation device and electronic equipment
CN110399825B (en) Facial expression migration method and device, storage medium and computer equipment
CN110889747B (en) Commodity recommendation method, device, system, computer equipment and storage medium
CN113538441A (en) Image segmentation model processing method, image processing method and device
CN109685873B (en) Face reconstruction method, device, equipment and storage medium
CN113505797A (en) Model training method and device, computer equipment and storage medium
CN112001399B (en) Image scene classification method and device based on local feature saliency
CN113705276B (en) Model construction method, model construction device, computer equipment and medium
CN109325118A (en) Uneven sample data preprocess method, device and computer equipment
CN113192175A (en) Model training method and device, computer equipment and readable storage medium
CN112785005A (en) Multi-target task assistant decision-making method and device, computer equipment and medium
CN113569809A (en) Image processing method, device and computer readable storage medium
CN113822790A (en) Image processing method, device, equipment and computer readable storage medium
CN115690276A (en) Video generation method and device of virtual image, computer equipment and storage medium
CN113743448B (en) Model training data acquisition method, model training method and device
CN114912972A (en) Block chain based network promotion marketing platform and method thereof
WO2025021142A1 (en) Object detection method and related device thereof
CN117236284A (en) Font generation method and device based on adaptation of style information and content information
WO2022127603A1 (en) Model processing method and related device
CN111651623B (en) Method, device, equipment and storage medium for constructing high-precision facial expression library
CN113360744B (en) Media content recommendation method, device, computer equipment and storage medium
CN112102304A (en) Image processing method, image processing device, computer equipment and computer readable storage medium
CN118470539B (en) Building base extraction method, device and equipment based on non-orthographic remote sensing image
CN113506232B (en) Image generation method, device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20231215

RJ01 Rejection of invention patent application after publication