Template matching method for material editing and electronic equipment
Through topic recognition and preset matching indicator evaluation, the problem of low matching between templates and materials in the existing technology is solved, and better filming effect and user experience are achieved.
Patent Information
- Application Number
- CN202311646239.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2043-11-30
AI Technical Summary
In the prior art, the editing template recommendations are easily recommended through theme matching, which easily leads to low matching between the template and the material content, resulting in unsatisfactory filming effect and affecting user experience.
By obtaining the material to be edited selected by the user, the topic recognition is performed to obtain multiple templates to be matched, the preset matching indicators are used to judge the matching degree between the template and the material from multiple evaluation dimensions, and the target template is selected and recommended to the user.
It improves the matching degree of recommended templates with the materials selected by users, and improves the film effect and user experience.
Smart Images

Figure CN120107629A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer application technology, and in particular, relates to a template matching method for material clipping, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the widespread popularity and rapid development of electronic devices such as smart phones, the functions of electronic devices such as smart phones are becoming more and more complete. For example, users can use the camera function of electronic devices to take pictures, and use the editing function of electronic devices to edit the taken videos and images. In some editing applications, editing templates can be automatically recommended to users based on the materials provided by users, so that users who are not good at editing can also obtain better editing results, thereby improving the convenience of editing and meeting the user's needs for quick editing.
[0003] In the related art, after the user selects the material to be edited, the material can be subject-identified, and a template matching the material subject can be automatically matched and recommended to the user. However, only subject matching can easily result in the recommended template not matching the material content input by the user, resulting in unsatisfactory film effects and affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide a template matching method for material editing, an electronic device and a computer-readable storage medium, which can solve the problem that the method of recommending editing templates through theme matching easily leads to a low match between the recommended template and the material content input by the user, thereby resulting in unsatisfactory film effects and affecting the user experience.
[0005] In a first aspect, an embodiment of the present application provides a template matching method for material editing, comprising: obtaining at least one material to be edited selected by a user, wherein the material to be edited includes at least one of a video and an image; performing theme recognition on the material to be edited according to each template theme contained in a template library to obtain multiple templates to be matched from the template library; according to at least one preset matching index, matching each template to be matched with the material to be edited respectively to determine a target matching score corresponding to each template to be matched; according to the target matching score corresponding to each template to be matched, selecting at least one template to be matched as the target template corresponding to the material to be edited.
[0006] In this way, first, a template to be matched that matches the theme of the material to be edited is selected through theme recognition, and then the matching degree between the template to be matched and the material to be edited is judged from multiple evaluation dimensions according to at least one preset matching index, and a suitable target template is selected and recommended to the user according to the matching degree between the template to be matched and the material to be edited, thereby improving the matching degree between the recommended template and the material selected by the user, improving the filming effect, and improving the user experience.
[0007] In a possible implementation of the first aspect, the subject identification of the to-be-cut material according to each template subject included in the template library to obtain multiple to-be-matched templates from the template library includes:
[0008] Performing theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and each template theme;
[0009] Determine the template theme to be matched corresponding to the material to be edited according to the matching degree between the material to be edited and each template theme;
[0010] Each template in the template library whose template theme is the theme of the template to be matched is determined as the template to be matched.
[0011] In this way, by first performing theme recognition on the material to be edited, and selecting a template whose theme matches the theme of the material to be edited from the template library as the template to be matched for further matching in the next step, templates that are irrelevant to the theme of the material to be edited can be removed, thereby reducing the amount of calculation for subsequent template matching, improving the efficiency of template matching, and further improving the user experience.
[0012] Optionally, in another possible implementation manner of the first aspect, the number of the preset matching indicators is N, where N is a positive integer; accordingly, the matching of each template to be matched with the material to be edited according to at least one preset matching indicator to determine a 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, wherein the first template to be matched is any template to be matched, 1≤i≤N;
[0014] A target matching score corresponding to the first template to be matched is determined according to the N matching scores corresponding to the first template to be matched.
[0015] In this way, through multiple different matching indicators, the matching degree between the template to be matched and the material to be edited is evaluated from multiple dimensions, and the matching score of the template to be matched under each matching indicator is generated, and then the final matching score of the template to be matched is determined according to the matching scores under each indicator, thereby realizing the quantification of the matching degree between the template to be matched and the material to be edited in multiple dimensions and obtaining a comprehensive score, thereby further improving the reliability of template matching and further improving the generation effect of the finished film.
[0016] Optionally, in another possible implementation of the first aspect, the preset matching index includes at least one of the following indicators: a theme matching index, a frame matching index, a material type index, a slot matching index, a download type index, and an operation index.
[0017] In this way, through the theme matching index, frame matching index, material type index, slot matching index, download type index, operation index, etc., the matching template and the material to be edited are matched in theme, frame matching, material type matching, and slot matching, and the matching templates of specific download types and specific operation types are promoted, so that the recommended template and the material selected by the user have a high degree of matching in terms of theme, frame ratio, material type, slot, download type, operation type, etc., thereby further improving the reliability of template matching, further improving the beauty of the film, and further improving the user experience.
[0018] Optionally, in yet another possible implementation of the first aspect, the i-th preset matching index is a theme matching index, and the i-th matching score is a theme matching score; accordingly, 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:
[0019] Performing theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and the template theme corresponding to the first template to be matched;
[0020] According to the matching degree between the to-be-edited material and the template theme corresponding to the first to-be-matched template, a theme matching score corresponding to the first to-be-matched template is determined.
[0021] In this way, the theme matching score of the template to be matched is determined according to the matching degree between the template theme corresponding to the template and the material to be edited, so as to quantify the theme matching degree between the template to be matched and the material to be edited, so that the theme of the final recommended template and the material selected by the user can be more closely matched, so that the finished film effect matches the style of the material content, further improving the user experience.
[0022] Optionally, in yet another possible implementation manner of the first aspect, the i-th preset matching index is a frame matching index, and the i-th matching score is a frame matching score; accordingly, 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:
[0023] Performing initial editing processing on the material to be edited using the first template to be matched, so as to determine an initial finished film corresponding to the material to be edited;
[0024] Obtaining each initial segment included in the initial film and the segment duration corresponding to each initial segment;
[0025] Determine the frame ratio corresponding to the effective display area in each initial segment;
[0026] The frame matching score corresponding to the first template to be matched is determined according to the frame ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment.
[0027] In this way, the template to be matched is used to perform initial editing on the material to be edited to generate an initial film, and the frame matching score between the template to be matched and the material to be edited is determined according to the frame ratio and segment length corresponding to the priority display area in each segment in the initial film, so as to quantify the frame matching degree between the template to be matched and the material to be edited, so that when the user mixes and selects materials with multiple frame ratios, a template with better frame matching can be matched, so that the material content can fill the film screen as much as possible, and the proportion of non-effective display areas such as Gaussian effect or black border effect in the film can be reduced as much as possible, thereby further improving the editing beauty of the film and further improving the user experience.
[0028] Optionally, in yet another possible implementation manner of the first aspect, the i-th preset matching index is a material ratio index, and the i-th matching score is a material ratio matching score; accordingly, 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:
[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 according to the number of videos and images contained in the material to be edited;
[0031] According to the material ratio corresponding to the to-be-edited material and the material type corresponding to the first to-be-matched template, a material ratio matching score corresponding to the first to-be-matched template is determined.
[0032] In this way, since some templates in the template library are more suitable for video materials and some are more suitable for image materials, the material ratio is determined according to the number of videos and images contained in the material to be edited, and the material ratio matching score between the template to be matched and the material to be edited is determined according to the material ratio and the material type suitable for the template to be matched. In this way, the degree of material type matching between the template to be matched and the material to be edited is quantified, so that the final recommended template can better match the material type selected by the user, improve the film-making effect of more materials as much as possible, and further enhance the user experience.
[0033] Optionally, in another possible implementation manner of the first aspect, the i-th preset matching index is a pit position matching index, and the i-th matching score is a pit position matching score; accordingly, 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:
[0034] Get the number of materials contained in the material to be edited;
[0035] Obtain the number of slots contained in the first to-be-matched template, the duration of each slot, and the total duration of the template;
[0036] Performing initial editing processing on the material to be edited using the first template to be matched, so as to generate an initial finished film corresponding to the material to be edited;
[0037] Obtaining the total duration of the initial film and the duration of each initial segment included in the initial film;
[0038] Determine the matching degree of the number of slots corresponding to the first template to be matched according to the number of materials and the number of slots;
[0039] Determine the total duration matching degree corresponding to the first template to be matched according to the total duration of the film and the total duration of the template;
[0040] Determine the pit duration matching degree corresponding to the first to-be-matched template according to the pit duration of each pit and the duration of each segment;
[0041] According to the pit quantity matching degree, total duration matching degree and pit duration matching degree, the pit matching score corresponding to the first template to be matched is determined.
[0042] In this way, since the template can contain multiple positions, there can be editing effects such as music rhythm points and template transitions between adjacent positions to improve the diversity and richness of the material editing effects. Therefore, the template to be matched can be used to perform initial editing on the material to be edited, and the matching degree of the number of positions, the duration of the positions and the total duration between the template to be matched and the material to be edited can be determined to quantify the degree of position matching between the template to be matched and the material to be edited, so that the music rhythm points, template transitions, etc. of the final recommended template are more applicable to the material selected by the user, further improving the editing effect of the film and the user experience.
[0043] Optionally, in another possible implementation of the first aspect, determining the pit position matching score corresponding to the first to-be-matched template according to the pit position quantity matching degree, the total duration matching degree, and the pit position duration matching degree includes:
[0044] Obtain the card point type corresponding to the first template to be matched;
[0045] The pit matching score is determined based on the pit quantity matching, total duration matching, pit duration matching and checkpoint type.
[0046] In this way, by referring to the card point type of the template to be matched when determining the pit matching score, different pit matching scores can be set for different card point types, so that the card point type of the final recommended template is more closely matched with the material selected by the user, thereby further improving the rhythm card points and template transition effects of the film, and further improving the user experience.
[0047] Optionally, in yet another possible implementation of the first aspect, the i-th preset matching indicator is a download type indicator, and the i-th matching score is a download score; accordingly, 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:
[0048] Obtaining a download type corresponding to the first template to be matched, wherein the download type includes a local template and an online template;
[0049] According to the download type, a download score corresponding to the first template to be matched is determined.
[0050] In this way, by determining the download score corresponding to the template to be matched according to the download type corresponding to the template to be matched, the local template or online template can be given a higher score according to actual needs, so that the local template or online template is easier to recommend to the user, thereby further improving the flexibility of template matching.
[0051] Optionally, in yet another possible implementation of the first aspect, determining the download score corresponding to the first to-be-matched template according to the download type includes:
[0052] When the download type corresponding to the first template to be matched is an online template, the download score is determined to be 0;
[0053] When 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 to be 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 the local template, the local template is more easily recommended to the user, so as to reduce the traffic consumption of the user downloading the template as much as possible 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] It is determined that the number of templates of the download type local template contained in the template library is greater than the quantity threshold.
[0057] Optionally, in another possible implementation of the first aspect, the i-th preset matching indicator is an operation indicator, and the i-th matching score is an operation matching score; accordingly, 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:
[0058] Obtaining the operation type corresponding to the first template to be matched;
[0059] According to the operation type, an operation matching score corresponding to the first template to be matched is determined.
[0060] Optionally, in yet another possible implementation of the first aspect, determining the operation matching score corresponding to the first template to be matched according to 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 be determined as the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0062] When the operation type is not the preset operation type, the operation matching score is determined to be 0.
[0063] In this way, by determining the operation matching score corresponding to the template to be matched according to the operation type corresponding to the template to be matched, the template to be matched that needs to be promoted can be given a higher score according to actual needs, so that the template to be matched that needs to be promoted can be easier to recommend to users, thereby further improving the flexibility of template matching.
[0064] Optionally, in yet 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 a target matching score corresponding to each template to be matched, the method further includes:
[0065] Obtain M historical templates used by the user and the most recent use time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0066] Determine the suppression score corresponding to each historical template according to the most recent use time of each historical template;
[0067] According to the suppression scores corresponding to the historical templates, the target matching scores corresponding to the historical templates are corrected respectively.
[0068] In this way, by suppressing the scores of historical templates that the user has used recently, templates that the user has not used can be more easily recommended to the user, so as to improve the richness and freshness of the templates recommended to the user, thereby further improving the richness and freshness of the film editing effects and further improving the user experience.
[0069] Optionally, in yet another possible implementation of the first aspect, selecting at least one template to be matched as a target template corresponding to the material to be edited according to the target matching score corresponding to each template to be matched includes:
[0070] According to the target matching score corresponding to each to-be-matched template, K to-be-matched templates with the highest target matching scores are selected 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 the user for selection, not only the reliability of template matching is improved, but also the interactivity of template recommendation is improved, thereby meeting the personalized needs of the user.
[0072] Optionally, in another possible implementation manner of the first aspect, the target matching scores corresponding to the K target templates are different from each other.
[0073] In this way, through the equal distribution and deduplication mechanism, the styles and effects of the templates finally recommended to users are different to a certain extent, so as to expand the user's choice range, which not only further improves the reliability of template matching, but also further meets the user's personalized needs.
[0074] In the second aspect, an embodiment of the present application provides a template matching device for material editing, including: a first acquisition module, used to obtain at least one material to be edited selected by a user, wherein the material to be edited includes at least one of a video and an image; a second acquisition module, used to perform theme recognition on the material to be edited according to each template theme contained in the template library, so as to obtain multiple templates to be matched from the template library; a first determination module, 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 a target matching score corresponding to each template to be matched; a first selection module, used 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 a possible implementation manner of the second aspect, the second acquisition module includes:
[0076] A first determination unit is used to perform theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and each template theme;
[0077] A second determining unit is used to determine the to-be-matched template theme corresponding to the to-be-edited material according to the matching degree between the to-be-edited material and each template theme;
[0078] The third determining unit is used to determine each template in the template library whose template theme is the theme of the template to be matched as the template to be matched.
[0079] Optionally, in another possible implementation of the second aspect, the number of the preset matching indicators is N, where N is a positive integer; accordingly, the first determining module includes:
[0080] a fourth determining unit, configured to match 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, wherein the first template to be matched is any template to be matched, and 1≤i≤N;
[0081] The fifth determining unit is used to determine a target matching score corresponding to the first template to be matched according to the N matching scores corresponding to the first template to be matched.
[0082] Optionally, in another possible implementation of the second aspect, the preset matching index includes at least one of the following indicators: a frame matching index, a material type index, a slot matching index, a download type index, and an operation index.
[0083] Optionally, in yet 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; accordingly, the fourth determining unit is specifically configured to:
[0084] Performing theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and the template theme corresponding to the first template to be matched;
[0085] According to the matching degree between the to-be-edited material and the template theme corresponding to the first to-be-matched template, a theme matching score corresponding to the first to-be-matched template is determined.
[0086] Optionally, in yet another possible implementation manner 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; accordingly, the fourth determining unit is further configured to:
[0087] Performing initial editing processing on the material to be edited using the first template to be matched, so as to determine an initial finished film corresponding to the material to be edited;
[0088] Obtaining each initial segment included in the initial film and the segment duration corresponding to each initial segment;
[0089] Determine the frame ratio corresponding to the effective display area in each initial segment;
[0090] The frame matching score corresponding to the first template to be matched is determined according to the frame ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment.
[0091] Optionally, in yet another possible implementation manner 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; accordingly, the fourth determining unit is further configured to:
[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 according to the number of videos and images contained in the material to be edited;
[0094] According to the material ratio corresponding to the to-be-edited material and the material type corresponding to the first to-be-matched template, a material ratio matching score corresponding to the first to-be-matched template is determined.
[0095] Optionally, in another possible implementation manner of the second aspect, the i-th preset matching index is a pit position matching index, and the i-th matching score is a pit position matching score; accordingly, the fourth determining unit is further used to:
[0096] Get the number of materials contained in the material to be edited;
[0097] Obtain the number of slots contained in the first to-be-matched template, the duration of each slot, and the total duration of the template;
[0098] Performing initial editing processing on the material to be edited using the first template to be matched, so as to generate an initial finished film corresponding to the material to be edited;
[0099] Obtaining the total duration of the initial film and the duration of each initial segment included in the initial film;
[0100] Determine the matching degree of the number of slots corresponding to the first template to be matched according to the number of materials and the number of slots;
[0101] Determine the total duration matching degree corresponding to the first template to be matched according to the total duration of the film and the total duration of the template;
[0102] Determine the pit duration matching degree corresponding to the first to-be-matched template according to the pit duration of each pit and the duration of each segment;
[0103] According to the pit quantity matching degree, total duration matching degree and pit duration matching degree, the pit matching score corresponding to the first template to be matched is determined.
[0104] Optionally, in yet another possible implementation manner of the second aspect, the fourth determining unit is further configured to:
[0105] Obtain the card point type corresponding to the first template to be matched;
[0106] The pit matching score is determined based on the pit quantity matching, total duration matching, pit duration matching and checkpoint type.
[0107] Optionally, in yet 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; accordingly, the fourth determining unit is further configured to:
[0108] Obtaining a download type corresponding to the first template to be matched, wherein the download type includes a local template and an online template;
[0109] According to the download type, a download score corresponding to the first template to be matched is determined.
[0110] Optionally, in yet another possible implementation manner of the second aspect, the fourth determining unit is further configured to:
[0111] When the download type corresponding to the first template to be matched is an online template, the download score is determined to be 0;
[0112] When 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 to be 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 manner of the second aspect, the fourth determining unit is further configured to:
[0114] It is determined that the number of templates of the download type local template contained in the template library is greater than the quantity threshold.
[0115] Optionally, in another possible implementation manner of the second aspect, the i-th preset matching indicator is an operation indicator, and the i-th matching score is an operation matching score; accordingly, the fourth determining unit is further used to:
[0116] Obtaining the operation type corresponding to the first template to be matched;
[0117] According to the operation type, an operation matching score corresponding to the first template to be matched is determined.
[0118] Optionally, in yet another possible implementation manner 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 be determined as the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0120] When the operation type is not the preset operation type, the operation matching score is determined to be 0.
[0121] Optionally, in yet another possible implementation of the second aspect, the apparatus further includes:
[0122] A third acquisition module is used to acquire M historical templates used by the user and the most recent use time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0123] A second determination module is used to determine the suppression score corresponding to each historical template according to the most recent use time of each historical template;
[0124] The first correction module is used to correct the target matching score corresponding to each historical template according to the suppression score corresponding to each historical template.
[0125] Optionally, in yet another possible implementation of the second aspect, the first selection module includes:
[0126] The first selection unit is used to select K to-be-matched templates with the highest target matching scores as target templates according to the target matching scores corresponding to each to-be-matched template, where K is a positive integer.
[0127] Optionally, in another possible implementation manner of the second aspect, the target matching scores corresponding to the K target templates are different from each other.
[0128] In a third aspect, an embodiment of the present application provides an electronic device, comprising: 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 clipping as described above.
[0129] In a fourth aspect, an embodiment of the present application provides 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 clipping as described above.
[0130] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the template matching method for material clipping as described above.
[0131] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first and second aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0132] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0133] Figure 1 It is a flowchart of a template matching method for material editing provided by an embodiment of the present application;
[0134] Figure 2 is a flow chart of a template matching method for material editing provided by another embodiment of the present application;
[0135] Figure 3 is a flow chart of a template matching method for material editing provided in yet another embodiment of the present application;
[0136] Figure 4 It is a structural schematic diagram of a template matching device for material editing provided by an embodiment of the present application;
[0137] Figure 5 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0138] The template matching method, device, electronic device, storage medium and computer program for material clipping provided by the present application are described in detail below with reference to the accompanying drawings.
[0139] Please refer to Figure 1 , Figure 1 : is a flow chart of a template matching method for material clipping provided by an embodiment of the present application. The method may include part or all of the following contents:
[0140] Step 101: Obtain at least one material to be edited selected by a user, wherein the material to be edited includes at least one of a video and an image.
[0141] It should be noted that the template matching method for material editing in the embodiment of the present application can be applied in any material editing scenario. For example, it can be applied in any editing application to realize the automatic template recommendation function when the user edits the material. Among them, the editing software mentioned in the embodiment of the present application can refer to the editing function of the gallery application in the electronic device, or the editing application associated with the gallery application of the electronic device; or, it can also be a third-party editing application installed in the electronic device, which is not limited in the embodiment of the present application.
[0142] The material to be edited may refer to any material selected, input or uploaded by the user.
[0143] It should be noted that the material to be edited may include at least one of a video and an image. That is, when editing materials, the user may select one or more videos as the material to be edited, or may select one or more images as the material to be edited, or may select at least one video and at least one image as the material to be edited for mixed editing. In actual use, the user may select the material to be edited as the material to be edited according to actual needs, and the embodiment of the present application does not limit the type of the material to be edited.
[0144] In an embodiment of the present application, after the user selects or uploads the material to be edited and triggers the editing function of the editing application, it is determined that the material selected by the user is obtained and the material selected by the user is determined as the material to be edited.
[0145] As an example, when the template matching method for material clipping in the embodiment of the present application is applied to the clipping function of a gallery application, after the user selects at least one material from the gallery and triggers the editing or clipping controls corresponding to the selected material, it can be determined that the material to be clipped selected by the user is obtained.
[0146] As an example, when the template matching method for material clipping of an embodiment of the present application is applied to a third-party editing application in an electronic device, when the user opens the editing application, selects one or more materials from the gallery and uploads them to the third-party editing application, it can be determined that the material to be edited selected by the user is obtained.
[0147] It should be noted that the above examples are only exemplary and cannot be regarded as limiting the present application. In actual use, the acquisition method of the material to be edited can be determined according to actual needs and specific application scenarios, and the present application embodiment does not limit this.
[0148] Step 102: subject identification is performed on the material to be edited according to each template subject contained in the template library, so as to obtain a plurality of templates to be matched from the template library.
[0149] The template theme may refer to the various theme categories contained in the template library after the templates in the template library are classified according to the themes corresponding to the templates. For example, the templates in the template library are divided into themes such as childishness, characters, food, travel, ancient buildings, night views, nature, leisure, dynamic rhythm, relaxed and cheerful, and slightly sad. That is, the template library contains template themes such as childishness, characters, food, travel, ancient buildings, night views, nature, leisure, dynamic rhythm, relaxed and cheerful, and slightly sad.
[0150] The template to be matched may refer to a template in the template library whose theme matches the theme of the material to be edited.
[0151] In the embodiment of the present application, in order to save computing resources during template matching and improve the efficiency of template matching, the subject recognition can be first performed on the material to be edited, so as to preliminarily screen out templates that match the subject of the material to be edited from the template library, and only perform subsequent matching processing on the screened out templates that match the subject, thereby removing a large number of irrelevant templates in the template library through subject matching, saving computing resources for template matching. Specifically, each template subject contained in the template library can be used as a priori subject label, and a subject recognition algorithm can be used to perform subject recognition on each material to be edited to determine the template subject that matches the material to be edited, and then the template corresponding to the template subject that matches the material to be edited in the template library is determined as the template to be matched.
[0152] It should be noted that when there are multiple template themes that match the material to be edited, the templates corresponding to the multiple template themes can all be determined as templates to be matched. For example, if the template themes that match the material to be edited are childishness and characters, all templates in the template library with the template theme of childishness and the template theme of characters can be determined as templates to be matched.
[0153] Furthermore, the template to be matched corresponding to the material to be edited can be determined according to the matching degree between the material to be edited and each template theme, so as to reduce the calculation amount of subsequent template matching, improve the efficiency of template matching, and improve the accuracy of theme matching. That is, in a possible implementation of the embodiment of the present application, the above step 102 may include:
[0154] Performing theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and each template theme;
[0155] Determine the template theme to be matched corresponding to the material to be edited according to the matching degree between the material to be edited and each template theme;
[0156] Each template in the template library whose template theme is the theme of the template to be matched is determined as the template to be matched.
[0157] The degree of match between the material to be edited and the template theme may refer to the degree of confidence between the material to be edited and the template theme output by the theme recognition model.
[0158] In an embodiment of the present application, a theme recognition model can be used to perform theme recognition on the material to be edited to determine the degree of match between the material to be edited and each template theme, and then based on the degree of match between the material to be edited and each template theme, one or more template themes with a high degree of match are determined as the template themes to be matched corresponding to the material to be edited.
[0159] As a possible implementation method, if the user selects one material to be edited, the theme of the material to be edited can be identified, and the matching degree between the material to be edited and each template theme can be determined, and one or more template themes with the greatest matching degree can be determined as the template themes to be matched; or, one or more template themes with a matching degree greater than or equal to a matching degree threshold can be determined as the template themes to be matched.
[0160] For example, assuming that the template library contains three template themes: childishness, characters, and food, the matching degree between the material to be edited and "childishness" is 0.95, the matching degree between it and "characters" is 0.85, and the matching degree between it and "food" is 0.3; thus, the template themes with the greatest matching degree (i.e., "childishness") or two (i.e., "childishness" and "characters") can be determined as the template themes to be matched; for example, when selecting the template themes to be matched according to the matching degree threshold, assuming the matching degree threshold is 0.8, then "childishness" and "characters" can be determined as the template themes to be matched.
[0161] As a possible implementation method, if the user selects multiple materials to be edited, the theme identification can be performed on each material to be edited in turn to determine the matching degree between each material to be edited and each template theme; then, for one material to be edited, the template theme with the greatest matching degree corresponding to it can be determined as its corresponding template theme; after determining the template theme corresponding to each material to be edited, the template themes corresponding to each material to be edited can be determined as the template themes to be matched; the matching degrees between each material to be edited and the corresponding template themes can also be sorted, and one or more template themes with the greatest matching degree can be determined as the template themes to be matched; or, the template themes corresponding to each material to be edited whose matching degree is greater than or equal to the matching degree threshold can be determined as the template themes to be matched.
[0162] For example, assuming that the materials to be edited include three materials, material A, material B, and material C, the template theme corresponding to material A is "childishness", and the matching degree is 0.95, the template theme corresponding to material B is "character", and the matching degree is 0.85, and the template theme corresponding to material C is "food", and the matching degree is 0.9; then "childishness", "character" and "food" can all be determined as template themes to be matched; or, the two template themes with the largest matching degrees (namely "childishness" and "food") can also be determined as template themes to be matched; or, the template theme to be matched can also be determined according to the matching degree threshold. For example, if the matching degree threshold is 0.8, then "childishness", "character" and "food" can all be determined as template themes to be matched.
[0163] As a possible implementation method, if the user selects multiple materials to be edited, the theme recognition algorithm can be used to perform comprehensive theme recognition on the multiple materials to be edited, so as to directly output the template themes that are commonly matched by each material to be edited, and output the matching degree corresponding to each commonly matched template themes; after that, each commonly matched template theme can be directly determined as the template theme to be matched; one or more template themes with the greatest matching degree among each commonly matched template themes can also be determined as the template theme to be matched; one or more template themes with a matching degree greater than or equal to a matching degree threshold among each commonly matched template themes can also be determined as the template theme to be matched.
[0164] For example, assuming that the materials to be edited include material A, material B, and material C, and comprehensive theme identification is performed on the three materials, it is determined that the matching degrees between these three materials and the template themes "childhood fun", "characters" and "food" are 0.95, 0.85 and 0.3 respectively. Then, the template themes with the greatest matching degree (i.e., "childhood fun") or two (i.e., "childhood fun" and "characters") can be determined as the template themes to be matched; for example, when selecting the template themes to be matched according to the matching degree threshold, assuming the matching degree threshold is 0.8, then "childhood fun" and "characters" can be determined 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 subject recognition model to perform subject recognition on the image; if the material to be edited is a video, the video can be first subjected to frame extraction, and one or more extracted video frames can be input into the subject recognition model to perform subject recognition on the video; when comprehensive subject recognition is performed on multiple materials to be edited, the frame extraction results corresponding to each image and each video included in the material to be edited can also be input into the subject video model together to perform comprehensive subject recognition. Among them, the frame extraction method of the embodiment of the present application can be determined according to actual needs and specific scenarios, and the embodiment of the present application does not limit this. For example, uniform frame extraction can be performed according to a certain step size.
[0166] It should be noted that the topic recognition model used in the embodiment of the present application 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 the embodiment of the present application does not limit this. In addition, the embodiment of the present application determines the theme of the template to be matched and the method of the template to be matched based on the degree of match between the material to be edited and each template theme, which may include but is not limited to the situations listed above; and the above-mentioned matching degree threshold can also be set according to actual needs, and the embodiment of the present application does not limit this.
[0167] Step 103 : Match each template to be matched with the material to be edited according to at least one preset matching index to determine a target matching score corresponding to each template to be matched.
[0168] In the embodiment of the present application, after selecting the template to be matched that matches the theme of the material to be edited, each template to be matched can be matched with the material to be edited according to one or more preset matching indicators to determine the matching score corresponding to each template to be matched under the preset matching indicators, and then determine the target matching score corresponding to each template to be matched according to the matching score corresponding to each template to be matched under each preset matching indicator. Thus, by evaluating the matching degree between the template to be matched and the material to be edited from multiple evaluation dimensions, and quantifying the matching degree between the template to be matched and the material to be edited by the matching score, the reliability of template matching is improved and the editing effect of the film is guaranteed.
[0169] Furthermore, the scores of the historical templates recently used by the user can be suppressed, so that the templates that the user has not used are more easily recommended to the user, so as to improve the richness and freshness of the templates recommended to the user, thereby further improving the richness and freshness of the film editing effect, and further improving the user's experience. That is, in a possible implementation of the embodiment of the present application, after the above step 103, it can also include:
[0170] Obtain M historical templates used by the user and the most recent use time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0171] Determine the suppression score corresponding to each historical template according to the most recent use time of each historical template;
[0172] According to the suppression scores corresponding to the historical templates, the target matching scores corresponding to the historical templates are corrected respectively.
[0173] The historical template may be a template that the user has recently used, determined based on the user's recent editing records. The number M of historical templates may be determined based on actual needs, and the present application embodiment does not limit this. For example, 25, 30, etc.
[0174] The most recent use time of the historical template may refer to the time when the user last used the historical template.
[0175] As a possible implementation, the number M of historical templates can be determined according to the number of templates to be matched. For example, the ratio of the number M of historical templates 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 the embodiments of the present application do not limit this. For example, the preset ratio threshold can be 20%.
[0176] In an embodiment of the application, based on the recent editing records of the user currently performing the editing operation, the M templates that have been used most recently 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 respectively, and based on the suppression score, the target matching score corresponding to each historical model can be score-suppressed respectively, so that the final target matching score of the historical template used most recently by the user is lower, and thus it is not easy to be recommended to the user, so as to improve the richness and freshness of the recommended templates.
[0177] As a possible implementation, the suppression scores corresponding to the historical templates may increase linearly from far to near according to their corresponding most recent use times, that is, the historical templates whose most recent use times are closer to the current time have higher suppression scores.
[0178] As a possible implementation method, the H historical templates that the user has used recently can also be strongly suppressed, that is, these H historical templates are given higher suppression scores, and the suppression scores corresponding to these H historical templates can be increased from far to near according to their corresponding recent use time; the suppression scores of other MH historical templates can be determined according to the principle of linear growth from far to near according to the recent use time. Among them, H is a positive integer less than M, for example, M is 25, and H can be 5.
[0179] For example, assuming that M is 25 and H is 5, the five most recently used history templates are strongly suppressed. According to the most recent use time, the suppression scores of these five history templates can be 100, 80, 60, 50, and 40 respectively. The suppression scores of the other 20 history templates can be determined according to the principle of linear growth from the most recent use time. For example, the initial score is 30 points. For each additional day between the most recent use time and the current time, the suppression score can be reduced by 1 score step. For example, the score step can be 1 point, 2 points, 3 points, etc.
[0180] It should be noted that the above examples are only exemplary and cannot be regarded as limiting the present 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, and the present application embodiment does not limit this.
[0181] In an embodiment of the present application, after determining the suppression scores 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 manner, the final target matching scores of all historical templates can be determined.
[0182] As a possible implementation method, in order to further save computing resources and further improve the freshness of recommended templates, when selecting the template to be matched, M historical templates can be directly removed, that is, the template to be matched determined according to the topic matching does not include these M historical templates; if a suitable template can be selected from the template 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 template to be matched for recommendation, then the M historical templates can be obtained again and the target matching scores corresponding to the M historical templates can be determined in the manner described in the previous steps, and then the target matching scores corresponding to the historical templates can be corrected according to the score suppression rules in the above manner, and then each historical template can be assumed to be a template to be matched, so that in subsequent recommendations, the historical templates and each template to be matched can be comprehensively combined for template recommendation.
[0183] Step 104 : selecting at least one template to be matched as a target template corresponding to the material to be edited according to the target matching score corresponding to each template to be matched.
[0184] In the embodiment of the present application, after determining the target matching scores corresponding to the templates to be matched, one or more templates to be matched with higher target matching scores may be determined as target templates corresponding to the material to be edited.
[0185] As a possible implementation, K templates to be matched with the highest target matching scores can be selected as target templates according to the target matching scores corresponding to each template to be matched, where K is a positive integer. Thus, one or more templates with the highest target matching scores are recommended to the user for selection, thereby improving not only the reliability of template matching, but also the interactivity of template recommendation, thus meeting the personalized needs of users.
[0186] As a possible implementation, a target template may be selected from the templates to be matched by using a preset score threshold. For example, a template to be matched whose target matching score is greater than a preset score threshold may be determined as the target template.
[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 the embodiments of the present application do not limit this.
[0188] Furthermore, the templates finally recommended to the user may have certain differences in style, effect, etc. through an equal distribution and deduplication mechanism, so as to expand the user's selection range, thereby not only further improving the reliability of template matching, but also further meeting the user's personalized needs. That is, in a possible implementation of the embodiment of the present application, the target matching scores corresponding to the above K target templates are different from each other.
[0189] As a possible implementation method, 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 meet the score requirements, one can be randomly selected from the multiple templates to be matched with the same target matching score 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 that the value of K is 5, and the numbers of templates to be matched corresponding to the five target matching scores with the highest scores are 3, 2, 2, 3, and 1 respectively, then one can be randomly selected from the five templates to be matched with the highest target matching scores as the target template, one can be randomly selected from the two templates to be matched with the second highest target matching scores as the target template, one can be randomly selected from the two templates to be matched with the third highest target matching scores as the target template, one can be randomly selected from the three templates to be matched with the fourth highest target matching score as the target template, and the template to be matched with the fifth highest target matching score can be determined as the target template, thereby determining a total of five target templates.
[0191] As a possible implementation method, when selecting the target template through a preset score threshold, for the to-be-matched templates with the same target matching score and greater than the preset score threshold, the above-mentioned equal division deduplication mechanism can also be used to randomly select one of the to-be-matched templates with the same target matching score as the target template, which will not be repeated here.
[0192] The template matching method for material editing provided in the embodiment of the present application first selects a template to be matched that matches the theme of the material to be edited through theme recognition, and then judges the matching degree between the template to be matched and the material to be edited from multiple evaluation dimensions based on at least one preset matching index, and selects a suitable target template based on the matching degree between the template to be matched and the material to be edited to recommend to the user, thereby improving the matching degree between the recommended template and the material selected by the user, improving the filming effect, and improving the user experience.
[0193] Please refer to Figure 2 , Figure 2 : is a flow chart of a template matching method for material clipping provided by another embodiment of the present application, and the method may include part or all of the following contents:
[0194] Step 201: Obtain at least one material to be edited selected by a user, wherein the material to be edited includes at least one of a video and an image.
[0195] Step 202: subject identification is performed on the material to be edited according to each template subject contained in the template library, so as to obtain a plurality of templates to be matched from the template library.
[0196] The specific implementation process and principle of the above steps 201-202 can refer to the detailed description of the above embodiment, which will not be repeated here.
[0197] Step 203, 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, wherein the first template to be matched is any template to be matched, 1≤i≤N.
[0198] In an embodiment of the present application, when the degree of match between the template to be matched and the material to be edited is measured by 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 in turn according to the N preset matching indicators, so as to respectively determine the matching scores between the first template to be matched and the material to be edited under the N preset matching indicators, i.e., the N matching scores corresponding to the first template to be matched, and these N matching scores can quantify the degree of match between the first template to be matched and the material to be edited in these N evaluation dimensions. In the same manner as above, each template to be matched is taken as the first template to be matched in turn, and then the N matching scores corresponding to each template to be matched can be determined. Wherein, N is a positive integer.
[0199] Furthermore, the matching template and the material to be edited can be matched in theme, frame, material type, and frame through the theme matching index, frame matching index, material type index, frame matching index, download type index, and operation index, and the matching templates of specific download types and specific operation types can be promoted, so that the recommended template and the material selected by the user have a high degree of matching in terms of theme, frame ratio, material type, frame, download type, and operation type, thereby further improving the reliability of template matching, further improving the aesthetics of the finished film, and further improving the user experience. As a possible implementation method, the above-mentioned preset matching index may include at least one of the following indicators: theme matching index, frame matching index, material type index, frame matching index, download type index, and operation index.
[0200] Among them, the theme matching index can be used to measure the theme matching degree between the template to be matched and the material to be edited.
[0201] As a possible implementation, the preset matching index includes a theme matching index, and when the first template to be matched and the material to be edited are matched according to the theme matching index, a theme matching score corresponding to the first template to be matched can be generated. That is, in a possible implementation of the embodiment of the present application, the i-th preset matching index is the theme matching index, and the i-th matching score is the theme matching score; accordingly, the above step 203 may include:
[0202] Performing theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and the template theme corresponding to the first template to be matched;
[0203] According to the matching degree between the to-be-edited material and the template theme corresponding to the first to-be-matched template, a theme matching score corresponding to the first to-be-matched template is determined.
[0204] As a possible implementation method, according to the description of the aforementioned embodiment, when matching the material to be edited with the template themes in the template library through theme recognition, not only the template theme that matches the material to be edited can be output, but also the matching degree corresponding to the template theme that matches the material to be edited can be output; and the theme corresponding to the template to be matched must be the theme that matches the material to be edited. Therefore, the matching degree between the material 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 material to be edited; and, since the matching degree between the material to be edited and the template theme corresponding to the first template to be matched can directly reflect the theme matching degree between the material to be edited and the first template to be matched, therefore, the theme matching score corresponding to the first template to be matched can be determined based on the matching degree between the material to be edited and the template theme corresponding to the first template to be matched, so as to quantify it by the theme matching degree between the first template to be matched and the material to be edited.
[0205] As an example, one or more subject matching thresholds may be preset, and the subject matching score corresponding to the first template to be matched may be determined based on the relationship between the matching degree between the material to be edited and the template subject corresponding to the first template to be matched and each subject matching threshold. For example, a first theme matching threshold and a second theme matching threshold may 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 may 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 may 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, and greater than or equal to the second theme matching threshold, it may 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 may 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 may be determined that the material to be edited and the template theme corresponding to the first template to be matched do not match, and the theme matching score corresponding to the first template to be matched may be determined as the third theme score (e.g., -99 points).
[0206] For example, assuming that the matching degree between the material to be edited and the template theme "childhood fun" is 0.95, the matching degree between the material to be edited and the template theme "character" is 0.85, the first theme matching threshold is 0.9, the second theme matching threshold is 0.8, the first theme score is 30 points, and the second theme score is 0 point; assuming that the template theme corresponding to the first template to be matched is "childhood fun", since the matching degree between the material to be edited and the template theme "childhood fun" is greater than the first theme matching threshold of 0.9, it can be determined that the theme matching score corresponding to the first template to be matched is 30 points; assuming that the template theme corresponding to the first template to be matched is "character", since the matching degree between the material to be edited and the template theme "character" is less than the first theme matching threshold and greater than the second theme matching threshold, it can be determined that the theme matching score corresponding to the first template to be matched is 0 point.
[0207] It should be noted that, when determining the template to be matched in step 202, the template themes that do not match the material to be edited are usually excluded, so the template to be matched may not include the template that does not match the theme of the material to be edited, that is, the template that does not match the theme of the material to be edited does not participate in the calculation of the matching score in step 203. Therefore, when determining the theme matching score corresponding to the first template to be matched by 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 the template with the theme matching score of the third theme score has been removed before step 203.
[0208] It should be noted that the above examples are only exemplary and cannot be regarded as limitations of the present 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, and the present application embodiment does not limit this.
[0209] Through the above analysis, the embodiment of the present application determines the theme matching score of the template to be matched according to the matching degree between the template theme corresponding to the template and the material to be edited, so as to quantify the theme matching degree between the template to be matched and the material to be edited, so that the theme of the final recommended template is more closely matched with the material selected by the user, thereby matching the style of the film effect with the content of the material, further improving the user experience.
[0210] As a possible implementation, the preset matching index includes a frame matching index, and when the first template to be matched and the material to be edited are matched according to the frame matching index, a frame matching score corresponding to the first template to be matched can be generated. That is, in a possible implementation of the embodiment of the present application, the i-th preset matching index is the frame matching index, and the i-th matching score is the frame matching score; accordingly, the above step 203 may include:
[0211] Performing initial editing processing on the material to be edited using the first template to be matched, so as to determine an initial finished film corresponding to the material to be edited;
[0212] Obtaining each initial segment included in the initial film and the segment duration corresponding to each initial segment;
[0213] Determine the frame ratio corresponding to the effective display area in each initial segment;
[0214] The frame matching score corresponding to the first template to be matched is determined according to the frame ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment.
[0215] Among them, the frame matching index can be used to measure the matching degree of the frame ratio between the template to be matched and the material to be edited.
[0216] The frame matching score can be used to quantify the frame matching degree between the template to be matched and the material to be edited. That is, the higher the frame matching score corresponding to the first template to be matched, the higher the frame matching degree between the first template to be matched and the material to be edited.
[0217] The initial film may refer to a film generated by preliminarily editing the material to be edited using the first template to be matched.
[0218] The effective display area may refer to the display area corresponding to the material content in the initial segment. It should be noted that the display area other than the effective display area in the initial segment is the ineffective display area; the ineffective display area may refer to the Gaussian blur area or the black border area generated by applying the Gaussian blur effect or the black border effect to the area where the material content cannot be displayed.
[0219] The frame ratio corresponding to the effective display area may refer to the area ratio of the effective display area in the initial segment in which it is located. For example, if the area of the entire display area corresponding to the initial segment A is n, and the frame ratio corresponding to the initial segment A is m, then the frame ratio corresponding to the effective display area in the initial segment A may be determined to be m / n.
[0220] In an embodiment of the present application, since the frame size of the template to be matched may be different from the frame size of the material to be edited selected by the user, the unfilled area of the material content will be filled by Gaussian blur effect or black border effect during editing; and when the user selects multiple materials to be edited, the frame sizes and proportions of each material to be edited may also be different. Therefore, after using the template to edit each material to be edited and generate a finished film, the frame ratios of the effective display areas corresponding to the material content in each segment of the finished film may also be different. Therefore, when determining the frame matching score corresponding to the first template to be matched, the first template to be matched can be first used to perform initial editing processing on the material to be edited to generate an initial finished film, and then the frame matching score corresponding to the first template to be matched is determined according to the frame ratios of the effective display areas corresponding to each initial segment in the initial finished film and the segment lengths of each initial segment.
[0221] As a possible implementation method, after determining the segment duration corresponding to each initial segment in the initial film and the frame ratio corresponding to the effective display area in each initial segment, the product of the segment duration corresponding to each initial segment and the frame ratio corresponding to it can be determined, and then the obtained products are added to obtain the sum of the products; then, the sum of the segment durations corresponding to the initial segments (that is, the total duration of the initial film) is determined; then the ratio of the sum of the above products to the sum of the segment durations corresponding to the initial segments is determined; finally, the frame matching score corresponding to the first template to be matched is determined according to the above ratio.
[0222] As a possible implementation method, since users usually pay more attention to the first end of the film, the editing effect of the first clip in the film has a greater impact on user satisfaction. Therefore, when determining the frame matching score corresponding to the first template to be matched, the first initial clip can be given a greater weight, so that the final recommended template can be more inclined to select the template with a better editing effect of the first clip, so as to further improve the editing effect of the film and further improve the user experience. For example, when calculating the frame matching score corresponding to the first template to be matched, the clip length corresponding to the first initial clip can be determined as the product of the actual clip length corresponding to the first initial clip and the preset weight w, where the preset weight w is greater than 1. For example, the preset weight can be 1.5, that is, the clip length corresponding to the first initial clip used when calculating the frame matching score is 1.5 times the actual clip length corresponding to the first initial clip.
[0223] It should be noted that the above examples are only exemplary and cannot be regarded as limiting the present application. In actual use, the specific values of the above preset weights can be determined according to actual needs and specific application scenarios, and the present application embodiment does not limit this.
[0224] As a possible implementation, in some editing scenes, when the first template to be matched is used to perform initial editing on the editing material to generate the initial film, the display effect of the initial segment whose frame ratio corresponding to the effective display area exceeds the preset frame ratio threshold (that is, the frame ratio corresponding to the effective display area is large) may be optimized, that is, the effective display area fills the entire screen by enlarging the picture. In this case, for the initial segments whose frame ratio corresponding to the effective display area exceeds the preset frame ratio threshold, the effective display area obtained from the initial film is the enlarged effective display area, so that the frame ratio corresponding to the effective display area in the initial segment obtained is increased, which is inconsistent with the actual situation, thereby affecting the accuracy of the frame matching between the template to be matched and the editing material. Therefore, in this case, for the initial segment whose frame ratio corresponding to the effective display area exceeds the preset frame ratio threshold, the frame ratio corresponding to the effective display area determined before the film is generated can be obtained to participate in the calculation of the subsequent frame matching score to improve the accuracy of the frame matching.
[0225] 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, the above ratio may 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-mentioned products to the sum of the durations of the segments corresponding to the initial segments, one or more frame matching thresholds may be preset, and the frame matching score corresponding to the first template to be matched may be determined according to the relationship between the above-mentioned ratio and each frame matching threshold. For example, a first frame matching threshold and a second frame matching threshold may be preset, and the first frame matching threshold is greater than the second frame matching threshold. Then, when the above-mentioned ratio is greater than or equal to the first frame matching threshold, the frame matching score corresponding to the first template to be matched may be determined as the first frame score (e.g., 80 points); when the above-mentioned ratio is less than the first frame matching threshold and greater than or equal to the second frame matching threshold, the frame matching score corresponding to the first template to be matched may be determined as the second frame score (e.g., 40 points); when the above-mentioned ratio is less than the second frame matching threshold, the frame matching score corresponding to the first template to be matched may 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 durations of the segments corresponding to the initial segments, the initial frame matching score corresponding to when the frame ratio of the material to be edited and the template to be matched is completely matched can also be preset. For example, when the above ratio is 100%, it can be considered that the frame ratio of the material to be edited and the first template to be matched is completely matched, and the initial frame matching score corresponding to the above ratio of 100% can be determined as 80 points. Afterwards, the frame matching score corresponding to the first template to be matched can be determined according to the above ratio based on the principle that the frame matching score decreases linearly with the decrease of the above ratio. For example, the above principle can be that for every decrease of the above ratio step relative to the ratio corresponding to the complete match, the frame matching score corresponding to the first template to be matched decreases by one score step relative to the initial frame matching score.
[0228] For example, assuming that when the above ratio is 100%, it is considered that the aspect ratio of the material to be edited is completely matched with the aspect ratio of the first template to be matched, and the initial aspect ratio matching score corresponding to the above ratio is 100% is 80 points, then the ratio step can be set to 1%, and the score step can be set to 1 point; that is, when the above ratio corresponding to the first template to be matched is 100%, it can be determined that the aspect ratio matching score corresponding to the first template to be matched is 80 points, and the aspect ratio matching score corresponding to the first template to be matched decreases by 1% each time the above ratio corresponding to the first template to be matched decreases by 1 point. For example, if the above ratio corresponding to the first template to be matched is 90%, then the aspect ratio matching score corresponding to the first template to be matched is 70 points.
[0229] It should be noted that the various methods of determining the frame matching score listed above are only exemplary and cannot be regarded as limiting the present application. In actual use, the frame matching score can be determined by selecting an appropriate method according to actual needs and specific application scenarios; and the specific values of the various thresholds or step sizes involved can be determined according to actual needs and specific application scenarios, and the present application embodiment does not limit this.
[0230] Through the above analysis, the embodiment of the present application uses the template to be matched to perform initial editing processing on the material to be edited to generate an initial film, and determines the frame matching score between the template to be matched and the material to be edited according to the frame ratio and segment length corresponding to the priority display area in each segment in the initial film, so as to quantify the frame matching degree between the template to be matched and the material to be edited, so that when the user mixes and selects materials with multiple frame ratios, a template with better frame matching can be matched, so that the material content can fill the film screen as much as possible, and the proportion of non-effective display areas such as Gaussian effect or black border effect in the film can be reduced as much as possible, thereby further improving the editing beauty of the film and further improving the user experience.
[0231] As a possible implementation, the preset matching index includes a material ratio index, and when the first template to be matched is matched with the material to be edited according to the material ratio index, a material ratio matching score corresponding to the first template to be matched can be generated. That is, in a possible implementation of the embodiment of the present application, the i-th preset matching index is the material ratio index, and the i-th matching score is the material ratio matching score; accordingly, the above 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 according to the number of videos and images contained in the material to be edited;
[0234] According to the material ratio corresponding to the to-be-edited material and the material type corresponding to the first to-be-matched template, a material ratio matching score corresponding to the first to-be-matched template is determined.
[0235] The material type may refer to a template type generated by dividing the templates in the template library according to the material type that the template is suitable for. For example, when the template library supports editing materials including videos and images, the templates in the template library may be divided into material types such as video priority templates, image priority templates, and general templates.
[0236] Among them, 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 contained in the material to be edited; it can also refer to the ratio of the number of images to the number of videos contained in the material to be edited, and the embodiment of the present application does not limit this.
[0237] In the embodiment of the present application, since the templates in the template library can be classified according to the material types suitable for the templates, for example, when the material includes videos and images, the templates in the template library can be divided into material types such as video priority templates, image priority templates, and general templates. Therefore, the material ratio corresponding to the material to be edited can be determined according to the number of videos and images included in the material to be edited, and then the material ratio matching score corresponding to the first template to be matched can be determined according to the material ratio and the material type corresponding to the first template to be matched.
[0238] As a possible implementation, one or more material ratio thresholds may be preset, and the material ratio matching score corresponding to the first to-be-matched template may be determined according to the relationship between the material ratio corresponding to the to-be-cut material and each of the material ratio thresholds, and the material type corresponding to the first to-be-matched template. For example, the material ratio is the ratio of the number of videos to the number of images, and the first material ratio threshold and the second material ratio threshold are preset, and the first material ratio threshold is greater than the second material ratio threshold; then when the material type corresponding to the first to-be-matched template is a video, if the material ratio corresponding to the to-be-cut material is greater than or equal to the first material ratio threshold, the material ratio matching score corresponding to the first to-be-matched template may be determined as the first material ratio score (e.g., 20 points); if the material ratio corresponding to the to-be-cut material is less than the first material ratio threshold, and greater than or equal to the second material ratio threshold, the material ratio matching score corresponding to the first to-be-matched template may be determined as the second material ratio score (e.g., 10 points); if the material ratio corresponding to the to-be-cut material is less than the second material ratio threshold, the material ratio matching score corresponding to the first to-be-matched template may 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 (such as 0 points); if the material ratio corresponding to the material to be edited is less than the first material ratio threshold, and 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 (such as 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 (such as 20 points).
[0240] When the material type corresponding to the first template to be matched 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 template to be matched can be determined as the second material ratio score or the third material ratio score (such as 10 points or 0 points); if the material ratio corresponding to the material to be edited is less than the first material ratio threshold, and 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 first material ratio score (such as 20 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 second material ratio score or the third material ratio score (such as 10 points or 0 points).
[0241] It is understandable that when the material ratio corresponding to the material to be edited is the ratio of the number of images to the number of videos, the material ratio matching score corresponding to the first template to be matched can also be determined according to the same logic as the above method, which will not be repeated here.
[0242] It should be noted that the above examples are only exemplary and cannot be regarded as limiting the present 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 the present application embodiment does not limit this.
[0243] Through the above analysis, since some templates in the template library are more suitable for video materials and some are more suitable for image materials, the material ratio is determined according to the number of videos and images contained in the material to be edited, and the material ratio matching score between the template to be matched and the material to be edited is determined according to the material ratio and the material type suitable for the template to be matched, so as to quantify the degree of material type matching between the template to be matched and the material to be edited, so that the final recommended template can better match the material type selected by the user, improve the filming effect of more materials as much as possible, and further improve the user experience.
[0244] As a possible implementation, the preset matching index includes a pit position matching index, and when the first template to be matched is matched with the material to be edited according to the pit position matching index, a pit position matching score corresponding to the first template to be matched can be generated. That is, in a possible implementation of the embodiment of the present application, the i-th preset matching index is the pit position matching index, and the i-th matching score is the pit position matching score; accordingly, the above step 203 may include:
[0245] Get the number of materials contained in the material to be edited;
[0246] Obtain the number of slots contained in the first to-be-matched template, the duration of each slot, and the total duration of the template;
[0247] Performing initial editing processing on the material to be edited using the first template to be matched, so as to generate an initial finished film corresponding to the material to be edited;
[0248] Obtaining the total duration of the initial film and the duration of each initial segment included in the initial film;
[0249] Determine the matching degree of the number of pits corresponding to the first template to be matched according to the number of materials and the number of pits;
[0250] Determine the total duration matching degree corresponding to the first template to be matched according to the total duration of the film and the total duration of the template;
[0251] Determine the pit duration matching degree corresponding to the first to-be-matched template according to the pit duration of each pit and the duration of each segment;
[0252] According to the pit quantity matching degree, total duration matching degree and pit duration matching degree, the pit matching score corresponding to the first template to be matched is determined.
[0253] Among them, the pit position may refer to the fragments included in the template; the number of pit positions may refer to the number of fragments included in the template; the pit position duration may refer to the length of the fragments corresponding to each pit position included in the template.
[0254] It should be noted that in order to improve the editing effect of the film, the template may include multiple editing effects such as music rhythm card points and template transitions, and the adjacent music rhythm card points or the segments between adjacent template transitions are the pits of the template. When using the template to edit the material to be edited, each material to be edited can be filled into each pit according to the number of pits and the length of the pits in the template, so that different editing materials can be switched with editing special effects such as music rhythm card points and template transitions. Therefore, the higher the pit matching degree between the material to be edited and the template to be matched, the better the applicability between the speed to be edited and the music rhythm points and template transitions of the template to be matched. In addition, it can be seen from the above analysis that the pit matching degree between the material to be edited and the template to be matched is related to the matching degree between the number of materials of the material to be edited and the number of pits of the template to be matched, the matching degree between the length of each segment of the material to be edited and the length of the pit of the template to be matched, and the matching degree between the total length of the material to be edited and the total length of the template to be matched. Therefore, the pit matching score corresponding to the first template to be matched can be determined by the above parameters.
[0255] As a possible implementation method, since when the material to be edited is edited according to the template, the material to be edited can be divided or merged according to the length and quantity of the material to be edited and then filled into each slot of the template, the initial film can first be edited using the first template to be matched to generate an initial film corresponding to the material to be edited, and then the pit matching degree between the material to be edited and the first template to be matched can be determined according to the length of the initial film and the length of each segment in the initial film. Among them, the ratio of the number of materials corresponding to the material to be edited and the number of slots corresponding to the first template to be matched can be determined as the matching degree of the number of slots corresponding to the first template to be matched; and the ratio of the total duration of the initial film corresponding to the initial film and the total duration of the template corresponding to the first template to be matched can be determined as the matching degree of the total duration corresponding to the first template to be matched; and the ratio of the fragment duration corresponding to each initial fragment in the initial film and the corresponding pit duration can be determined as the matching degree of each pit duration corresponding to the first template to be matched; finally, the pit matching score corresponding to the first template to be matched can be determined according to the matching degree of the number of pits corresponding to the first template to be matched, the total duration matching degree and the matching degree of each pit duration.
[0256] As a possible implementation method, one or more quantity matching thresholds, one or more total duration matching thresholds, and one or more pit duration matching thresholds can be preset, and the pit matching score corresponding to the first template to be matched can be determined based on the relationship between the corresponding parameters and the corresponding thresholds. For example, a first quantity matching threshold, a second quantity matching threshold and a third quantity matching threshold, a first total duration matching threshold, a second total duration matching threshold and a third total duration matching threshold, as well as a first pit duration matching threshold, a second pit duration matching threshold, a third pit duration matching threshold and a fourth pit 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 pit duration matching threshold is between the second pit duration matching threshold and the third pit duration matching threshold, the second pit duration matching threshold is greater than the third pit duration matching threshold, and the third pit duration matching threshold is greater than the fourth pit duration matching threshold.
[0257] If the number of pit matches corresponding to the first template to be matched is greater than or equal to the first number matching threshold, the total duration matching is greater than or equal to the first total duration matching threshold, and the duration matching of each pit is the first pit duration matching threshold, then it can be determined that the first template to be matched is completely matched with the material to be edited, so that the pit matching score corresponding to the first template to be matched can be determined as the first pit score (such as 15 points); if the number of pit matches corresponding to the first template to be matched is less than the first number matching threshold and greater than or equal to the second number matching threshold, the second total duration matching is less than the first total duration matching threshold and greater than or equal to the second total duration matching threshold, and the duration matching of each pit is less than or equal to the second pit duration matching threshold and greater than or equal to the third pit duration matching threshold, then it can be determined that the first template to be matched is well matched with the material to be edited, so that the pit matching score corresponding to the first template to be matched can be determined as the second pit score (such as 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 is greater than or equal to the third matching degree threshold, the second total duration matching degree is less than the second total duration matching degree threshold and is greater than or equal to the third total duration matching degree threshold, and the duration matching degrees of at most L slots are less than or equal to the third slot duration matching degree threshold and greater than the fourth slot duration matching degree threshold, and the duration matching degrees of the remaining slots are 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 and the material to be edited are generally matched, so that the slot matching score corresponding to the first template to be matched can be determined as the third slot score (such as 3 points), where L is less than the number of slots corresponding to the first template to be matched; in other cases, it can be determined that the first template to be matched and the material to be edited are poorly matched, so that the slot matching score corresponding to the first template to be matched can be determined as the fourth slot score (such as 0 points).
[0258] For example, assuming that 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 pit duration matching threshold is 1, the second pit duration matching threshold is 1.2, the third pit duration matching threshold is 0.8, and the fourth pit duration matching threshold is 0.5; the first pit score is 15 points, the second pit score is 10 points, the third pit score is 3 points, and the fourth pit score is 15 points. The position score is 0 points, and the value of L is 2; thus, when the number of pits corresponding to the first to-be-matched template is 100% matching, the total duration matching is 100%, and the duration matching of each pit is 1, it can be determined that the first to-be-matched template is completely matched with the to-be-edited material, so that the pit matching score corresponding to the first to-be-matched template can be determined as 15 points; when the number of pits corresponding to the first to-be-matched template is greater than or equal to 80%, the total duration matching is greater than or equal to 75%, and the duration matching of each pit is between 0.8-1.2 ... is greater than or equal to 80%, the total duration matching is greater than or equal to 75%, and the duration matching of each pit is between 0.8-1.2, it can be determined that the first to-be-matched template is completely matched with the to-be-edited material, so that the first to-be-matched template is completely matched with the to-be-edited material, so that the first to-be-matched template is completely matched with the to-be-edited material, so that the first to-be-matched template is completely matched with the to-be-edited material, so that the first to-be-matched template is completely matched with the to-be-edited material, so that the first to-be-matched template is completely The template matches the material to be edited well, so the pit matching score corresponding to the first template to be matched can be determined as 10 points; that is, when the match is good, each pit can change the material content by 0.8-1.2 so that the material content matches the corresponding pit duration; when the number of pits corresponding to the first template to be matched is greater than or equal to 60%, the total duration matching is greater than or equal to 40%, and at most 2 pit duration matchings are between 0.5-0.8, and the remaining pit duration matchings are all between 0.8-1.2, it can be determined that the first template to be matched is 10 points. The matching template and the material to be edited generally match, so the pit matching score corresponding to the first template to be matched can be determined as 3 points; that is, in general matching, at most two pits can change the speed of the material content by 0.5-0.8 to make the material content match the corresponding pit length; and the remaining pits can change the speed of the material content by 0.8-1.2 to make the material content match the corresponding pit length; in other cases, it can be determined that the first template to be matched and the material to be edited are poorly matched, so the pit matching score 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 based on experience, and the fixed duration can be the minimum allowable total duration of the film, and based on the relationship between the total duration of the film corresponding to the initial film and the fixed duration, determine 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 pits corresponding to the first template to be matched is greater than or equal to 60%, the total duration of the film is greater than or equal to 12 seconds, and the duration matching degrees of at most 2 pits are between 0.5-0.8, and the duration matching degrees of the remaining pits are all between 0.8-1.2, it can be determined that the first template to be matched and the material to be edited are generally matched, so that the pit 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 only exemplary and cannot be regarded as limitations of the present application. In actual use, the specific method for determining the pit matching score, the number of thresholds involved in determining the pit matching score, and the specific values of each threshold and other parameters can all be determined according to actual needs and specific application scenarios, and the present application embodiment does not limit this.
[0261] Through the above analysis, since the template can contain multiple positions, there can be editing effects such as music rhythm points and template transitions between adjacent positions to improve the diversity and richness of the material editing effects. Therefore, the template to be matched can be used to perform initial editing on the material to be edited, and the matching degree of the number of positions, the duration of the positions and the total duration between the template to be matched and the material to be edited can be determined to quantify the degree of position matching between the template to be matched and the material to be edited, so that the music rhythm points, template transitions, etc. of the final recommended template are more applicable to the material selected by the user, further improving the editing effect of the film and the user experience.
[0262] Furthermore, the type of the card point of the template to be matched can also be referred to when determining the pit position matching score, so as to set different pit position matching scores for different card point types, so that the card point type of the final recommended template is more closely matched with the material selected by the user, thereby further improving the rhythm card point of the film and the template transition effect, and further improving the user experience. That is, in a possible implementation method of the embodiment of the present application, the pit position matching score corresponding to the first template to be matched is determined according to the pit position number matching degree, the total duration matching degree and the pit position duration matching degree, including:
[0263] Obtain the card point type corresponding to the first template to be matched;
[0264] The pit matching score is determined based on the pit quantity matching, total duration matching, pit duration matching and checkpoint type.
[0265] Among them, the checkpoint type may at least include a strong checkpoint type and a common checkpoint type.
[0266] As a possible implementation method, for a template of a strong card point type, if it has a higher specific pit position matching degree with the material to be edited, a better weight can be given to the pit position matching score corresponding to the template of the strong card point type, so that when the pit position matching degrees are similar, the strong card point type template can be more easily recommended to the user than the ordinary card point type template, so as to further improve the rhythm card point and template transition effects of the film. Therefore, in an embodiment of the present application, different scoring rules can be set for the strong card point type template and the ordinary card point type template, respectively, and in accordance with the aforementioned method, according to the pit position number matching degree, total duration matching degree and pit position duration matching degree corresponding to the first template to be matched, it can be determined whether the pit position matching degree between the first template to be matched and the material to be edited is a complete match, a good match, a general match or a poor match, and then the pit position matching score corresponding to the first template to be matched is determined in combination with the scoring rules corresponding to the card point type corresponding to the first template to be matched.
[0267] For example, assuming that the scoring rules corresponding to the common card point type template are: the pit position matching scores corresponding to full match, better match, general match, and poor match are 15 points, 10 points, 3 points, and 0 points respectively, and the scoring rules corresponding to the strong card point type template are: the pit position matching scores corresponding to full match, better match, general match, and poor match are 25 points, 20 points, 10 points, and 0 points respectively. Therefore, if the first template to be matched is a common card point type template, when the pit position matching degree between it and the material to be edited is full match, better match, general match, and poor match, the corresponding pit position matching scores are 15 points, 10 points, 3 points, and 0 points respectively; correspondingly, if the first template to be matched is a strong card point type template, when the pit position matching degree between it and the material to be edited is full match, better match, general match, and poor match, the corresponding pit position matching scores are 25 points, 20 points, 10 points, and 0 points respectively.
[0268] As a possible implementation, if the templates to be matched include templates with unmarked pit positions or pit position restrictions, the pit position matching scores for such templates to be matched may not be determined in the above manner, but the pit position matching scores corresponding to such templates to be matched may be determined as a fixed score, such as 2 points. In actual use, the specific value of the fixed score can be determined according to actual needs and specific application scenarios, and the embodiments of the present application do not limit this.
[0269] As a possible implementation, the preset matching index includes a download type index, and when the first template to be matched is matched with the material to be edited according to the download type index, a download score corresponding to the first template to be matched can be generated. That is, in a possible implementation of the embodiment of the present application, the i-th preset matching index is a download type index, and the i-th matching score is a download score; accordingly, the above step 203 may include:
[0270] Obtaining a download type corresponding to the first template to be matched, wherein the download type includes a local template and an online template;
[0271] According to the download type, a download score corresponding to the first template to be matched is determined.
[0272] In the embodiment of the present application, it is possible to determine which download type of template is more likely to be recommended to the user based on the actual recommendation needs, and to assign a higher download score to the to-be-matched template of the download type. For example, if the local template is more likely to be recommended to the user, the download score corresponding to the local template can be made greater than the download score corresponding to the online template, so that the local template is more likely to be recommended to the user; if the online template is more likely to be recommended to the user, the download score corresponding to the online template can be made greater than the download score corresponding to the local template, so that the online template is more likely to be recommended to the user.
[0273] Furthermore, in order to make it easier for local templates to be recommended to users, so as to ensure the editing effect while minimizing the traffic consumption of users downloading templates, a higher download score can be assigned to local templates. That is, in a possible implementation of the embodiment of the present application, the above-mentioned determination of the download score corresponding to the first template to be matched according to the download type may include:
[0274] When the download type corresponding to the first template to be matched is an online template, the download score is determined to be 0;
[0275] When 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 to be determined as the download score, wherein the minimum value of the first score range is greater than or equal to 0.
[0276] As a possible implementation, if the download type corresponding to the first template to be matched is an online template, the download score corresponding to the first template to be matched can be determined as 0; if the download type corresponding to the first template to be matched is a local template, a score can be randomly selected from a first score range greater than or equal to 0 to be 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 that 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 above example, since the first score range includes 0 points, in some cases the download score of the local template may be the same as the download score of the online template, both of which are 0 points, to prevent the download score of the local template from always being greater than the download score of the online template, and to avoid the situation where the online template can never be recommended. In this way, while reducing traffic consumption, some online templates can be recommended to users, so as to further improve the freshness and richness of template recommendations.
[0278] Furthermore, if the user has downloaded fewer local templates, online templates may not be suppressed to prevent the inability to recommend suitable templates to the user due to fewer templates, which would affect the editing effect. Therefore, in a possible implementation of the embodiment of the present application, before obtaining the download type corresponding to the first template to be matched, the following may also be included:
[0279] It is determined that the number of templates of the download type local template contained in the template library is greater than the quantity threshold.
[0280] As a possible implementation method, when it is determined that the number of local templates in the template library is greater than the quantity threshold, that is, when the local templates have a certain scale, the online templates can be suppressed to recommend as many local templates as possible to users and reduce the traffic effect of template downloading.
[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 the embodiment of the present application does not limit this. For example, the above quantity threshold can be 50, 100, etc.
[0282] As a possible implementation, the preset matching index includes an operation index, and when the first template to be matched is matched with the material to be edited according to the operation index, an operation matching score corresponding to the first template to be matched can be generated. That is, in a possible implementation of the embodiment of the present application, the i-th preset matching index is an operation index, and the i-th matching score is an operation matching score; accordingly, the above step 203 may include:
[0283] Obtaining the operation type corresponding to the first template to be matched;
[0284] According to the operation type, an operation matching score corresponding to the first template to be matched is determined.
[0285] Among them, the operation type can be used to indicate whether the template currently needs to be promoted. For example, the operation type may include new launch, popular activity, high quality, model variable, character portrait variable, etc. In actual use, the operation type may include but is not limited to the above-listed situations, and the embodiment of this application does not limit this.
[0286] As a possible implementation method, if it is determined that the operation type corresponding to the first template to be matched is an operation type that needs to be promoted, the operation matching score corresponding to the first template to be matched can be determined as a higher value; if it is determined that the operation type corresponding to the first template to be matched is an operation type that does not need to be promoted, the operation matching score corresponding to the first template to be matched can be determined as a lower value. For example, if it is determined that the operation type corresponding to the first template to be matched is an operation type that needs to be promoted, the operation matching score corresponding to the first template to be matched can be determined as 10 points; if it is determined that the operation type corresponding to the first template to be matched is an operation type that does not need to be promoted, the operation matching score corresponding to the first template to be matched can be determined as 0 points.
[0287] As an example, when marking the operation type of each template in the template library, if it is a template that needs to be promoted, the specific operation type corresponding to the template can be marked, such as newly launched, high quality, etc.; if it is a template that does not need to be promoted, the operation type corresponding to the template can be left unmarked. Thus, if the operation 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 operation type, it can be determined that the first template to be matched needs to be promoted.
[0288] Furthermore, the operation type to be promoted may be preset, and when the operation type corresponding to the first template to be matched matches the preset operation type, a higher operation matching score is assigned to the first template to be matched. That is, in a possible implementation of the embodiment of the present application, the above-mentioned determination of the operation matching score corresponding to the first template to be matched according to the operation type may include:
[0289] When the operation type is a preset operation type, a score is randomly selected from the second score range to be determined as the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0290] When the operation type is not the preset operation type, the operation matching score is determined to be 0.
[0291] The preset operation type can be set according to actual promotion needs, and the present application embodiment does not limit this. For example, the preset operation type can include one or more of the types of new launch, popular activity, high quality, model variable, character portrait variable, etc.
[0292] As a 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 determined as 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 to be 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 that when the operation type corresponding to the first template to be matched is a preset operation type, any score from 1-10 points can be randomly selected as its corresponding operation matching score.
[0293] Through the above analysis, the embodiment of the present application determines the operation matching score corresponding to the template to be matched according to the operation type corresponding to the template to be matched, so that the template to be matched that needs to be promoted can be given a higher score according to actual needs, so that the template to be matched that needs to be promoted can be more easily recommended to users, thereby further improving the flexibility of template matching.
[0294] Step 204: Determine a target matching score corresponding to the first template to be matched according to the N matching scores corresponding to the first template to be matched.
[0295] In the embodiment of the present application, after the N matching scores corresponding to the first template to be matched are determined, the target matching score corresponding to the first template to be matched can be determined based on the N matching scores.
[0296] As a possible implementation manner, the sum of N matching scores corresponding to the first template to be matched may be determined as the target matching score corresponding to the first template to be matched.
[0297] As a possible implementation manner, different weights may 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 is determined as the target matching score corresponding to the first template to be matched.
[0298] It should be noted that, in the same manner as above, the target matching score corresponding to each template to be matched can be determined in sequence.
[0299] For other specific implementation processes and principles of the above step 204, reference may be made to the detailed description of the above embodiment, which will not be repeated here.
[0300] Step 205 : selecting at least one to-be-matched template as a target template corresponding to the to-be-matched material according to the target matching score corresponding to each to-be-matched template.
[0301] The specific implementation process and principle of the above step 205 can refer to the detailed description of the above embodiment, which will not be repeated here.
[0302] As an example, Figure 3 FIG. 1 is a flow chart of a template matching method for clipping a material provided in an embodiment of the present application. Figure 3 In the scheme shown, the material to be edited selected by the user may include both video and image, and after the video is subjected to frame extraction processing, the frame extraction result corresponding to the video and the image may be input together into the template matching model corresponding to the template matching method for material editing of the embodiment of the present application, so as to perform theme recognition on the material to be edited according to the frame extraction result corresponding to the video and the image, so as to determine the template to be matched corresponding to the material to be edited, and the theme matching score corresponding to the template to be matched; and then respectively calculate the frame matching score, material ratio matching score, slot matching score, download score and operation matching score corresponding to the template to be matched through the frame matching index, material type index, slot matching index, download type index and operation index, and then perform comprehensive selection according to the frame matching score, material ratio matching score, slot matching score, download score and operation matching score corresponding to the template to be matched, and the local pre-made stop loss principle, and select at least one target template through the equal division deduplication mechanism to recommend it to the user, and finally edit the material to be edited according to the target template selected by the user to generate a finished film corresponding to the material to be edited.
[0303] It should be noted that Figure 3 For other specific implementation processes and specific descriptions of the illustrated solution, please refer to the detailed description of the above embodiment and will not be repeated here.
[0304] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean 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 the present application.
[0305] Corresponding to the template matching method of material clipping described in the above embodiment, Figure 4 A structural block diagram of a template matching device for material clipping provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0306] Reference Figure 4 , the device 40 comprises:
[0307] A first acquisition module 41 is used to acquire at least one to-be-edited material selected by a user, wherein the to-be-edited material includes at least one of a video and an image;
[0308] A second acquisition module 42 is used to perform theme recognition on the to-be-cut material according to each template theme contained in the template library, so as to acquire a plurality of to-be-matched templates from the template library;
[0309] A first determination 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 to determine a 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 a target template corresponding to the material to be edited according to the target matching score corresponding to each template to be matched.
[0311] In actual use, the template matching device for material clipping provided in the embodiment of the present application can be configured in any electronic device to execute the aforementioned template matching method for material clipping.
[0312] The template matching device for material editing provided in the embodiment of the present application first selects a template to be matched that matches the theme of the material to be edited through theme recognition, and then judges the matching degree between the template to be matched and the material to be edited from multiple evaluation dimensions based on at least one preset matching index, and selects a suitable target template based on the matching degree between the template to be matched and the material to be edited to recommend to the user, thereby improving the matching degree between the recommended template and the material selected by the user, improving the filming effect, and improving the user experience.
[0313] In a possible implementation of the present application, the second acquisition module 42 includes:
[0314] A first determination unit is used to perform theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and each template theme;
[0315] A second determining unit is used to determine the to-be-matched template theme corresponding to the to-be-edited material according to the matching degree between the to-be-edited material and each template theme;
[0316] The third determining unit is used to determine each template in the template library whose template theme is the theme of the template to be matched as the template to be matched.
[0317] Further, in another possible implementation of the present application, the number of the preset matching indicators is N, where N is a positive integer; accordingly, the first determination module 43 includes:
[0318] a fourth determining unit, configured to match 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, wherein the first template to be matched is any template to be matched, and 1≤i≤N;
[0319] The fifth determining unit is used to determine a target matching score corresponding to the first template to be matched according to the N matching scores corresponding to the first template to be matched.
[0320] Furthermore, in another possible implementation of the present application, the above-mentioned preset matching index includes at least one of the following indicators: a frame matching index, a material type index, a slot matching index, a download type index, and an operation index.
[0321] Further, in another possible implementation of the present application, the i-th preset matching index is a topic matching index, and the i-th matching score is a topic matching score; accordingly, the fourth determining unit is specifically used to:
[0322] Performing theme recognition on the material to be edited according to each template theme to determine the matching degree between the material to be edited and the template theme corresponding to the first template to be matched;
[0323] According to the matching degree between the to-be-edited material and the template theme corresponding to the first to-be-matched template, a theme matching score corresponding to the first to-be-matched template is determined.
[0324] Further, in another possible implementation of the present application, the i-th preset matching index is a frame matching index, and the i-th matching score is a frame matching score; accordingly, the fourth determining unit is further configured to:
[0325] Performing initial editing processing on the material to be edited using the first template to be matched, so as to determine an initial finished film corresponding to the material to be edited;
[0326] Obtaining each initial segment included in the initial film and the segment duration corresponding to each initial segment;
[0327] Determine the frame ratio corresponding to the effective display area in each initial segment;
[0328] The frame matching score corresponding to the first template to be matched is determined according to the frame ratio corresponding to the effective display area in each initial segment and the segment duration corresponding to each initial segment.
[0329] Further, in another possible implementation of the present application, the i-th preset matching index is a material ratio index, and the i-th matching score is a material ratio matching score; accordingly, the fourth determining unit is further used to:
[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 according to the number of videos and images contained in the material to be edited;
[0332] According to the material ratio corresponding to the to-be-edited material and the material type corresponding to the first to-be-matched template, a material ratio matching score corresponding to the first to-be-matched template is determined.
[0333] Further, in another possible implementation of the present application, the i-th preset matching index is a pit position matching index, and the i-th matching score is a pit position matching score; accordingly, the fourth determining unit is further used to:
[0334] Get the number of materials contained in the material to be edited;
[0335] Obtain the number of slots contained in the first to-be-matched template, the duration of each slot, and the total duration of the template;
[0336] Performing initial editing processing on the material to be edited using the first template to be matched, so as to generate an initial finished film corresponding to the material to be edited;
[0337] Obtaining the total duration of the initial film and the duration of each initial segment included in the initial film;
[0338] Determine the matching degree of the number of slots corresponding to the first template to be matched according to the number of materials and the number of slots;
[0339] Determine the total duration matching degree corresponding to the first template to be matched according to the total duration of the film and the total duration of the template;
[0340] Determine the pit duration matching degree corresponding to the first to-be-matched template according to the pit duration of each pit and the duration of each segment;
[0341] According to the pit quantity matching degree, total duration matching degree and pit duration matching degree, the pit matching score corresponding to the first template to be matched is determined.
[0342] Furthermore, in another possible implementation of the present application, the fourth determining unit is further configured to:
[0343] Obtain the card point type corresponding to the first template to be matched;
[0344] The pit matching score is determined based on the pit quantity matching, total duration matching, pit duration matching and checkpoint type.
[0345] Further, in another possible implementation of the present application, the i-th preset matching indicator is a download type indicator, and the i-th matching score is a download score; accordingly, the fourth determining unit is further used to:
[0346] Obtaining a download type corresponding to the first template to be matched, wherein the download type includes a local template and an online template;
[0347] According to the download type, a download score corresponding to the first template to be matched is determined.
[0348] Furthermore, in another possible implementation of the present application, the fourth determining unit is further configured to:
[0349] When the download type corresponding to the first template to be matched is an online template, the download score is determined to be 0;
[0350] When 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 to be 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 the present application, the fourth determining unit is further configured to:
[0352] It is determined that the number of templates of the download type local template contained in the template library is greater than the quantity threshold.
[0353] Further, in another possible implementation of the present application, the i-th preset matching indicator is an operation indicator, and the i-th matching score is an operation matching score; accordingly, the fourth determining unit is further used to:
[0354] Obtaining the operation type corresponding to the first template to be matched;
[0355] According to the operation type, an operation matching score corresponding to the first template to be matched is determined.
[0356] Furthermore, in another possible implementation of the present 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 be determined as the operation matching score, wherein the minimum value of the second score range is greater than 0;
[0358] When the operation type is not the preset operation type, the operation matching score is determined to be 0.
[0359] Furthermore, in another possible implementation of the present application, the device 40 further includes:
[0360] A third acquisition module is used to acquire M historical templates used by the user and the most recent use time of the M historical templates contained in the template to be matched, where M is a positive integer;
[0361] A second determination module is used to determine the suppression score corresponding to each historical template according to the most recent use time of each historical template;
[0362] The first correction module is used to correct the target matching score corresponding to each historical template according to the suppression score corresponding to each historical template.
[0363] Furthermore, in another possible implementation of the present application, the first selection module 44 includes:
[0364] The first selection unit is used to select K to-be-matched templates with the highest target matching scores as target templates according to the target matching scores corresponding to each to-be-matched template, where K is a positive integer.
[0365] Furthermore, in another possible implementation of the present application, the target matching scores corresponding to the above K target templates are different from each other.
[0366] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0367] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by 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 embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0368] In order to implement the above embodiments, the present application also proposes an electronic device.
[0369] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present application.
[0370] See also 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light 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 to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0372] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. As a possible implementation, the processor may determine a target template matching the material to be edited based on the material to be edited selected by the user and recommend it to the user.
[0373] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0374] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0375] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0376] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is an integer greater than 1.
[0377] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0378] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0379] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0380] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0381] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0382] It should be noted that the implementation process and technical principles of the electronic device of this embodiment refer to the aforementioned explanation of the template matching method for material clipping in the embodiment of the present application, and will not be repeated here.
[0383] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0384] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0385] If the integrated unit is implemented in the form of 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, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0386] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0387] In the above-described embodiments, specific details such as specific system structures, technologies, etc. are provided for illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0388] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0389] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0390] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0391] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0392] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0393] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0394] In the embodiments provided in the present 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 schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0395] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0396] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A template matching method for material editing, It is characterized in that include: Acquire at least one material to be edited selected by a user, wherein the material to be edited includes at least one of a video and an image; Performing theme identification on the material to be edited according to the themes of each template contained in the template library, so as to obtain multiple templates to be matched from the template library; According to at least one preset matching index, each of the templates to be matched is matched with the material to be edited to determine a target matching score corresponding to each of the templates to be matched; According to 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.
2. The method according to claim 1, It is characterized in that The subject identification of the material to be edited is performed according to each template subject contained in the template library to obtain multiple templates to be matched from the template library, including: Performing theme recognition on the material to be edited according to each of the template themes to determine the degree of match between the material to be edited and each of the template themes; Determining the template theme to be matched corresponding to the material to be edited according to the matching degree between the material to be edited and each of the template themes; Each template in the template library whose template subject is the subject of the template to be matched is determined as the template to be matched.
3. The method according to claim 1, It is characterized in that The number of the preset matching indicators is N, where N is a positive integer. According to at least one preset matching indicator, each of the templates to be matched is matched with the material to be edited to determine a target matching score corresponding to each of the templates to be matched, including: According to the i-th preset matching index, matching 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, wherein the first template to be matched is any template to be matched, 1≤i≤N; A target matching score corresponding to the first template to be matched is determined according to the N matching scores corresponding to the first template to be matched.
4. The method according to claim 3, It is characterized in that The preset matching index includes at least one of the following indexes: a theme matching index, a frame matching index, a material type index, a slot matching index, a download type index, and an operation index.
5. The method according to claim 4, It is characterized in that The i-th preset matching index is the theme matching index, the i-th matching score is the theme matching score, and 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: Performing theme recognition on the material to be edited according to each of the template themes to determine the degree of match between the material to be edited and the template theme corresponding to the first template to be matched; According to the matching degree between the to-be-edited material and the template theme corresponding to the first to-be-matched template, a theme matching score corresponding to the first to-be-matched template is determined.
6. The method according to claim 4, It is characterized in that The i-th preset matching index is the frame matching index, the i-th matching score is the frame matching score, and 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: Performing initial editing processing on the material to be edited using the first template to be matched, so as to determine an initial finished film corresponding to the material to be edited; Acquire each initial segment included in the initial film and the segment duration corresponding to each initial segment; Determine the frame ratio corresponding to the effective display area in each of the initial segments; A frame matching score corresponding to the first template to be matched is determined according to the frame ratio corresponding to the effective display area in each of the initial segments and the segment duration corresponding to each of the initial segments.
7. The method according to claim 4, It is characterized in that The i-th preset matching index is the material ratio index, the i-th matching score is the material ratio matching score, and 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: Obtaining 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; Determining the material ratio corresponding to the material to be edited according to the number of videos and the number of images contained in the material to be edited; A material ratio matching score corresponding to the first template to be matched is determined according to the material ratio corresponding to the to-be-edited material and the material type corresponding to the first template to be matched.
8. The method according to claim 4, It is characterized in that The i-th preset matching index is the pit position matching index, the i-th matching score is the pit position matching score, and 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: Obtaining the number of materials included in the material to be edited; Obtain the number of slots, duration of each slot, and total duration of the template included in the first to-be-matched template; Performing initial editing processing on the material to be edited using the first template to be matched, so as to generate an initial finished film corresponding to the material to be edited; Obtaining a total duration of the initial film and a duration of each initial segment included in the initial film; Determine the matching degree of the number of pits corresponding to the first template to be matched according to the number of materials and the number of pits; Determine a total duration matching degree corresponding to the first template to be matched according to the total duration of the film and the total duration of the template; Determine the pit duration matching degree corresponding to the first to-be-matched template according to the pit durations of each pit and the segment durations; Determine the pit matching score corresponding to the first template to be matched based on the pit quantity matching degree, the total duration matching degree and the pit duration matching degree.
9. The method according to claim 8, It is characterized in that The determining, according to the pit quantity matching degree, the total duration matching degree and the pit duration matching degree, a pit position matching score corresponding to the first to-be-matched template includes: Obtaining the card point type corresponding to the first template to be matched; The pit matching score is determined according to the pit quantity matching degree, the total duration matching degree, the pit duration matching degree and the checkpoint type.
10. The method according to claim 4, It is characterized in that The i-th preset matching index is the download type index, the i-th matching score is the download score, and 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: Obtaining a download type corresponding to the first template to be matched, wherein the download type includes a local template and an online template; Determine a download score corresponding to the first to-be-matched template according to the download type.
11. The method according to claim 10, It is characterized in that The determining, according to the download type, a download score corresponding to the first to-be-matched template includes: When 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 a first score range to be determined as the download score, wherein the minimum value of the first score range is greater than or equal to 0.
12. The method according to claim 11, It is characterized in that Before obtaining the download type corresponding to the first template to be matched, the method further includes: It is determined that the number of templates of the download type contained in the template library that are local templates is greater than a number threshold.
13. The method of claim 4, It is characterized in that The i-th preset matching index is the operation index, the i-th matching score is the operation matching score, and 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: Obtaining the operation type corresponding to the first to-be-matched template; An operation matching score corresponding to the first template to be matched is determined according to the operation type.
14. The method according to claim 13, It is characterized in that The determining, according to the operation type, an operation matching score corresponding to the first to-be-matched template includes: When the operation type is a preset operation type, randomly selecting a score from a second score range to determine as the operation matching score, wherein the minimum value of the second score range is greater than 0; When the operation type is not the preset operation type, the operation matching score is determined to be 0.
15. The method according to any one of claims 1 to 14, It is characterized in that After matching each of the templates to be matched with the material to be edited according to at least one preset matching index to determine a target matching score corresponding to each of the templates to be matched, the method further includes: Obtaining M historical templates used by the user and the most recent use time of the M historical templates contained in the template to be matched, where M is a positive integer; Determining the suppression scores corresponding to the historical templates respectively according to the most recent usage time of the historical templates; According to the suppression scores corresponding to the historical templates, the target matching scores corresponding to the historical templates are respectively corrected.
16. The method according to any one of claims 1 to 15, It is characterized in that The step of selecting at least one of the templates to be matched as a target template corresponding to the material to be edited according to the target matching score corresponding to each of the templates to be matched includes: According to the target matching score corresponding to each of the to-be-matched templates, K to-be-matched templates with the highest target matching scores are selected as the target templates, where K is a positive integer.
17. The method of claim 16, It is characterized in that The target matching scores corresponding to the K target templates are different from each other.
18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 17.
19. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by an electronic device, the method according to any one of claims 1 to 17 is implemented.
Citation Information
Patent Citations
Editing template recommendation method and device, electronic equipment and storage medium
CN111105819A
Editing template searching method and device
CN115269889A
Template recommendation method and device, equipment and storage medium
CN115525780A
Processing method and device based on scoring template, equipment, storage medium and product
CN115719056A
Video editing method, electronic equipment and storage medium
CN115734032A