Template matching methods and electronic devices for video editing
By filtering templates that match the theme of the material from the template library and using multiple preset indicators to evaluate the matching degree, the problem of inaccurate template recommendations in existing technologies is solved, thereby improving the effect of material editing and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2023-11-30
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, when recommending editing templates through theme matching, the recommended templates may not match the user's input content well, affecting the final product and user experience.
By acquiring the user-selected footage to be edited, the theme of each template in the template library is identified, matching templates are filtered out, and the matching degree between each template and the footage is evaluated based on multiple preset matching indicators. Target templates are then selected for recommendation.
It improves the matching degree between templates and materials, enhances the final product effect and user experience, increases the efficiency and reliability of template matching, and meets users' personalized needs.
Smart Images

Figure CN120107629B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer application technology, and in particular relates to a template matching method for material editing, an electronic device, and a computer-readable storage medium. Background Technology
[0002] With the widespread adoption and rapid development of smartphones and other electronic devices, their functions have become increasingly sophisticated. For example, users can take photos using the camera function and edit videos and images using the editing functions. Some editing applications can automatically recommend editing templates based on the user-provided materials, allowing even users who are not skilled in editing to achieve good results, thus improving the convenience of editing and meeting users' needs for quick editing.
[0003] In related technologies, after a user selects the footage to be edited, the footage can be thematically identified, and templates matching the themes can be automatically recommended to the user. However, relying solely on thematic matching can easily lead to a low degree of match between the recommended templates and the user-input footage content, resulting in unsatisfactory final product and negatively impacting the user experience. Summary of the Invention
[0004] This application provides a template matching method for material editing, an electronic device, and a computer-readable storage medium. It can solve the problem that the method of recommending editing templates by theme matching is prone to low matching degree between the recommended templates and the material content input by the user, resulting in unsatisfactory finished product and affecting user experience.
[0005] In a first aspect, embodiments of this application provide a template matching method for editing media, comprising: acquiring at least one media to be edited selected by a user, wherein the media to be edited includes at least one of video and image; performing theme identification on the media to be edited according to various template themes contained in a template library, so as to acquire multiple templates to be matched from the template library; matching each template to be matched with the media to be edited according to at least one preset matching index, so as to determine the target matching score corresponding to each template to be matched; and selecting at least one template to be matched as the target template corresponding to the media to be edited according to the target matching score corresponding to each template to be matched.
[0006] In this way, the first step is to select a matching template that matches the theme of the material to be edited by theme recognition. Then, based on at least one preset matching index, the matching degree between the matching template and the material to be edited is evaluated from multiple evaluation dimensions. Based on the matching degree between the matching template and the material to be edited, a suitable target template is selected and recommended to the user, thereby improving the matching degree between the recommended template and the material selected by the user, improving the final product effect, and improving the user experience.
[0007] In one possible implementation of the first aspect, the above-mentioned theme identification of the footage to be edited is performed based on the various template themes contained in the template library, in order to obtain multiple templates to be matched from the template library, including:
[0008] The theme of the footage to be edited is identified based on each template theme to determine the degree of matching between the footage to be edited and each template theme;
[0009] Based on the matching degree between the footage to be edited and each template theme, determine the template theme to be matched with the footage to be edited;
[0010] Each template in the template library whose theme is the same as the theme to be matched is identified as the template to be matched.
[0011] In this way, by first identifying the theme of the footage to be edited, and then selecting templates from the template library whose theme matches the theme of the footage to be edited as templates for further matching, templates that are not related to the theme of the footage to be edited are removed, thereby reducing the computational load of subsequent template matching, improving the efficiency of template matching, and further improving the user experience.
[0012] Optionally, in another possible implementation of the first aspect, the number of the aforementioned preset matching indicators is N, where N is a positive integer; correspondingly, the above-mentioned matching of each template to be matched with the material to be edited according to at least one preset matching indicator to determine the target matching score corresponding to each template to be matched includes:
[0013] According to the i-th preset matching index, the first template to be matched is matched with the material to be edited to determine the i-th matching score corresponding to the first template to be matched, where the first template to be matched is any template to be matched, 1≤i≤N;
[0014] Based on the N matching scores corresponding to the first template to be matched, determine the target matching score corresponding to the first template to be matched.
[0015] In this way, by using multiple different matching indicators, the degree of matching between the template to be matched and the material to be edited is evaluated from multiple dimensions, and a matching score for the template to be matched is generated under each matching indicator. Then, the final matching score of the template to be matched is determined based on the matching scores under each indicator. This achieves the quantification of the degree of matching between the template to be matched and the material to be edited in multiple dimensions and obtains a comprehensive score, which further improves the reliability of template matching and further improves the quality of the final product.
[0016] Optionally, in another possible implementation of the first aspect, the aforementioned preset matching indicators include at least one of the following indicators: theme matching indicator, frame matching indicator, material type indicator, slot matching indicator, download type indicator, and operation indicator.
[0017] In this way, by using metrics such as theme matching, aspect ratio matching, material type matching, slot matching, download type matching, and operation metrics, the templates to be matched and the materials to be edited are matched in terms of theme, aspect ratio, material type, and slot. Templates to be matched for specific download types and specific operation types are promoted so that the recommended templates and the materials selected by users have a high degree of matching in terms of theme, aspect ratio, material type, slot, download type, and operation type. This further improves the reliability of template matching, enhances the aesthetics of the finished product, and ultimately improves the user experience.
[0018] Optionally, in another possible implementation of the first aspect, the aforementioned i-th preset matching index is a theme matching index, and the i-th matching score is a theme matching score; correspondingly, the above-mentioned matching of the first template to be matched with the material to be edited according to the i-th preset matching index to determine the i-th matching score corresponding to the first template to be matched includes:
[0019] The theme of the footage to be edited is identified based on each template theme in order to determine the degree of matching between the footage to be edited and the template theme corresponding to the first template to be matched;
[0020] The theme matching score of the first template to be matched is determined based on the degree of matching between the material to be edited and the theme of the first template to be matched.
[0021] In this way, by determining the theme matching score of the template to be matched based on the matching degree between the template theme and the material to be edited, the degree of theme matching between the template to be matched and the material to be edited is quantified, so that the theme of the final recommended template is more closely matched with the material selected by the user, thereby making the style of the finished product match the style of the material content and further improving the user experience.
[0022] Optionally, in another possible implementation of the first aspect, the aforementioned i-th preset matching index is a frame matching index, and the i-th matching score is a frame matching score; correspondingly, the above-mentioned matching of the first template to be matched with the material to be edited according to the i-th preset matching index to determine the i-th matching score corresponding to the first template to be matched includes:
[0023] The first template to be matched is used to perform initial editing of the footage to be edited, in order to determine the initial finished film corresponding to the footage to be edited;
[0024] Obtain the initial segments included in the initial final cut and the segment duration corresponding to each initial segment;
[0025] Determine the aspect ratio corresponding to the effective display area in each initial segment;
[0026] Based on the aspect ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment, determine the aspect ratio matching score corresponding to the first template to be matched.
[0027] In this way, by using the template to be matched to perform initial editing of the footage to be edited, an initial final cut is generated. Based on the aspect ratio and clip length of the priority display area in each segment of the initial final cut, the aspect ratio matching score between the template to be matched and the footage to be edited is determined. This quantifies the degree of aspect ratio matching between the template to be matched and the footage to be edited, so that when users select multiple aspect ratios of footage, a template with a better aspect ratio matching can be matched. This maximizes the content of the footage in the final cut and minimizes the proportion of ineffective display areas such as Gaussian effects or black borders, thereby further enhancing the aesthetics of the final cut and improving the user experience.
[0028] Optionally, in another possible implementation of the first aspect, the aforementioned i-th preset matching index is a material ratio index, and the i-th matching score is a material ratio matching score; correspondingly, the above-mentioned matching of the first template to be matched with the material to be edited according to the i-th preset matching index to determine the i-th matching score corresponding to the first template to be matched includes:
[0029] Obtain the number of videos and images contained in the material to be edited, and the material type corresponding to the first template to be matched;
[0030] Determine the material ratio corresponding to the material to be edited based on the number of videos and images contained in the material to be edited;
[0031] Based on the material ratio of the material to be edited and the material type of the first template to be matched, determine the material ratio matching score of the first template to be matched.
[0032] In this way, since some templates in the template library are more suitable for video footage and others are more suitable for image footage, the proportion of footage is determined based on the number of videos and images in the footage to be edited. Then, based on the proportion of footage and the type of footage that the template is suitable for, a matching score is determined between the matching template and the footage to be edited. This quantifies the degree of matching between the matching template and the footage to be edited, so that the final recommended template can better match the type of footage selected by the user, improve the final effect of more footage as much as possible, and further enhance the user experience.
[0033] Optionally, in another possible implementation of the first aspect, the i-th preset matching index is a slot matching index, and the i-th matching score is a slot matching score; correspondingly, the above-mentioned matching of the first template to be matched with the material to be edited according to the i-th preset matching index to determine the i-th matching score corresponding to the first template to be matched includes:
[0034] Get the number of clips contained in the clip to be edited;
[0035] Get the number of slots in the first template to be matched, the duration of each slot, and the total duration of the template;
[0036] The first template to be matched is used to perform initial editing of the footage to be edited, so as to generate the initial finished film corresponding to the footage to be edited;
[0037] Obtain the total runtime of the initial final cut and the runtime of each initial segment included in the initial final cut;
[0038] Based on the number of materials and the number of slots, determine the matching degree of the number of slots corresponding to the first template to be matched;
[0039] Based on the total duration of the finished product and the total duration of the template, determine the total duration matching degree of the first template to be matched;
[0040] Based on the duration of each slot and the duration of each segment, determine the slot duration matching degree corresponding to the first template to be matched;
[0041] Based on the matching degree of the number of slots, the matching degree of the total duration, and the matching degree of the slot duration, the slot matching score corresponding to the first template to be matched is determined.
[0042] Thus, since a template can contain multiple slots, and adjacent slots can have editing effects such as music rhythm timing and template transitions to enhance the diversity and richness of the editing effects, the template to be matched can be used to perform initial editing of the footage to be edited. This allows for the determination of the matching degree between the template to be matched and the footage to be edited in terms of the number of slots, the duration of slots, and the total duration. This quantifies the degree of matching between the template to be matched and the footage to be edited, thereby making the music rhythm timing, template transitions, etc., of the finally recommended template more suitable for the footage selected by the user, further improving the editing effect of the finished product and enhancing the user experience.
[0043] Optionally, in another possible implementation of the first aspect, the determination of the slot matching score corresponding to the first template to be matched based on the slot quantity matching degree, total duration matching degree, and slot duration matching degree includes:
[0044] Get the checkpoint type corresponding to the first template to be matched;
[0045] The slot matching score is determined based on the matching degree of the number of slots, the matching degree of the total duration, the matching degree of the slot duration, and the type of checkpoint.
[0046] In this way, by taking into account the beat type of the template to be matched when determining the beat matching score, different beat matching scores are set for different beat types, so that the beat type of the final recommended template matches the material selected by the user more closely, thereby further improving the rhythm beats and template transition effects of the finished product and further enhancing the user experience.
[0047] Optionally, in another possible implementation of the first aspect, the aforementioned i-th preset matching indicator is a download type indicator, and the i-th matching score is a download score; correspondingly, the above-mentioned matching of the first template to be matched with the material to be edited according to the i-th preset matching indicator to determine the i-th matching score corresponding to the first template to be matched includes:
[0048] Obtain the download type corresponding to the first template to be matched, where the download type includes local templates and online templates;
[0049] Based on the download type, determine the download score corresponding to the first template to be matched.
[0050] In this way, by determining the download score of the template to be matched based on the download type, local or online templates can be assigned higher scores according to actual needs, making it easier to recommend local or online templates to users, thereby further improving the flexibility of template matching.
[0051] Optionally, in another possible implementation of the first aspect, determining the download score corresponding to the first template to be matched based on the download type includes:
[0052] If the download type corresponding to the first template to be matched is an online template, the download score will be set to 0.
[0053] If the download type corresponding to the first template to be matched is a local template, a score is randomly selected from the first score range and determined as the download score, wherein the minimum value of the first score range is greater than or equal to 0.
[0054] In this way, by assigning a higher download score to local templates, they are more likely to be recommended to users, thereby minimizing the data consumption of users downloading templates while ensuring the editing effect.
[0055] Optionally, in another possible implementation of the first aspect, before obtaining the download type corresponding to the first template to be matched, the method further includes:
[0056] The number of templates in the template library that are local templates and whose download type is determined to be greater than the number threshold.
[0057] Optionally, in another possible implementation of the first aspect, the aforementioned i-th preset matching indicator is an operational indicator, and the i-th matching score is an operational matching score; correspondingly, the above-mentioned matching of the first template to be matched with the material to be edited according to the i-th preset matching indicator to determine the i-th matching score corresponding to the first template to be matched includes:
[0058] Get the operation type corresponding to the first template to be matched;
[0059] Based on the operation type, determine the operation matching score corresponding to the first template to be matched.
[0060] Optionally, in another possible implementation of the first aspect, the determination of the operation matching score corresponding to the first template to be matched based on the operation type includes:
[0061] When the operation type is a preset operation type, a score is randomly selected from the second score range to determine the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0062] If the operation type is not the preset operation type, the operation matching score will be set to 0.
[0063] In this way, by determining the operation matching score of the template to be matched based on the operation type, higher scores can be assigned to the templates to be matched that need to be promoted according to actual needs, making it easier to recommend the templates to users and thus further improving the flexibility of template matching.
[0064] Optionally, in another possible implementation of the first aspect, after matching each template to be matched with the material to be edited according to at least one preset matching index to determine the target matching score corresponding to each template to be matched, the method further includes:
[0065] Get the M historical templates that have been used by users and the most recent usage time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0066] Based on the most recent usage time of each historical template, the suppression score corresponding to each historical template is determined.
[0067] Based on the suppression scores corresponding to each historical template, the target matching scores corresponding to each historical template are adjusted.
[0068] In this way, by suppressing the scores of the templates recently used by the user, it is easier to recommend templates that the user has not used, thereby increasing the richness and freshness of the templates recommended to the user, which in turn further enhances the richness and freshness of the finished video editing effect and further improves the user experience.
[0069] Optionally, in another possible implementation of the first aspect, the above-mentioned selection of at least one template to be matched as the target template corresponding to the material to be edited, based on the target matching score corresponding to each template to be matched, includes:
[0070] Based on the target matching score corresponding to each template to be matched, select the K templates with the highest target matching scores as target templates, where K is a positive integer.
[0071] In this way, by recommending one or more templates with the highest target matching scores to users for selection, not only is the reliability of template matching improved, but the interactivity of template recommendations is also enhanced, thus meeting users' personalized needs.
[0072] Optionally, in another possible implementation of the first aspect, the target matching scores corresponding to the above K target templates are all different.
[0073] In this way, by using the equal-splitting deduplication mechanism, the styles and effects of the templates ultimately recommended to users will have certain differences, thereby expanding the range of choices for users. This not only further improves the reliability of template matching, but also further meets the personalized needs of users.
[0074] Secondly, embodiments of this application provide a template matching device for editing materials, comprising: a first acquisition module, configured to acquire at least one material to be edited selected by a user, wherein the material to be edited includes at least one of video and image; a second acquisition module, configured to perform theme identification on the material to be edited according to various template themes contained in a template library, so as to acquire multiple templates to be matched from the template library; a first determination module, configured to match each template to be matched with the material to be edited according to at least one preset matching index, so as to determine the target matching score corresponding to each template to be matched; and a first selection module, configured to select at least one template to be matched as the target template corresponding to the material to be edited according to the target matching score corresponding to each template to be matched.
[0075] In one possible implementation of the second aspect, the second acquisition module includes:
[0076] The first determining unit is used to identify the theme of the material to be edited based on each template theme, so as to determine the degree of matching between the material to be edited and each template theme;
[0077] The second determination unit is used to determine the template theme to be matched for the material to be edited based on the degree of matching between the material to be edited and each template theme.
[0078] The third determining unit is used to determine each template in the template library whose template theme is the template theme to be matched as the template to be matched.
[0079] Optionally, in another possible implementation of the second aspect, the number of the aforementioned preset matching indicators is N, where N is a positive integer; correspondingly, the aforementioned first determining module includes:
[0080] The fourth determining unit is used to match the first template to be matched with the material to be edited according to the i-th preset matching index, so as to determine the i-th matching score corresponding to the first template to be matched, wherein the first template to be matched is any template to be matched, 1≤i≤N;
[0081] The fifth determining unit is used to determine the target matching score corresponding to the first matching template based on the N matching scores corresponding to the first matching template.
[0082] Optionally, in another possible implementation of the second aspect, the aforementioned preset matching indicators include at least one of the following indicators: frame matching indicator, material type indicator, slot matching indicator, download type indicator, and operation indicator.
[0083] Optionally, in another possible implementation of the second aspect, the i-th preset matching index is a topic matching index, and the i-th matching score is a topic matching score; correspondingly, the fourth determining unit is specifically used for:
[0084] The theme of the footage to be edited is identified based on each template theme in order to determine the degree of matching between the footage to be edited and the template theme corresponding to the first template to be matched;
[0085] The theme matching score of the first template to be matched is determined based on the degree of matching between the material to be edited and the theme of the first template to be matched.
[0086] Optionally, in another possible implementation of the second aspect, the i-th preset matching index is a frame matching index, and the i-th matching score is a frame matching score; correspondingly, the fourth determining unit is also used for:
[0087] The first template to be matched is used to perform initial editing of the footage to be edited, in order to determine the initial finished film corresponding to the footage to be edited;
[0088] Obtain the initial segments included in the initial final cut and the segment duration corresponding to each initial segment;
[0089] Determine the aspect ratio corresponding to the effective display area in each initial segment;
[0090] Based on the aspect ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment, determine the aspect ratio matching score corresponding to the first template to be matched.
[0091] Optionally, in another possible implementation of the second aspect, the i-th preset matching index is a material ratio index, and the i-th matching score is a material ratio matching score; correspondingly, the fourth determining unit is also used for:
[0092] Obtain the number of videos and images contained in the material to be edited, and the material type corresponding to the first template to be matched;
[0093] Determine the material ratio corresponding to the material to be edited based on the number of videos and images contained in the material to be edited;
[0094] Based on the material ratio of the material to be edited and the material type of the first template to be matched, determine the material ratio matching score of the first template to be matched.
[0095] Optionally, in another possible implementation of the second aspect, the i-th preset matching index is a slot matching index, and the i-th matching score is a slot matching score; correspondingly, the fourth determining unit is also used for:
[0096] Get the number of clips contained in the clip to be edited;
[0097] Get the number of slots in the first template to be matched, the duration of each slot, and the total duration of the template;
[0098] The first template to be matched is used to perform initial editing of the footage to be edited, so as to generate the initial finished film corresponding to the footage to be edited;
[0099] Obtain the total runtime of the initial final cut and the runtime of each initial segment included in the initial final cut;
[0100] Based on the number of materials and the number of slots, determine the matching degree of the number of slots corresponding to the first template to be matched;
[0101] Based on the total duration of the finished product and the total duration of the template, determine the total duration matching degree of the first template to be matched;
[0102] Based on the duration of each slot and the duration of each segment, determine the slot duration matching degree corresponding to the first template to be matched;
[0103] Based on the matching degree of the number of slots, the matching degree of the total duration, and the matching degree of the slot duration, the slot matching score corresponding to the first template to be matched is determined.
[0104] Optionally, in another possible implementation of the second aspect, the fourth determining unit is further configured to:
[0105] Get the checkpoint type corresponding to the first template to be matched;
[0106] The slot matching score is determined based on the matching degree of the number of slots, the matching degree of the total duration, the matching degree of the slot duration, and the type of checkpoint.
[0107] Optionally, in another possible implementation of the second aspect, the i-th preset matching indicator is a download type indicator, and the i-th matching score is a download score; correspondingly, the fourth determining unit is also used for:
[0108] Obtain the download type corresponding to the first template to be matched, where the download type includes local templates and online templates;
[0109] Based on the download type, determine the download score corresponding to the first template to be matched.
[0110] Optionally, in another possible implementation of the second aspect, the fourth determining unit is further configured to:
[0111] If the download type corresponding to the first template to be matched is an online template, the download score will be set to 0.
[0112] If the download type corresponding to the first template to be matched is a local template, a score is randomly selected from the first score range and determined as the download score, wherein the minimum value of the first score range is greater than or equal to 0.
[0113] Optionally, in another possible implementation of the second aspect, the fourth determining unit described above is further configured to:
[0114] The number of templates in the template library that are local templates and whose download type is determined to be greater than the number threshold.
[0115] Optionally, in another possible implementation of the second aspect, the i-th preset matching indicator is an operational indicator, and the i-th matching score is an operational matching score; correspondingly, the fourth determining unit is also used for:
[0116] Get the operation type corresponding to the first template to be matched;
[0117] Based on the operation type, determine the operation matching score corresponding to the first template to be matched.
[0118] Optionally, in another possible implementation of the second aspect, the fourth determining unit is further configured to:
[0119] When the operation type is a preset operation type, a score is randomly selected from the second score range to determine the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0120] If the operation type is not the preset operation type, the operation matching score will be set to 0.
[0121] Optionally, in another possible implementation of the second aspect, the above-mentioned apparatus further includes:
[0122] The third acquisition module is used to acquire the M historical templates that have been used by users and the most recent usage time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0123] The second determination module is used to determine the suppression score corresponding to each historical template based on the most recent usage time of each historical template.
[0124] The first correction module is used to correct the target matching score corresponding to each historical template based on the suppression score corresponding to each historical template.
[0125] Optionally, in another possible implementation of the second aspect, the aforementioned first selection module includes:
[0126] The first selection unit is used to select K templates with the highest target matching scores as target templates based on the target matching scores corresponding to each template to be matched, where K is a positive integer.
[0127] Optionally, in another possible implementation of the second aspect, the target matching scores corresponding to the above K target templates are all different.
[0128] Thirdly, embodiments of this application provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the template matching method for material editing as described above.
[0129] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by an electronic device, implements the template matching method for material editing as described above.
[0130] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the template matching method for material editing as described above.
[0131] The technical effects achieved by the second, third, fourth and fifth aspects mentioned above are similar to the technical effects achieved by the corresponding technical means in the first and second aspects mentioned above, and will not be repeated here. Attached Figure Description
[0132] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0133] Figure 1 This is a flowchart illustrating a template matching method for material editing provided in an embodiment of this application;
[0134] Figure 2 This is a flowchart illustrating a template matching method for material editing provided in another embodiment of this application;
[0135] Figure 3 This is a flowchart illustrating a template matching method for material editing provided in another embodiment of this application;
[0136] Figure 4 This is a schematic diagram of the structure of a template matching device for material editing provided in an embodiment of this application;
[0137] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0138] The template matching method, apparatus, electronic device, storage medium, and computer program for editing the materials provided in this application will be described in detail below with reference to the accompanying drawings.
[0139] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a template matching method for material editing provided in an embodiment of this application. The method may include some or all of the following:
[0140] Step 101: Obtain at least one material to be edited selected by the user, wherein the material to be edited includes at least one of video and image.
[0141] It should be noted that the template matching method for material editing in this application embodiment can be applied to any material editing scenario. For example, it can be applied to any editing application to realize the automatic template recommendation function when users edit materials. The editing software mentioned in this application embodiment can refer to the editing function built into a gallery application on an electronic device, or an editing application associated with the gallery application on the electronic device; alternatively, it can be a third-party editing application installed on the electronic device. This application embodiment does not limit this.
[0142] The material to be edited can refer to any material selected, entered, or uploaded by the user.
[0143] It should be noted that the material to be edited can include at least one of video and images. That is, when editing material, the user can select one or more videos, one or more images, or a combination of at least one video and at least one image for mixed editing. In actual use, the user can select the material to be edited according to actual needs; this application embodiment does not limit the type of material to be edited.
[0144] In this embodiment of the application, after the user selects or uploads the material to be edited and the editing function of the editing application is triggered, the material selected by the user can be determined as the material to be edited.
[0145] As an example, when the template matching method for material editing in this application embodiment is applied to the editing function of a gallery application, it can be determined that the material to be edited selected by the user has been obtained after the user selects at least one material from the gallery and triggers the editing or clipping control corresponding to the selected material.
[0146] As an example, when the template matching method for material editing in this application embodiment is applied to a third-party editing application in an electronic device, it can determine that the material to be edited selected by the user is obtained when the user opens the editing application and selects one or more materials from the gallery and uploads them to the third-party editing application.
[0147] It should be noted that the examples above are merely illustrative and should not be considered as limitations on this application. In actual use, the method of obtaining the material to be edited can be determined according to actual needs and specific application scenarios, and this application embodiment does not limit this.
[0148] Step 102: Identify the theme of the material to be edited based on the various template themes contained in the template library, so as to obtain multiple templates to be matched from the template library.
[0149] In this context, "template theme" refers to the various theme categories included in the template library after classifying the templates according to their corresponding themes. For example, if the templates in the library are divided into themes such as children's fun, people, food, travel, ancient architecture, night scene, nature, leisure, dynamic rhythm, light and cheerful, and slightly melancholic, then the template library contains template themes such as children's fun, people, food, travel, ancient architecture, night scene, nature, leisure, dynamic rhythm, light and cheerful, and slightly melancholic.
[0150] Among them, the template to be matched can refer to the template in the template library whose theme matches the theme of the material to be edited.
[0151] In this embodiment, to save computational resources and improve the efficiency of template matching, the theme of the material to be edited can be identified first. This allows for the initial screening of templates from the template library that match the theme of the material to be edited. Subsequent matching processing is then performed only on the selected theme-matching templates. This theme matching eliminates a large number of irrelevant templates from the template library, saving computational resources. Specifically, each template theme in the template library can be used as a priori theme label. A theme recognition algorithm is then used to identify the theme of each material to be edited to determine the template theme that matches the material. The templates corresponding to the template themes in the template library that match the material to be edited are then identified as the templates to be matched.
[0152] It should be noted that when there are multiple template themes that match the footage to be edited, all templates corresponding to these multiple themes can be selected as templates to be matched. For example, if the template themes that match the footage to be edited are "childlike" and "characters," then all templates in the template library with the theme "childlike" and the theme "characters" can be selected as templates to be matched.
[0153] Furthermore, based on the matching degree between the material to be edited and each template theme, the template to be matched corresponding to the material to be edited can be determined, thereby reducing the computational load of subsequent template matching, improving the efficiency of template matching, and improving the accuracy of theme matching. That is, in one possible implementation of this application embodiment, step 102 above may include:
[0154] The theme of the footage to be edited is identified based on each template theme to determine the degree of matching between the footage to be edited and each template theme;
[0155] Based on the matching degree between the footage to be edited and each template theme, determine the template theme to be matched with the footage to be edited;
[0156] Each template in the template library whose theme is the same as the theme to be matched is identified as the template to be matched.
[0157] The matching degree between the material to be edited and the template theme can refer to the confidence degree between the material to be edited and the template theme output by the theme recognition model.
[0158] In this embodiment, a topic recognition model can be used to identify the topic of the material to be edited in order to determine the matching degree between the material to be edited and each template topic. Then, based on the matching degree between the material to be edited and each template topic, one or more template topics with high matching degree are determined as the template topics to be matched corresponding to the material to be edited.
[0159] As one possible implementation, if the user selects only one clip to be edited, the theme of the clip can be identified, and the matching degree between the clip and each template theme can be determined. The one or more template themes with the highest matching degree can be identified as the template themes to be matched; or, the one or more template themes with a matching degree greater than or equal to the matching degree threshold can be identified as the template themes to be matched.
[0160] For example, suppose the template library contains three template themes: Childhood Fun, People, and Food. The matching degree between the material to be edited and "Childhood Fun" is 0.95, the matching degree between "People" is 0.85, and the matching degree between "Food" is 0.3. Therefore, the template theme with the highest matching degree (i.e., "Childhood Fun") or the two template themes (i.e., "Childhood Fun" and "People") can be identified as the template themes to be matched. For another example, when selecting the template themes to be matched based on the matching degree threshold, suppose the matching degree threshold is 0.8, then "Childhood Fun" and "People" can be identified as the template themes to be matched.
[0161] As one possible implementation, if the user selects multiple clips to be edited, themes can be identified for each clip in turn to determine the matching degree between each clip and each template theme. Then, for a clip, the template theme with the highest matching degree can be identified as its corresponding template theme. After identifying the template themes for each clip, all template themes for each clip can be identified as template themes to be matched. Alternatively, the matching degrees between each clip and its corresponding template theme can be sorted, and one or more template themes with the highest matching degree can be identified as template themes to be matched. Or, template themes with a matching degree greater than or equal to a matching degree threshold can be identified as template themes to be matched.
[0162] For example, suppose the footage to be edited includes three clips: clip A, clip B, and clip C. Clip A corresponds to the template theme "Childhood Fun" with a match score of 0.95; clip B corresponds to the template theme "People" with a match score of 0.85; and clip C corresponds to the template theme "Food" with a match score of 0.9. Then, "Childhood Fun," "People," and "Food" can all be identified as template themes to be matched. Alternatively, the two template themes with the highest match scores (i.e., "Childhood Fun" and "Food") can be identified as template themes to be matched. Or, the template themes to be matched can be determined based on a match score threshold; for example, if the match score threshold is 0.8, then "Childhood Fun," "People," and "Food" can all be identified as template themes to be matched.
[0163] As one possible implementation, if the user selects multiple clips to be edited, a topic recognition algorithm can be used to perform comprehensive topic recognition on the multiple clips to directly output the template topics that are commonly matched by each clip, and output the matching degree corresponding to each commonly matched template topic. Then, each commonly matched template topic can be directly determined as the template topic to be matched; or one or more template topics with the highest matching degree among the commonly matched template topics can be determined as the template topics to be matched; or one or more template topics with a matching degree greater than or equal to the matching degree threshold among the commonly matched template topics can be determined as the template topics to be matched.
[0164] For example, suppose the footage to be edited includes three clips: clip A, clip B, and clip C. Performing comprehensive theme identification on these three clips, and determining that the matching degrees between these three clips and the template themes "Childhood Fun," "People," and "Food" are 0.95, 0.85, and 0.3 respectively, then the template theme with the highest matching degree (i.e., "Childhood Fun") or the two template themes with the highest matching degree (i.e., "Childhood Fun" and "People") can be identified as the template themes to be matched. Similarly, when selecting template themes to be matched based on a matching degree threshold, assuming the matching degree threshold is 0.8, then "Childhood Fun" and "People" can be identified as the template themes to be matched.
[0165] It should be noted that if the material to be edited is an image, the image can be input into the theme recognition model for theme recognition; if the material to be edited is a video, the video can first be processed by frame extraction, and one or more extracted video frames can be input into the theme recognition model for theme recognition; when performing comprehensive theme recognition on multiple materials to be edited, the frame extraction results of each image and video included in the material to be edited can also be input into the theme video model for comprehensive theme recognition. The frame extraction method in this embodiment can be determined according to actual needs and specific scenarios, and this embodiment does not limit it. For example, frames can be extracted uniformly according to a certain step size.
[0166] It should be noted that the topic recognition model used in this application embodiment can be any topic recognition model. In actual use, a suitable topic recognition model can be selected for topic recognition according to actual needs and specific application scenarios, and this application embodiment does not limit this. Furthermore, the method by which this application embodiment determines the template theme to be matched and the template to be matched based on the matching degree between the material to be edited and each template theme can include, but is not limited to, the situations listed above; and the matching degree threshold mentioned above can also be set according to actual needs, and this application embodiment does not limit this.
[0167] Step 103: Based on at least one preset matching index, match each template to be matched with the material to be edited to determine the target matching score corresponding to each template to be matched.
[0168] In this embodiment, after selecting a template that matches the theme of the material to be edited, each template can be matched with the material to be edited based on one or more preset matching indicators to determine the matching score of each template under the preset indicators. Then, based on the matching scores of each template under each preset matching indicator, a target matching score is determined for each template. This improves the reliability of template matching and ensures the final editing effect by evaluating the degree of matching between the template and the material from multiple evaluation dimensions and quantifying the degree of matching through matching scores.
[0169] Furthermore, the score suppression of recently used historical templates can be applied, making it easier to recommend unused templates to the user, thereby increasing the richness and freshness of the recommended templates, and further enhancing the richness and freshness of the final edited video, as well as the user experience. That is, in one possible implementation of this application embodiment, after step 103 above, it may further include:
[0170] Get the M historical templates that have been used by users and the most recent usage time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0171] Based on the most recent usage time of each historical template, the suppression score corresponding to each historical template is determined.
[0172] Based on the suppression scores corresponding to each historical template, the target matching scores corresponding to each historical template are adjusted.
[0173] The historical templates can be templates recently used by the user, determined based on their recent editing history. The number M of historical templates can be determined according to actual needs, and this embodiment does not limit this. For example, 25, 30, etc.
[0174] The most recent use time of a historical template can refer to the last time a user used a historical template.
[0175] As one possible implementation, the number of historical templates M can be determined based on the number of templates to be matched. For example, the ratio of the number of historical templates M to the number of templates to be matched is less than or equal to a preset ratio threshold. In actual use, the preset ratio threshold can be determined according to actual needs and specific application scenarios, and this application embodiment does not limit it. For example, the preset ratio threshold can be 20%.
[0176] In the application embodiment, based on the recent editing records of the user currently performing the editing operation, the M templates most recently used by the user and whose usage time is closest to the current time can be determined as historical templates. Then, based on the most recent usage time of each historical template, the suppression score corresponding to each historical template can be determined, and the target matching score corresponding to each historical model can be suppressed according to the suppression score. This results in the target matching score of the historical templates most recently used by the user being lower, making them less likely to be recommended to the user, thereby improving the richness and freshness of the recommended templates.
[0177] As one possible implementation, the suppression score corresponding to each historical template can increase linearly from the most recent time to the most recent time, that is, the more recent the time of use of the historical template is, the higher the suppression score of the historical template.
[0178] As one possible implementation, strong suppression can be applied to the H most recently used historical templates, assigning them high suppression scores. These suppression scores for the H templates should increase from the most recent usage time to the most recent. The suppression scores for the other MH historical templates should be determined based on a linear increase from the most recent usage time to the most recent. Here, H is a positive integer less than M; for example, if M is 25, H can be 5.
[0179] For example, assuming M is 25 and H is 5, the five most recently used historical templates are strongly suppressed. Based on the most recent usage time, from most recent to oldest, the suppression scores for these five historical templates can be 100, 80, 60, 50, and 40 points respectively. The suppression scores for the other 20 historical templates can be determined according to the principle that the suppression scores increase linearly from oldest to oldest usage time. For example, the initial score is 30 points. For every day the time interval between the most recent usage time and the current time increases, the suppression score can decrease by one score step size, such as 1, 2, or 3 points.
[0180] It should be noted that the above examples are merely illustrative and should not be considered as limitations on this application. In actual use, the values of M and H, the specific method for determining the suppression score, the score step size, etc., can be determined according to actual needs and specific application scenarios. This application embodiment does not limit these aspects.
[0181] In this embodiment of the application, after determining the suppression score corresponding to each historical template, for a historical template, the target matching score corresponding to the historical template can be subtracted from its corresponding suppression score to obtain the final target matching score of the historical template; in the same way, the final target matching scores of all historical templates can be determined.
[0182] As a possible implementation, to further conserve computing resources and improve the freshness of recommended templates, when selecting templates to be matched, M historical templates can be directly removed, meaning that the templates to be matched determined based on topic matching do not include these M historical templates. If a suitable template can be selected from the templates to be matched for recommendation, there is no need to calculate the target matching scores of these M historical models. If a suitable template cannot be selected from the templates to be matched for recommendation, the target matching scores of these M historical templates can be obtained again and determined according to the steps described above. Then, the target matching scores of the historical templates can be corrected according to the score suppression rule as described above. Finally, each historical template can be added as a template to be matched, so that in subsequent recommendations, the historical templates and each template to be matched can be combined for template recommendation.
[0183] Step 104: Based on the target matching score corresponding to each template to be matched, select at least one template to be matched as the target template corresponding to the material to be edited.
[0184] In this embodiment of the application, after determining the target matching score corresponding to each template to be matched, one or more templates with higher target matching scores can be identified as the target templates corresponding to the material to be edited.
[0185] One possible implementation is to select K templates with the highest target matching scores as target templates, where K is a positive integer, based on the target matching score corresponding to each template to be matched. By recommending one or more templates with the highest target matching scores to the user, the reliability of template matching is improved, as well as the interactivity of template recommendations, thus meeting the user's personalized needs.
[0186] As one possible implementation, a target template can be selected from the templates to be matched by setting a preset score threshold. For example, templates with a match score greater than the preset score threshold can be selected as target templates.
[0187] It should be noted that in actual use, the specific value of the preset score threshold can be determined according to actual needs and specific application scenarios, and this application embodiment does not limit this.
[0188] Furthermore, a deduplication mechanism can be used to ensure that the styles and effects of the templates ultimately recommended to users differ, thereby expanding the user's selection range. This not only further improves the reliability of template matching but also better meets the user's personalized needs. Specifically, in one possible implementation of this application, the target matching scores corresponding to the aforementioned K target templates are all different.
[0189] As one possible implementation, when selecting a target template from the templates to be matched, if there are multiple templates to be matched with the same target matching score that all meet the score requirements, one of these multiple templates to be matched with the same target matching score can be randomly selected as the target template, and other target templates can be selected from the templates to be matched with other target matching scores.
[0190] For example, assuming K is 5, and the number of templates to be matched corresponding to the 5 highest target matching scores are 3, 2, 2, 3, and 1 respectively, then we can randomly select 1 template from the 5 highest target matching scores as the target template, randomly select 1 template from the 2 second highest target matching scores as the target template, randomly select 1 template from the 2 third highest target matching scores as the target template, randomly select 1 template from the 3 fourth highest target matching scores as the target template, and determine the 1 template from the 5th highest target matching score as the target template, thus determining a total of 5 target templates.
[0191] As one possible implementation, when selecting a target template by means of a preset score threshold, for templates to be matched that have the same target matching score and are greater than the preset score threshold, the above-mentioned equal division deduplication mechanism can also be used to randomly select one of the templates to be matched with the same target matching score as the target template. This will not be elaborated here.
[0192] The template matching method for editing materials provided in this application first selects a template that matches the theme of the material to be edited by theme identification. Then, based on at least one preset matching index, the matching degree between the template and the material to be edited is evaluated from multiple evaluation dimensions. Based on the matching degree between the template and the material to be edited, a suitable target template is selected and recommended to the user, thereby improving the matching degree between the recommended template and the material selected by the user, improving the final product effect, and improving the user experience.
[0193] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating a template matching method for material editing provided in another embodiment of this application. The method may include some or all of the following:
[0194] Step 201: Obtain at least one material to be edited selected by the user, wherein the material to be edited includes at least one of video and image.
[0195] Step 202: Identify the theme of the material to be edited based on the various template themes contained in the template library, so as to obtain multiple templates to be matched from the template library.
[0196] The specific implementation process and principle of steps 201-202 above can be found in the detailed description of the above embodiments, and will not be repeated here.
[0197] Step 203: According to the i-th preset matching index, match the first template to be matched with the material to be edited to determine the i-th matching score corresponding to the first template to be matched, where the first template to be matched is any template to be matched, 1≤i≤N.
[0198] In this embodiment, when measuring the matching degree between a template to be matched and the material to be edited using N preset matching indicators, for any template to be matched (i.e., the first template to be matched), the first template to be matched and the material to be edited can be matched sequentially according to these N preset matching indicators to determine the matching score between the first template to be matched and the material to be edited under these N preset matching indicators, i.e., the N matching scores corresponding to the first template to be matched. These N matching scores can quantify the matching degree between the first template to be matched and the material to be edited in these N evaluation dimensions. Following the same method, each template to be matched can be used as the first template to be matched in sequence to determine the N matching scores corresponding to each template to be matched. Where N is a positive integer.
[0199] Furthermore, by using metrics such as theme matching, aspect ratio matching, material type matching, slot matching, download type matching, and operational metrics, the templates to be matched and the materials to be edited can be matched in terms of theme, aspect ratio, material type, slot, download type, and operational type. Templates for specific download types and operational types can be promoted to ensure that the recommended templates and the materials selected by the user have a high degree of matching in terms of theme, aspect ratio, material type, slot, download type, and operational type. This further improves the reliability of template matching, enhances the aesthetics of the final product, and ultimately improves the user experience. As one possible implementation, the aforementioned preset matching metrics can include at least one of the following metrics: theme matching, aspect ratio matching, material type matching, slot matching, download type, and operational metrics.
[0200] The theme matching metric can be used to measure the degree of theme matching between the template to be matched and the footage to be edited.
[0201] As one possible implementation, the preset matching indicators include a theme matching indicator, and when matching the first template to be matched with the material to be edited according to the theme matching indicator, a theme matching score corresponding to the first template to be matched can be generated. That is, in one possible implementation of this application embodiment, the i-th preset matching indicator is a theme matching indicator, and the i-th matching score is a theme matching score; correspondingly, step 203 may include:
[0202] The theme of the footage to be edited is identified based on each template theme in order to determine the degree of matching between the footage to be edited and the template theme corresponding to the first template to be matched;
[0203] The theme matching score of the first template to be matched is determined based on the degree of matching between the material to be edited and the theme of the first template to be matched.
[0204] As one possible implementation, as described in the foregoing embodiments, when matching the footage to be edited with template themes in the template library through theme recognition, not only can the template themes matching the footage to be edited be output, but also the matching degree corresponding to the template themes matching the footage to be edited can be output. Since the theme corresponding to the template to be matched must be the theme matching the footage to be edited, the matching degree between the footage to be edited and the template theme corresponding to the first template to be matched can be determined based on the theme recognition result of the footage to be edited. Furthermore, since the matching degree between the footage to be edited and the template theme corresponding to the first template to be matched can directly reflect the degree of theme matching between the footage to be edited and the first template to be matched, the theme matching score corresponding to the first template to be matched can be determined based on the degree of theme matching between the footage to be edited and the template theme corresponding to the first template to be matched, so as to quantify the degree of theme matching between the first template to be matched and the footage to be edited.
[0205] As an example, one or more theme matching thresholds can be preset, and the theme matching score corresponding to the first template to be matched can be determined based on the relationship between the matching degree between the material to be edited and the template theme corresponding to the first template to be matched and the theme matching thresholds. For example, a first theme matching threshold and a second theme matching threshold can be preset, and the first theme matching threshold is greater than the second theme matching threshold. Then, when the matching degree between the material to be edited and the template theme corresponding to the first template to be matched is greater than or equal to the first theme matching threshold, it can be determined that the material to be edited and the template theme corresponding to the first template to be matched are completely matched, and the theme matching score corresponding to the first template to be matched can be determined as the first theme score (e.g., 30 points). When the matching degree between the material to be edited and the template theme corresponding to the first template to be matched is less than the first theme matching threshold but greater than or equal to the second theme matching threshold, it can be determined that the material to be edited and the template theme corresponding to the first template to be matched are weakly matched, and the theme matching score corresponding to the first template to be matched can be determined as the second theme score (e.g., 0 points, 10 points, etc.). When the matching degree between the material to be edited and the template theme corresponding to the first template to be matched is less than the second theme matching threshold, it can be determined that the material to be edited and the template theme corresponding to the first template to be matched are not matched, and the theme matching score corresponding to the first template to be matched can be determined as the third theme score (e.g., -99 points).
[0206] For example, suppose the matching degree between the footage to be edited and the template theme "Childhood Fun" is 0.95, and the matching degree between the footage to be edited and the template theme "Characters" is 0.85. The first theme matching degree threshold is 0.9, the second theme matching degree threshold is 0.8, the first theme score is 30 points, and the second theme score is 0 points. If the template theme corresponding to the first template to be matched is "Childhood Fun," since the matching degree between the footage to be edited and the template theme "Childhood Fun" is greater than the first theme matching degree threshold of 0.9, then the theme matching score corresponding to the first template to be matched can be determined to be 30 points. If the template theme corresponding to the first template to be matched is "Characters," since the matching degree between the footage to be edited and the template theme "Characters" is less than the first theme matching degree threshold but greater than the second theme matching degree threshold, then the theme matching score corresponding to the first template to be matched can be determined to be 0 points.
[0207] It should be noted that when determining the templates to be matched in step 202, templates whose themes do not match the material to be edited have usually been excluded. Therefore, the list of templates to be matched may not include templates whose themes do not match the material to be edited; that is, templates whose themes do not match the material to be edited are not included in the matching score calculation in step 203. Therefore, when determining the theme matching score corresponding to the first template to be matched using the above method, the theme matching score corresponding to the first template to be matched may only include the first theme score and the second theme score, but not the third theme score, because templates with a third theme score have already been removed before step 203.
[0208] It should be noted that the above examples are merely illustrative and should not be considered as limitations on this application. In actual use, the number of topic matching thresholds, the specific values of each topic matching threshold, and the specific values of each topic score can be determined according to actual needs and specific application scenarios. This application embodiment does not limit these parameters.
[0209] Based on the above analysis, this application embodiment determines the theme matching score of the template to be matched according to the matching degree between the template theme corresponding to the template to be matched and the material to be edited, so as to quantify the degree of theme matching between the template to be matched and the material to be edited, so that the theme of the finally recommended template is more closely related to the material selected by the user, thereby making the style of the finished product match the material content, and further improving the user experience.
[0210] As one possible implementation, the preset matching indicators include a frame matching indicator, and when matching the first template to be matched with the material to be edited according to the frame matching indicator, a frame matching score corresponding to the first template to be matched can be generated. That is, in one possible implementation of this application embodiment, the i-th preset matching indicator is a frame matching indicator, and the i-th matching score is a frame matching score; correspondingly, step 203 may include:
[0211] The first template to be matched is used to perform initial editing of the footage to be edited, in order to determine the initial finished film corresponding to the footage to be edited;
[0212] Obtain the initial segments included in the initial final cut and the segment duration corresponding to each initial segment;
[0213] Determine the aspect ratio corresponding to the effective display area in each initial segment;
[0214] Based on the aspect ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment, determine the aspect ratio matching score corresponding to the first template to be matched.
[0215] Among them, the aspect ratio matching index can be used to measure the degree of matching between the aspect ratio of the template to be matched and the material to be edited.
[0216] The aspect ratio matching score quantifies the degree of aspect ratio matching between the template to be matched and the footage to be edited. In other words, the higher the aspect ratio matching score of the first template to be matched, the higher the degree of aspect ratio matching between the first template to be matched and the footage to be edited.
[0217] The initial finished product can refer to the finished product generated by initially editing the footage to be edited using the first template to be matched.
[0218] The effective display area refers to the display area corresponding to the content of the material in the initial segment. It should be noted that the display area in the initial segment other than the effective display area is the ineffective display area; the ineffective display area can refer to the Gaussian blurred area or black border area generated after applying a Gaussian blur effect or black border effect to areas where the material content cannot be displayed.
[0219] The aspect ratio corresponding to the effective display area can refer to the area proportion of the effective display area within its initial segment. For example, if the area of the entire display area corresponding to the initial segment A is n, and the aspect ratio corresponding to the initial segment A is m, then the aspect ratio corresponding to the effective display area in the initial segment A can be determined as m / n.
[0220] In this embodiment, since the aspect ratio of the template to be matched may not be the same as that of the material to be edited selected by the user, the unfilled areas of the material content will be filled with Gaussian blur or black border effects during editing. Furthermore, when the user selects multiple materials to be edited, the aspect ratios of each material may also be different. Therefore, after editing each material using the template and generating a finished film, the aspect ratios of the effective display areas of the material content in each segment of the finished film may also be different. Therefore, when determining the aspect ratio matching score of the first template to be matched, the material to be edited can be initially edited using the first template to be matched to generate an initial finished film. Then, the aspect ratio matching score of the first template to be matched can be determined based on the aspect ratio of the effective display areas of each initial segment in the initial finished film and the segment duration of each initial segment.
[0221] As one possible implementation, after determining the segment duration of each initial segment in the initial final cut, and the aspect ratio corresponding to the effective display area in each initial segment, the product of the segment duration of each initial segment and its corresponding aspect ratio can be determined. Then, the products are added together to obtain the sum of the products. Next, the sum of the segment durations of each initial segment (i.e., the total duration of the initial final cut) is determined. Then, the ratio of the sum of the above products to the sum of the segment durations of the initial segments is determined. Finally, the aspect ratio matching score corresponding to the first template to be matched is determined based on the above ratio.
[0222] As one possible approach, since users typically pay more attention to the first clip in the final cut, the editing quality of the first segment has a significant impact on user satisfaction. Therefore, when determining the aspect ratio matching score for the first template to be matched, a larger weight can be assigned to the first initial segment. This allows the final recommended template to be more biased towards selecting the template with the better editing quality of the first segment, further improving the overall editing effect of the final cut and enhancing the user experience. For example, when calculating the aspect ratio matching score for the first template to be matched, the duration of the first initial segment can be determined as the product of the actual duration of the first initial segment and a preset weight w, where the preset weight w is greater than 1. For instance, the preset weight could be 1.5, meaning the duration of the first initial segment used in calculating the aspect ratio matching score is 1.5 times the actual duration of the first initial segment.
[0223] It should be noted that the above examples are merely illustrative and should not be considered as limitations on this application. In actual use, the specific values of the preset weights can be determined according to actual needs and specific application scenarios, and this application embodiment does not limit this.
[0224] As one possible approach, in certain editing scenarios, when initially editing the footage using the first matching template to generate an initial final cut, the display effect of initial segments whose effective display area corresponds to a frame ratio exceeding a preset frame ratio threshold (i.e., a larger frame ratio corresponding to the effective display area) may be optimized. This optimization involves enlarging the image so that the effective display area fills the entire screen. In this case, for these initial segments whose effective display area corresponds to a frame ratio exceeding the preset frame ratio threshold, the effective display area obtained from the initial final cut is the enlarged effective display area. This results in an increased frame ratio corresponding to the effective display area in the calculated initial segment, which is inconsistent with the actual ratio and affects the accuracy of the frame matching between the matching template and the footage. Therefore, in this situation, for initial segments whose effective display area corresponds to a frame ratio exceeding the preset frame ratio threshold, the frame ratio corresponding to the effective display area determined before generating the final cut can be used in the subsequent frame matching score calculation to improve the accuracy of frame matching.
[0225] As an example, after determining the ratio of the sum of the above products to the sum of the durations of the segments corresponding to the initial segment, the above ratio can be directly determined as the frame matching score corresponding to the first template to be matched.
[0226] As an example, after determining the ratio of the sum of the above products to the sum of the segment durations corresponding to the initial segment, one or more aspect ratio matching thresholds can be preset. Based on the relationship between the above ratios and the various aspect ratio matching thresholds, the aspect ratio matching score corresponding to the first template to be matched can be determined. For example, a first aspect ratio matching threshold and a second aspect ratio matching threshold can be preset, and the first aspect ratio matching threshold is greater than the second aspect ratio matching threshold. Then, when the above ratio is greater than or equal to the first aspect ratio matching threshold, the aspect ratio matching score corresponding to the first template to be matched can be determined as the first aspect ratio score (e.g., 80 points); when the above ratio is less than the first aspect ratio matching threshold but greater than or equal to the second aspect ratio matching threshold, the aspect ratio matching score corresponding to the first template to be matched can be determined as the second aspect ratio score (e.g., 40 points); when the above ratio is less than the second aspect ratio matching threshold, the aspect ratio matching score corresponding to the first template to be matched can be determined as the third theme score (e.g., 0 points).
[0227] As an example, after determining the ratio of the sum of the above products to the sum of the segment durations corresponding to the initial segment, an initial aspect ratio matching score can be preset when the aspect ratio of the footage to be edited perfectly matches that of the template to be matched. For example, when the ratio is 100%, it can be considered that the aspect ratio of the footage to be edited perfectly matches that of the first template to be matched, and the initial aspect ratio matching score corresponding to the ratio of 100% can be set to 80 points. Then, following the principle that the aspect ratio matching score decreases linearly as the ratio decreases, the aspect ratio matching score corresponding to the first template to be matched can be determined based on the ratio. For example, the principle could be that for every one-step decrease in the ratio relative to the ratio corresponding to a perfect match, the aspect ratio matching score of the first template to be matched decreases by one-score step relative to the initial matching score.
[0228] For example, assuming that when the ratio is 100%, the aspect ratio of the footage to be edited is considered to be perfectly matched with the first template to be matched, and the initial aspect ratio matching score corresponding to the ratio of 100% is 80 points, then the ratio step size can be set to 1%, and the score step size can be set to 1 point. That is, when the ratio corresponding to the first template to be matched is 100%, the aspect ratio matching score of the first template to be matched can be determined to be 80 points, and for every 1% decrease in the ratio corresponding to the first template to be matched, the aspect ratio matching score of the first template to be matched decreases by 1 point. For example, if the ratio corresponding to the first template to be matched is 90%, then the aspect ratio matching score of the first template to be matched is 70 points.
[0229] It should be noted that the various methods for determining the frame matching score listed above are merely exemplary and should not be considered as limitations on this application. In actual use, an appropriate method can be selected to determine the frame matching score according to actual needs and specific application scenarios; and the specific values of various thresholds or step sizes and other parameters involved can be determined according to actual needs and specific application scenarios. This application embodiment does not limit these aspects.
[0230] Based on the above analysis, this application embodiment utilizes a template to perform initial editing of the material to be edited, generating an initial finished film. Then, based on the aspect ratio and duration of the priority display area in each segment of the initial finished film, it determines the aspect ratio matching score between the template and the material to be edited. This quantifies the degree of aspect ratio matching between the template and the material, ensuring that even when a user selects multiple aspect ratios of material, a template with better aspect ratio matching can be matched. This maximizes the filling of the finished film with the material content, minimizing the proportion of ineffective display areas such as Gaussian effects or black borders, thereby further enhancing the aesthetic appeal of the finished film and improving the user experience.
[0231] As one possible implementation, the preset matching indicators include a material ratio indicator, and when matching the first template to be matched with the material to be edited according to the material ratio indicator, a material ratio matching score corresponding to the first template to be matched can be generated. That is, in one possible implementation of this application embodiment, the i-th preset matching indicator is the material ratio indicator, and the i-th matching score is the material ratio matching score; correspondingly, step 203 may include:
[0232] Obtain the number of videos and images contained in the material to be edited, and the material type corresponding to the first template to be matched;
[0233] Determine the material ratio corresponding to the material to be edited based on the number of videos and images contained in the material to be edited;
[0234] Based on the material ratio of the material to be edited and the material type of the first template to be matched, determine the material ratio matching score of the first template to be matched.
[0235] Here, "material type" can refer to the template types generated by categorizing templates in the template library based on the types of materials suitable for each template. For example, when the template library supports editing materials including videos and images, the templates in the library can be categorized into material types such as video-first templates, image-first templates, and general templates.
[0236] The material ratio corresponding to the material to be edited can refer to the ratio of the number of videos to the number of images in the material to be edited; or it can refer to the ratio of the number of images to the number of videos in the material to be edited. This application embodiment does not limit this.
[0237] In this embodiment, the templates in the template library can be categorized according to the type of material they are suitable for. For example, when the material includes both video and images, the templates in the library can be divided into video-first templates, image-first templates, and general templates. Therefore, the material ratio corresponding to the material to be edited can be determined based on the number of videos and images contained in the material to be edited. Then, based on the material ratio and the material type corresponding to the first template to be matched, the material ratio matching score corresponding to the first template to be matched can be determined.
[0238] As one possible implementation, one or more material ratio thresholds can be preset, and the material ratio matching score corresponding to the first matching template can be determined based on the relationship between the material ratio corresponding to the material to be edited and each of the material ratio thresholds, as well as the material type corresponding to the first matching template. For example, the material ratio is the ratio of the number of videos to the number of images, and a first material ratio threshold and a second material ratio threshold are preset, with the first material ratio threshold being greater than the second material ratio threshold; then, when the material type corresponding to the first matching template is video, if the material ratio corresponding to the material to be edited is greater than or equal to the first material ratio threshold, the material ratio matching score corresponding to the first matching template can be determined as the first material ratio score (e.g., 20 points); if the material ratio corresponding to the material to be edited is less than the first material ratio threshold but greater than or equal to the second material ratio threshold, the material ratio matching score corresponding to the first matching template can be determined as the second material ratio score (e.g., 10 points); if the material ratio corresponding to the material to be edited is less than the second material ratio threshold, the material ratio matching score corresponding to the first matching template can be determined as the third material ratio score (e.g., 0 points).
[0239] When the material type corresponding to the first template to be matched is an image, if the material ratio corresponding to the material to be edited is greater than or equal to the first material ratio threshold, the material ratio matching score corresponding to the first template to be matched can be determined as the third material ratio score (e.g., 0 points); if the material ratio corresponding to the material to be edited is less than the first material ratio threshold but greater than or equal to the second material ratio threshold, the material ratio matching score corresponding to the first template to be matched can be determined as the second material ratio score (e.g., 10 points); if the material ratio corresponding to the material to be edited is less than the second material ratio threshold, the material ratio matching score corresponding to the first template to be matched can be determined as the first material ratio score (e.g., 20 points).
[0240] When the material type corresponding to the first template to be matched is video, if the proportion of the material to be edited is greater than or equal to the first material proportion threshold, the material proportion matching score corresponding to the first template to be matched can be determined as the second material proportion score or the third material proportion score (e.g., 10 points or 0 points); if the material proportion corresponding to the material to be edited is less than the first material proportion threshold but greater than or equal to the second material proportion threshold, the material proportion matching score corresponding to the first template to be matched can be determined as the first material proportion score (e.g., 20 points); if the material proportion corresponding to the material to be edited is less than the second material proportion threshold, the material proportion matching score corresponding to the first template to be matched can be determined as the second material proportion score or the third material proportion score (e.g., 10 points or 0 points).
[0241] It is understandable that when the ratio of the material to be edited is the ratio of the number of images to the number of videos, the same logic as above can be used to determine the material ratio matching score corresponding to the first template to be matched, which will not be elaborated here.
[0242] It should be noted that the above examples are merely illustrative and should not be considered as limitations on this application. In actual use, the specific method for determining the material ratio matching score can be selected according to actual needs and specific application scenarios, and this application embodiment does not limit this.
[0243] Based on the above analysis, since some templates in the template library are more suitable for video footage and others are more suitable for image footage, the proportion of footage is determined according to the number of videos and images in the footage to be edited. Then, based on the proportion of footage and the type of footage suitable for the template to be matched, a matching score is determined between the footage proportion of the template to be matched and the footage to be edited. This quantifies the degree of matching between the footage type of the template to be matched and the footage to be edited, so that the final recommended template can better match the type of footage selected by the user, improve the final effect of more footage as much as possible, and further enhance the user experience.
[0244] As one possible implementation, the preset matching indicators include slot matching indicators, and when matching the first template to be matched with the material to be edited based on the slot matching indicators, a slot matching score corresponding to the first template to be matched can be generated. That is, in one possible implementation of this application embodiment, the i-th preset matching indicator is a slot matching indicator, and the i-th matching score is a slot matching score; correspondingly, step 203 may include:
[0245] Get the number of clips contained in the clip to be edited;
[0246] Get the number of slots in the first template to be matched, the duration of each slot, and the total duration of the template;
[0247] The first template to be matched is used to perform initial editing of the footage to be edited, so as to generate the initial finished film corresponding to the footage to be edited;
[0248] Obtain the total runtime of the initial final cut and the runtime of each initial segment included in the initial final cut;
[0249] Based on the number of materials and the number of slots, determine the matching degree of the number of slots corresponding to the first template to be matched;
[0250] Based on the total duration of the finished product and the total duration of the template, determine the total duration matching degree of the first template to be matched;
[0251] Based on the duration of each slot and the duration of each segment, determine the slot duration matching degree corresponding to the first template to be matched;
[0252] Based on the matching degree of the number of slots, the matching degree of the total duration, and the matching degree of the slot duration, the slot matching score corresponding to the first template to be matched is determined.
[0253] Here, "slot" can refer to the segments contained in the template; "number of slots" can refer to the number of segments contained in the template; and "slot duration" can refer to the duration of the segments corresponding to each slot in the template.
[0254] It's important to note that to enhance the final editing effect, templates can include multiple music rhythm beats, template transitions, and other editing effects. The segments between adjacent music rhythm beats or template transitions are the template slots. When editing footage using templates, each piece of footage can be filled into a slot based on the number and duration of the slots in the template. This allows different footage to switch with music rhythm beats, template transitions, and other editing effects. Therefore, the higher the slot matching degree between the footage and the template, the better the applicability between the editing speed and the music rhythm beats and template transitions of the template. Furthermore, the above analysis shows that the slot matching degree between the footage and the template is related to the matching degree between the number of footage pieces and the number of slots in the template, the matching degree between the duration of each segment of the footage pieces and the duration of a slot in the template, and the matching degree between the total duration of the footage pieces and the total duration of the template. Therefore, the slot matching score corresponding to the first template can be determined by these parameters.
[0255] As one possible approach, since the footage to be edited can be segmented or merged and then filled into the slots of the template based on its duration and quantity when editing according to the template, the initial cut can be initially edited using the first template to be matched to generate the initial cut corresponding to the footage to be edited. Then, the slot matching degree between the footage to be edited and the first template to be matched can be determined based on the duration of the initial cut and the duration of each segment in the initial cut. Specifically, the ratio of the number of clips corresponding to the material to be edited to the number of slots corresponding to the first template to be matched can be determined as the slot quantity matching degree of the first template to be matched; the ratio of the total duration of the final cut to the total duration of the template corresponding to the first template to be matched can be determined as the total duration matching degree of the first template to be matched; and the ratio of the duration of each initial segment in the final cut to the duration of its corresponding slot can be determined as the individual slot duration matching degree of the first template to be matched; finally, the slot matching score of the first template to be matched can be determined based on the slot quantity matching degree, the total duration matching degree, and the individual slot duration matching degree of the first template to be matched.
[0256] As one possible implementation, one or more quantity matching thresholds, one or more total duration matching thresholds, and one or more slot duration matching thresholds can be preset, and the slot matching score corresponding to the first template to be matched can be determined according to the relationship between the corresponding parameters and the corresponding thresholds. For example, a first quantity matching threshold, a second quantity matching threshold, a third quantity matching threshold, a first total duration matching threshold, a second total duration matching threshold, a third total duration matching threshold, a first slot duration matching threshold, a second slot duration matching threshold, a third slot duration matching threshold, and a fourth slot duration matching threshold can be preset; wherein, the first quantity matching threshold is greater than the second quantity matching threshold, and the second quantity matching threshold is greater than the third quantity matching threshold; the first total duration matching threshold is greater than the second total duration matching threshold, and the second total duration matching threshold is greater than the third total duration matching threshold; and the first slot duration matching threshold is between the second slot duration matching threshold and the third slot duration matching threshold, the second slot duration matching threshold is greater than the third slot duration matching threshold, and the third slot duration matching threshold is greater than the fourth slot duration matching threshold.
[0257] If the matching degree of the number of slots corresponding to the first template to be matched is greater than or equal to the first matching degree threshold, the matching degree of the total duration is greater than or equal to the first matching degree threshold of the total duration, and the matching degree of the duration of each slot is the first matching degree threshold of the duration of each slot, then it can be determined that the first template to be matched is a complete match with the material to be edited, and the matching score of the slots corresponding to the first template to be matched can be determined as the first slot score (e.g., 15 points); if the matching degree of the number of slots corresponding to the first template to be matched is less than the first matching degree threshold but greater than or equal to the second matching degree threshold, the matching degree of the second total duration is less than the first matching degree threshold but greater than or equal to the second total duration threshold, and the matching degree of the duration of each slot is less than or equal to the second matching degree threshold of the duration of each slot but greater than or equal to the third matching degree threshold of the duration of each slot, then it can be determined that the first template to be matched is a good match with the material to be edited, and the matching score of the slots corresponding to the first template to be matched can be determined as the second slot score (e.g., 15 points). (10 points); If the matching degree of the number of slots corresponding to the first template to be matched is less than the second matching degree threshold and greater than or equal to the third matching degree threshold, the matching degree of the second total duration is less than the second total duration matching degree threshold and greater than or equal to the third total duration matching degree threshold, and the matching degree of the duration of at most L slots is less than or equal to the third slot duration matching degree threshold and greater than the fourth slot duration matching degree threshold, and the matching degree of the duration of the remaining slots is less than or equal to the second slot duration matching degree threshold and greater than or equal to the third slot duration matching degree threshold, then it can be determined that the first template to be matched is generally matched with the material to be edited, and the matching score of the slots corresponding to the first template to be matched can be determined as the third slot score (e.g., 3 points), where L is less than the number of slots corresponding to the first template to be matched; otherwise, it can be determined that the first template to be matched is poorly matched with the material to be edited, and the matching score of the slots corresponding to the first template to be matched can be determined as the fourth slot score (e.g., 0 points).
[0258] For example, suppose the first quantity matching threshold is 100%, the second quantity matching threshold is 80%, the third quantity matching threshold is 60%, the first total duration matching threshold is 100%, the second total duration matching threshold is 75%, the third total duration matching threshold is 40%, and the first slot duration matching threshold is 1, the second slot duration matching threshold is 1.2, the third slot duration matching threshold is 0.8, and the fourth slot duration matching threshold is 0.5; the first slot score is 15 points, the second slot score is 10 points, the third slot score is 3 points, and the fourth slot score is... The position score is 0, and L is 2. Therefore, when the matching degree of the number of slots corresponding to the first template to be matched is 100%, the matching degree of the total duration is 100%, and the matching degree of the duration of each slot is 1, it can be determined that the first template to be matched is a complete match with the material to be edited, and the matching score of the slots corresponding to the first template to be matched can be determined as 15 points. When the matching degree of the number of slots corresponding to the first template to be matched is greater than or equal to 80%, the matching degree of the total duration is greater than or equal to 75%, and the matching degree of the duration of each slot is between 0.8 and 1.2, it can be determined that the first template to be matched is a complete match with the material to be edited. The template matches the footage to be edited well, so the matching score for the slots corresponding to the first template to be matched can be determined as 10 points. That is, when the match is good, each slot can be adjusted by changing the speed of the footage content from 0.8 to 1.2 to match the duration of the corresponding slot. When the matching degree of the number of slots corresponding to the first template to be matched is greater than or equal to 60%, the total duration matching degree is greater than or equal to 40%, and at most two slots have a duration matching degree between 0.5 and 0.8, and the duration matching degree of all other slots is between 0.8 and 1.2, the first template to be matched can be determined as good. If the template matches the footage to be edited in a normal way, the matching score for the slot corresponding to the first template to be matched can be determined as 3 points. That is, in normal matching, at most two slots can be matched by changing the speed of the footage content by 0.5-0.8, so that the footage content matches the duration of the corresponding slot. Moreover, the remaining slots can be matched by changing the speed of the footage content by 0.8-1.2. In other cases, the first template to be matched and the footage to be edited are determined to be poorly matched, so the matching score for the slot corresponding to the first template to be matched can be determined as 0 points.
[0259] As an example, in the above example, the third total duration matching threshold can also be a fixed duration determined empirically. This fixed duration can be the minimum allowable total duration of the final cut. Based on the relationship between the total duration of the initial cut and this fixed duration, it can be determined whether the first template to be matched and the material to be edited are generally matched. For example, if the fixed duration is 12 seconds, then when the matching degree of the number of slots corresponding to the first template to be matched is greater than or equal to 60%, the total duration of the final cut is greater than or equal to 12 seconds, and the duration matching degree of at most 2 slots is between 0.5 and 0.8, and the duration matching degree of the remaining slots is between 0.8 and 1.2, it can be determined that the first template to be matched and the material to be edited are generally matched, and thus the slot matching score corresponding to the first template to be matched can be determined as 3 points.
[0260] It should be noted that the above examples are merely illustrative and should not be considered as limitations on this application. In actual use, the specific method for determining the slot matching score, the number of thresholds involved in determining the slot matching score, and the specific values of each threshold can all be determined according to actual needs and specific application scenarios. This application embodiment does not limit these aspects.
[0261] Based on the above analysis, since templates can contain multiple slots, and adjacent slots can have editing effects such as music rhythm timing and template transitions to enhance the diversity and richness of the editing effects, the template to be matched can be used to perform initial editing of the footage to be edited. This allows for the determination of the matching degree between the template to be matched and the footage to be edited in terms of the number of slots, the duration of slots, and the total duration. This quantifies the degree of slot matching between the template to be matched and the footage to be edited, thereby making the music rhythm timing, template transitions, etc., of the finally recommended template more suitable for the footage selected by the user, further improving the editing effect of the finished product and enhancing the user experience.
[0262] Furthermore, when determining the slot matching score, the beat type of the template to be matched can be referenced to set different slot matching scores for different beat types. This results in a higher degree of match between the beat type of the final recommended template and the user's selected material, thereby further improving the rhythm and transition effects of the final cut and enhancing the user experience. Specifically, in one possible implementation of this application embodiment, determining the slot matching score corresponding to the first template to be matched based on the slot quantity matching degree, total duration matching degree, and slot duration matching degree includes:
[0263] Get the checkpoint type corresponding to the first template to be matched;
[0264] The slot matching score is determined based on the matching degree of the number of slots, the matching degree of the total duration, the matching degree of the slot duration, and the type of checkpoint.
[0265] Among them, checkpoint types can include at least strong checkpoint types and ordinary checkpoint types.
[0266] As one possible implementation, for templates with strong beat matching, if there is a high degree of matching between the template and the footage to be edited, the score for matching the beat matching of the template with strong beat matching can be given a higher weight. This makes it easier to recommend strong beat matching templates to users compared to ordinary beat matching templates when the beat matching is similar, thereby further improving the rhythm and transition effects of the final cut. Therefore, in this embodiment, different scoring rules can be set for strong beat matching templates and ordinary beat matching templates. Following the aforementioned method, the beat matching degree between the first template to be matched and the footage to be edited can be determined as a perfect match, a good match, a moderate match, or a poor match based on the beat matching degree, total duration matching degree, and beat duration matching degree of the first template to be matched. Then, combined with the scoring rules corresponding to the beat matching type of the first template to be matched, the score for matching the beat matching of the first template to be matched is determined.
[0267] For example, suppose the scoring rules for a standard beat-match template are: 15 points for a perfect match, 10 points for a good match, 3 points for a fair match, and 0 points for a poor match. The scoring rules for a strong beat-match template are: 25 points for a perfect match, 20 points for a good match, 10 points for a fair match, and 0 points for a poor match. Therefore, if the first template to be matched is a standard beat-match template, the score for a perfect match, a good match, a fair match, and a poor match with the footage to be edited is 15 points, 10 points, 3 points, and 0 points respectively. Conversely, if the first template to be matched is a strong beat-match template, the score for a perfect match, a good match, a fair match, and a poor match with the footage to be edited is 25 points, 20 points, 10 points, and 0 points respectively.
[0268] As one possible implementation, if the templates to be matched include templates without marked slots or slot restrictions, then for these templates, the slot matching score can be determined not in the manner described above, but by setting a fixed score, such as 2 points. In actual use, the specific value of this fixed score can be determined according to actual needs and specific application scenarios, and this application embodiment does not limit it in this way.
[0269] As one possible implementation, the preset matching indicators include a download type indicator, and when matching the first template to be matched with the material to be edited based on the download type indicator, a download score corresponding to the first template to be matched can be generated. That is, in one possible implementation of this application embodiment, the i-th preset matching indicator is the download type indicator, and the i-th matching score is the download score; correspondingly, step 203 may include:
[0270] Obtain the download type corresponding to the first template to be matched, where the download type includes local templates and online templates;
[0271] Based on the download type, determine the download score corresponding to the first template to be matched.
[0272] In this embodiment, based on actual recommendation needs, it can be determined which type of template is more likely to be recommended to the user, and a higher download score can be assigned to the matching template of that type. For example, if it is more likely to recommend local templates to the user, the download score corresponding to local templates can be made greater than the download score corresponding to online templates, so that local templates are more likely to be recommended to the user; if it is more likely to recommend online templates to the user, the download score corresponding to online templates can be made greater than the download score corresponding to local templates, so that online templates are more likely to be recommended to the user.
[0273] Furthermore, to make local templates more easily recommended to users, and to minimize the data consumption of users downloading templates while ensuring editing quality, local templates can be assigned a higher download score. That is, in one possible implementation of this application embodiment, determining the download score corresponding to the first template to be matched based on the download type may include:
[0274] If the download type corresponding to the first template to be matched is an online template, the download score will be set to 0.
[0275] If the download type corresponding to the first template to be matched is a local template, a score is randomly selected from the first score range and determined as the download score, wherein the minimum value of the first score range is greater than or equal to 0.
[0276] As one possible implementation, if the download type corresponding to the first template to be matched is an online template, then the download score corresponding to the first template to be matched can be set to 0; if the download type corresponding to the first template to be matched is a local template, then a score can be randomly selected from a first score range greater than or equal to 0, and determined as the download score corresponding to the first template to be matched. For example, the first score range can be 0, 5, or 10, so when the first template to be matched is a local template, any one of 0, 5, or 10 can be randomly selected as its corresponding download score.
[0277] It should be noted that in the example above, since the first score range includes 0 points, in some cases the download score of the local template may be the same as that of the online template, both being 0 points. This is to prevent the download score of the local template from always being higher than that of the online template, thus avoiding the situation where the online template can never be recommended. In this way, while reducing traffic consumption, some online templates can still be recommended to users, thereby further improving the freshness and richness of template recommendations.
[0278] Furthermore, if the user has downloaded few local templates, online templates can be left unrestricted to prevent a shortage of templates that would prevent suitable templates from being recommended to the user and thus affect the editing effect. Therefore, in one possible implementation of this application embodiment, before obtaining the download type corresponding to the first template to be matched, the following steps may be included:
[0279] The number of templates in the template library that are local templates and whose download type is determined to be greater than the number threshold.
[0280] One possible approach is to suppress online templates once the number of local templates in the template library exceeds a certain threshold, i.e., when the number of local templates reaches a certain scale. This would allow for the recommendation of as many local templates as possible to users, thereby reducing the traffic impact of template downloads.
[0281] It should be noted that in actual use, the specific value of the above quantity threshold can be determined according to actual needs and specific application scenarios, and this application embodiment does not limit it in this regard. For example, the above quantity threshold can be 50, 100, etc.
[0282] As one possible implementation, the preset matching indicators include operational indicators, and when matching the first template to be matched with the material to be edited based on the operational indicators, an operational matching score corresponding to the first template to be matched can be generated. That is, in one possible implementation of this application embodiment, the i-th preset matching indicator is an operational indicator, and the i-th matching score is an operational matching score; correspondingly, step 203 may include:
[0283] Get the operation type corresponding to the first template to be matched;
[0284] Based on the operation type, determine the operation matching score corresponding to the first template to be matched.
[0285] The "operation type" can be used to indicate whether the template currently needs promotion. For example, operation types can include new launch, popular activity, high quality, device model variable, and user profile variable. In actual use, the operation type can include, but is not limited to, the situations listed above; this application embodiment does not impose such limitations.
[0286] As one possible implementation, if the operation type corresponding to the first template to be matched is determined to be an operation type that needs to be promoted, then the matching score for the operation corresponding to the first template to be matched can be set to a higher value; if the operation type corresponding to the first template to be matched is determined to be an operation type that does not need to be promoted, then the matching score for the operation corresponding to the first template to be matched can be set to a lower value. For example, if the operation type corresponding to the first template to be matched is determined to be an operation type that needs to be promoted, then the matching score for the operation corresponding to the first template to be matched can be set to 10 points; if the operation type corresponding to the first template to be matched is determined to be an operation type that does not need to be promoted, then the matching score for the operation corresponding to the first template to be matched can be set to 0 points.
[0287] As an example, when labeling the operational types of each template in the template library, if a template needs to be promoted, its specific operational type can be labeled, such as "newly launched" or "high-quality." If a template does not need to be promoted, its operational type can be left unlabeled. Therefore, if the operational type corresponding to the first template to be matched is empty, it can be determined that the first template to be matched does not need to be promoted; if the first template to be matched has a specific operational type, it can be determined that the first template to be matched needs to be promoted.
[0288] Furthermore, the operational types to be promoted can be preset, and when the operational type corresponding to the first template to be matched matches the preset operational type, a higher operational matching score can be assigned to the first template to be matched. That is, in one possible implementation of this application embodiment, the above-mentioned determination of the operational matching score corresponding to the first template to be matched based on the operational type may include:
[0289] When the operation type is a preset operation type, a score is randomly selected from the second score range to determine the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0290] If the operation type is not the preset operation type, the operation matching score will be set to 0.
[0291] The preset operation type can be set according to actual promotion needs, and this application embodiment does not limit it. For example, the preset operation type may include one or more of the following types: new launch, popular event, high quality, device model variable, and user profile variable.
[0292] As one possible implementation, if the operation type corresponding to the first template to be matched is not a preset operation type, the operation matching score corresponding to the first template to be matched can be set to 0; if the operation type corresponding to the first template to be matched is a preset operation type, a score can be randomly selected from a second score range greater than 0 and determined as the operation matching score corresponding to the first template to be matched. For example, the second score range can be 1-10 points, so when the operation type corresponding to the first template to be matched is a preset operation type, any score from 1 to 10 can be randomly selected as its corresponding operation matching score.
[0293] Based on the above analysis, this application embodiment determines the operation matching score of the template to be matched according to the operation type corresponding to the template to be matched. This allows for the assignment of higher scores to the templates to be matched that need to be promoted, making it easier to recommend the templates to users and further improving the flexibility of template matching.
[0294] Step 204: Determine the target matching score corresponding to the first template to be matched based on the N matching scores corresponding to the first template to be matched.
[0295] In this embodiment of the application, after determining the N matching scores corresponding to the first template to be matched, the target matching score corresponding to the first template to be matched can be determined based on these N matching scores.
[0296] As one possible implementation, the sum of the N matching scores corresponding to the first template to be matched can be determined as the target matching score corresponding to the first template to be matched.
[0297] As one possible implementation, different weights can be assigned to the N matching scores corresponding to the first template to be matched, and the weighted sum of the N matching scores corresponding to the first template to be matched can be determined as the target matching score corresponding to the first template to be matched.
[0298] It should be noted that, following the same method described above, the target matching score for each template to be matched can be determined sequentially.
[0299] Other specific implementation processes and principles of step 204 above can be found in the detailed description of the above embodiments, and will not be repeated here.
[0300] Step 205: Based on the target matching score corresponding to each template to be matched, select at least one template to be matched as the target template corresponding to the material to be edited.
[0301] The specific implementation process and principle of step 205 above can be found in the detailed description of the above embodiments, and will not be repeated here.
[0302] As an example, such as Figure 3 The diagram shown is a flowchart illustrating a template matching method for material editing provided in an embodiment of this application. Figure 3 In the illustrated scheme, the user-selected editing material can include both video and images. After the video undergoes frame extraction, the frame extraction results and images are input together into the template matching model corresponding to the template matching method for editing materials in this embodiment. This model performs theme recognition on the editing material based on the frame extraction results and images to determine the matching template and theme matching score for the editing material. Then, the frame matching score, material ratio matching score, slot matching score, download score, and operation matching score for the matching template are calculated using aspect ratio matching index, material ratio matching score, slot matching score, download score, and operation matching score, respectively. Based on the aspect ratio matching score, material ratio matching score, slot matching score, download score, and operation matching score for the matching template, as well as the local pre-made loss prevention principle, a comprehensive selection is performed. At least one target template is selected and recommended to the user through an equal division deduplication mechanism. Finally, the editing material is processed according to the target template selected by the user to generate the finished product corresponding to the editing material.
[0303] It should be noted that, Figure 3 Other specific implementation processes and descriptions of the scheme shown can be found in the detailed description of the above embodiments, and will not be repeated here.
[0304] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0305] Corresponding to the template matching method for material editing described in the above embodiments, Figure 4 The diagram shows a structural block diagram of a template matching device for material editing provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0306] Reference Figure 4 The device 40 includes:
[0307] The first acquisition module 41 is used to acquire at least one material to be edited selected by the user, wherein the material to be edited includes at least one of video and image;
[0308] The second acquisition module 42 is used to identify the theme of the material to be edited based on the various template themes contained in the template library, so as to obtain multiple templates to be matched from the template library;
[0309] The first determining module 43 is used to match each template to be matched with the material to be edited according to at least one preset matching index, so as to determine the target matching score corresponding to each template to be matched.
[0310] The first selection module 44 is used to select at least one template to be matched as the target template corresponding to the material to be edited, based on the target matching score corresponding to each template to be matched.
[0311] In practical use, the template matching device for material editing provided in this application embodiment can be configured in any electronic device to execute the aforementioned template matching method for material editing.
[0312] The template matching device for editing materials provided in this application first selects a template that matches the theme of the material to be edited by theme recognition. Then, it evaluates the matching degree between the template and the material to be edited from multiple evaluation dimensions based on at least one preset matching index. Based on the matching degree between the template and the material to be edited, it selects a suitable target template to recommend to the user, thereby improving the matching degree between the recommended template and the material selected by the user, improving the final product effect, and improving the user experience.
[0313] In one possible implementation of this application, the second acquisition module 42 includes:
[0314] The first determining unit is used to identify the theme of the material to be edited based on each template theme, so as to determine the degree of matching between the material to be edited and each template theme;
[0315] The second determination unit is used to determine the template theme to be matched for the material to be edited based on the degree of matching between the material to be edited and each template theme.
[0316] The third determining unit is used to determine each template in the template library whose template theme is the template theme to be matched as the template to be matched.
[0317] Furthermore, in another possible implementation of this application, the number of the aforementioned preset matching indicators is N, where N is a positive integer; correspondingly, the aforementioned first determining module 43 includes:
[0318] The fourth determining unit is used to match the first template to be matched with the material to be edited according to the i-th preset matching index, so as to determine the i-th matching score corresponding to the first template to be matched, wherein the first template to be matched is any template to be matched, 1≤i≤N;
[0319] The fifth determining unit is used to determine the target matching score corresponding to the first matching template based on the N matching scores corresponding to the first matching template.
[0320] Furthermore, in another possible implementation of this application, the aforementioned preset matching indicators include at least one of the following indicators: aspect ratio matching indicator, material type indicator, slot matching indicator, download type indicator, and operation indicator.
[0321] Furthermore, in another possible implementation of this application, the i-th preset matching index is a topic matching index, and the i-th matching score is a topic matching score; correspondingly, the fourth determining unit is specifically used for:
[0322] The theme of the footage to be edited is identified based on each template theme in order to determine the degree of matching between the footage to be edited and the template theme corresponding to the first template to be matched;
[0323] The theme matching score of the first template to be matched is determined based on the degree of matching between the material to be edited and the theme of the first template to be matched.
[0324] Furthermore, in another possible implementation of this application, the i-th preset matching index is a frame matching index, and the i-th matching score is a frame matching score; correspondingly, the fourth determining unit is also used for:
[0325] The first template to be matched is used to perform initial editing of the footage to be edited, in order to determine the initial finished film corresponding to the footage to be edited;
[0326] Obtain the initial segments included in the initial final cut and the segment duration corresponding to each initial segment;
[0327] Determine the aspect ratio corresponding to the effective display area in each initial segment;
[0328] Based on the aspect ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment, determine the aspect ratio matching score corresponding to the first template to be matched.
[0329] Furthermore, in another possible implementation of this application, the i-th preset matching index is a material ratio index, and the i-th matching score is a material ratio matching score; correspondingly, the fourth determining unit is also used for:
[0330] Obtain the number of videos and images contained in the material to be edited, and the material type corresponding to the first template to be matched;
[0331] Determine the material ratio corresponding to the material to be edited based on the number of videos and images contained in the material to be edited;
[0332] Based on the material ratio of the material to be edited and the material type of the first template to be matched, determine the material ratio matching score of the first template to be matched.
[0333] Furthermore, in another possible implementation of this application, the i-th preset matching index is a slot matching index, and the i-th matching score is a slot matching score; correspondingly, the fourth determining unit is also used for:
[0334] Get the number of clips contained in the clip to be edited;
[0335] Get the number of slots in the first template to be matched, the duration of each slot, and the total duration of the template;
[0336] The first template to be matched is used to perform initial editing of the footage to be edited, so as to generate the initial finished film corresponding to the footage to be edited;
[0337] Obtain the total runtime of the initial final cut and the runtime of each initial segment included in the initial final cut;
[0338] Based on the number of materials and the number of slots, determine the matching degree of the number of slots corresponding to the first template to be matched;
[0339] Based on the total duration of the finished product and the total duration of the template, determine the total duration matching degree of the first template to be matched;
[0340] Based on the duration of each slot and the duration of each segment, determine the slot duration matching degree corresponding to the first template to be matched;
[0341] Based on the matching degree of the number of slots, the matching degree of the total duration, and the matching degree of the slot duration, the slot matching score corresponding to the first template to be matched is determined.
[0342] Furthermore, in another possible implementation of this application, the fourth determining unit is further configured to:
[0343] Get the checkpoint type corresponding to the first template to be matched;
[0344] The slot matching score is determined based on the matching degree of the number of slots, the matching degree of the total duration, the matching degree of the slot duration, and the type of checkpoint.
[0345] Furthermore, in another possible implementation of this application, the i-th preset matching index is a download type index, and the i-th matching score is a download score; correspondingly, the fourth determining unit is also used for:
[0346] Obtain the download type corresponding to the first template to be matched, where the download type includes local templates and online templates;
[0347] Based on the download type, determine the download score corresponding to the first template to be matched.
[0348] Furthermore, in yet another possible implementation of this application, the fourth determining unit is further configured to:
[0349] If the download type corresponding to the first template to be matched is an online template, the download score will be set to 0.
[0350] If the download type corresponding to the first template to be matched is a local template, a score is randomly selected from the first score range and determined as the download score, wherein the minimum value of the first score range is greater than or equal to 0.
[0351] Furthermore, in another possible implementation of this application, the aforementioned fourth determining unit is also used for:
[0352] The number of templates in the template library that are local templates and whose download type is determined to be greater than the number threshold.
[0353] Furthermore, in another possible implementation of this application, the i-th preset matching indicator is an operational indicator, and the i-th matching score is an operational matching score; correspondingly, the fourth determining unit is also used for:
[0354] Get the operation type corresponding to the first template to be matched;
[0355] Based on the operation type, determine the operation matching score corresponding to the first template to be matched.
[0356] Furthermore, in yet another possible implementation of this application, the fourth determining unit is further configured to:
[0357] When the operation type is a preset operation type, a score is randomly selected from the second score range to determine the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0358] If the operation type is not the preset operation type, the operation matching score will be set to 0.
[0359] Furthermore, in yet another possible implementation of this application, the aforementioned device 40 further includes:
[0360] The third acquisition module is used to acquire the M historical templates that have been used by users and the most recent usage time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0361] The second determination module is used to determine the suppression score corresponding to each historical template based on the most recent usage time of each historical template.
[0362] The first correction module is used to correct the target matching score corresponding to each historical template based on the suppression score corresponding to each historical template.
[0363] Furthermore, in yet another possible implementation of this application, the first selection module 44 includes:
[0364] The first selection unit is used to select K templates with the highest target matching scores as target templates based on the target matching scores corresponding to each template to be matched, where K is a positive integer.
[0365] Furthermore, in another possible implementation of this application, the target matching scores corresponding to the above K target templates are all different.
[0366] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0367] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0368] To implement the above embodiments, this application also proposes an electronic device.
[0369] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0370] See Figure 5The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0371] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0372] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors. As one possible implementation, the processor can determine and recommend target templates matching the user's selected editing footage.
[0373] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0374] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0375] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0376] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is an integer greater than 1.
[0377] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0378] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, and the image sensor transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 193.
[0379] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0380] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0381] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0382] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the template matching method for material editing in the embodiments of this application, and will not be repeated here.
[0383] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0384] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0385] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / electronic device, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0386] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0387] In the above embodiments, specific details such as particular system structures and techniques have been set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary details.
[0388] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0389] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0390] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0391] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0392] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0393] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0394] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0395] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0396] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A template matching method of material cutting, characterized by, include: Obtain at least one piece of material to be edited selected by the user, wherein the material to be edited includes at least one of video and image; The material to be edited is thematically identified based on the various template themes contained in the template library, so as to obtain multiple matching templates from the template library; According to the i-th preset matching index, the first template to be matched is matched with the material to be edited to determine the i-th matching score corresponding to the first template to be matched. The first template to be matched is any of the templates to be matched. The number of preset matching indices is N, where N is a positive integer, 1 ≤ i ≤ N. The preset matching indices include the following indices: theme matching index, aspect ratio matching index, material type index, slot matching index, download type index, and operational index. The material type index is used to measure the degree of matching between the material type corresponding to the template to be matched and the material ratio corresponding to the template to be matched. The slot matching index is used to measure the degree of slot matching between the template to be matched and the material to be edited, where a slot refers to a segment contained in the template. The download type index is used to measure the degree of matching between the download type corresponding to the template to be matched and the material to be edited, where the download type includes local templates and online templates. The sum of the N matching scores corresponding to the first template to be matched or the weighted sum of the N matching scores is determined as the target matching score corresponding to the first template to be matched. Based on the target matching score corresponding to each of the templates to be matched, at least one of the templates to be matched is selected as the target template corresponding to the material to be edited. Wherein, if the i-th preset matching indicator is the aspect ratio matching indicator and the i-th matching score is the aspect ratio matching score, the step of matching the first template to be matched with the material to be edited according to the i-th preset matching indicator to determine the i-th matching score corresponding to the first template to be matched includes: The first template to be matched is used to perform initial editing on the material to be edited in order to determine the initial finished film corresponding to the material to be edited. Obtain each initial segment included in the initial final cut and the segment duration corresponding to each initial segment; Determine the aspect ratio corresponding to the effective display area in each of the initial segments, wherein the effective display area refers to the display area corresponding to the material content in the initial segment; Based on the aspect ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment, the aspect ratio matching score corresponding to the first template to be matched is determined. Wherein, if the i-th preset matching indicator is the operational indicator and the i-th matching score is the operational matching score, the step of matching the first template to be matched with the material to be edited according to the i-th preset matching indicator to determine the i-th matching score corresponding to the first template to be matched includes: Obtain the operation type corresponding to the first template to be matched, wherein the operation type is used to indicate whether the template currently needs to be promoted; Based on the operation type, determine the operation matching score corresponding to the first template to be matched.
2. The method of claim 1, wherein, The step of identifying the theme of the material to be edited based on the various template themes contained in the template library, in order to obtain multiple templates to be matched from the template library, includes: The theme of the material to be edited is identified according to each of the template themes in order to determine the degree of matching between the material to be edited and each of the template themes; Based on the matching degree between the material to be edited and each of the template themes, the template theme to be matched corresponding to the material to be edited is determined; Each template in the template library whose theme is the theme to be matched is identified as the template to be matched.
3. The method of claim 1, wherein, The i-th preset matching index is the theme matching index, and the i-th matching score is the theme matching score. The step of matching the first template to be matched with the material to be edited according to the i-th preset matching index to determine the i-th matching score corresponding to the first template to be matched includes: The theme of the material to be edited is identified according to each of the template themes to determine the degree of matching between the material to be edited and the template theme corresponding to the first matching template. The theme matching score corresponding to the first template to be matched is determined based on the degree of matching between the material to be edited and the template theme corresponding to the first template to be matched.
4. The method of claim 1, wherein, The i-th preset matching index is the material ratio index, and the i-th matching score is the material ratio matching score. The step of matching the first template to be matched with the material to be edited according to the i-th preset matching index to determine the i-th matching score corresponding to the first template to be matched includes: Obtain the number of videos and images contained in the material to be edited, and the material type corresponding to the first template to be matched; The proportion of the material to be edited is determined based on the number of videos and images contained in the material to be edited. Based on the material ratio corresponding to the material to be edited and the material type corresponding to the first template to be matched, the material ratio matching score corresponding to the first template to be matched is determined.
5. The method of claim 1, wherein, The i-th preset matching index is the slot matching index, and the i-th matching score is the slot matching score. The step of matching the first template to be matched with the material to be edited based on the i-th preset matching index to determine the i-th matching score corresponding to the first template to be matched includes: Obtain the number of materials contained in the material to be edited; Obtain the number of slots, duration of each slot, and total duration of the template contained in the first template to be matched; The first template to be matched is used to perform initial editing on the material to be edited in order to generate the initial finished film corresponding to the material to be edited; Obtain the total duration of the initial cut and the duration of each initial segment included in the initial cut; Based on the quantity of materials and the quantity of slots, determine the matching degree of the number of slots corresponding to the first template to be matched; Based on the total duration of the finished video and the total duration of the template, the total duration matching degree corresponding to the first template to be matched is determined; Based on the duration of each slot and the duration of each segment, determine the slot duration matching degree corresponding to the first template to be matched; Based on the matching degree of the number of stalls, the matching degree of the total duration, and the matching degree of the stall duration, the matching score of the stall corresponding to the first template to be matched is determined.
6. The method as described in claim 5, characterized in that, The step of determining the slot matching score corresponding to the first template to be matched based on the slot quantity matching degree, the total duration matching degree, and the slot duration matching degree includes: Obtain the checkpoint type corresponding to the first template to be matched; The pit matching score is determined based on the pit number matching degree, the total duration matching degree, the pit duration matching degree, and the checkpoint type.
7. The method as described in claim 1, characterized in that, The i-th preset matching indicator is the download type indicator, and the i-th matching score is the download score. The step of matching the first template to be matched with the material to be edited according to the i-th preset matching indicator to determine the i-th matching score corresponding to the first template to be matched includes: Obtain the download type corresponding to the first template to be matched, wherein the download type includes local templates and online templates; Based on the download type, determine the download score corresponding to the first template to be matched.
8. The method as described in claim 7, characterized in that, Determining the download score corresponding to the first template to be matched based on the download type includes: If the download type corresponding to the first template to be matched is the online template, the download score is determined to be 0; When the download type corresponding to the first template to be matched is the local template, a score is randomly selected from the first score range and determined as the download score, wherein the minimum value of the first score range is greater than or equal to 0.
9. The method as described in claim 8, characterized in that, Before obtaining the download type corresponding to the first template to be matched, the method further includes: The number of templates in the template library whose download type is "local template" is greater than a certain threshold.
10. The method as described in claim 1, characterized in that, The step of determining the operation matching score corresponding to the first template to be matched based on the operation type includes: When the operation type is a preset operation type, a score is randomly selected from the second score range and determined as the operation matching score, wherein the minimum value of the second score range is greater than 0; If the operation type is not the preset operation type, the operation matching score will be set to 0.
11. The method according to any one of claims 1-10, characterized in that, After determining the target matching score for each template to be matched by matching it with the material to be edited according to at least one preset matching index, the method further includes: Obtain the M historical templates that the user has used and the most recent usage time of the M historical templates contained in the template to be matched, where M is a positive integer; Based on the most recent usage time of each historical template, the suppression score corresponding to each historical template is determined. Based on the suppression score corresponding to each historical template, the target matching score corresponding to each historical template is corrected.
12. The method according to any one of claims 1-10, characterized in that, The step of selecting at least one of the templates to be matched as the target template corresponding to the material to be edited, based on the target matching score corresponding to each template to be matched, includes: Based on the target matching score corresponding to each of the templates to be matched, select K templates with the highest target matching scores as the target templates, where K is a positive integer.
13. The method as described in claim 12, characterized in that, The target matching scores corresponding to the K target templates are all different.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the electronic device implements the method as described in any one of claims 1-13.
15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by an electronic device, it implements the method as described in any one of claims 1-13.