Method, device, storage medium and electronic device for generating target cooking video
By collecting and processing video and audio signals during the cooking process, and combining cooking actions, ingredients and equipment data to generate description text, it solves the problem that smart home appliances cannot generate cooking videos with explanations, and realizes the generation of cooking videos with explanations by smart home appliances. The video function improves the intelligence level of smart home appliances.
Patent Information
- Application Number
- CN202211521223.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-11-30
AI Technical Summary
Existing smart home appliances cannot generate cooking videos with explanations, and cannot record and provide corresponding explanation audio of the cooking process.
By collecting video and audio signals during the cooking process, combining cooking actions, ingredients and equipment data, description text is generated and combined with the initial video to form a cooking video with explanation.
It realizes the generation of cooking videos with explanations, meets users' needs for smart home appliances to generate cooking tutorials with explanations, and improves the intelligence level of smart home appliances.
Smart Images

Figure CN115988152B
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method, device, storage medium and electronic device for generating a target cooking video. Background Art
[0002] At present, as the intelligence level of smart home appliances continues to improve, users have higher and higher requirements for smart home appliances. For example, users hope to record their cooking process into a cooking tutorial with commentary. However, in the related art, smart home appliances can only record the user's cooking process, but cannot provide the corresponding commentary process of the user's cooking process. Therefore, in the cooking scenario, there is a technical problem of how to generate a cooking video with commentary audio.
[0003] Regarding the technical problem of how to generate a cooking video with narration audio in the related art, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method, device, storage medium and electronic device for generating a target cooking video, so as to at least solve the technical problem of how to generate a cooking video with commentary audio in the related art.
[0005] According to an embodiment of the embodiments of the present application, a method for generating a target cooking video is provided, comprising: collecting the cooking process of a target object to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object; acquiring an audio signal generated when the cooking equipment is working during the cooking process; generating a description text of the cooking process based on the cooking actions, the cooking ingredients, the equipment data of the cooking equipment, and the audio signal; and generating a target cooking video based on the cooking commentary audio corresponding to the description text and the initial cooking video.
[0006] In an exemplary embodiment, before generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal, the method also includes: determining whether the cooking equipment is pre-installed with a sensor according to the equipment type of the cooking equipment; if it is determined that the cooking equipment is pre-installed with a sensor, determining the sensor data of the sensor as the equipment data of the cooking equipment; if it is determined that the cooking equipment is not pre-installed with a sensor, monitoring the cooking equipment using a monitoring device within a preset range of the cooking equipment, and determining the monitoring data obtained by monitoring the cooking equipment as the equipment data of the cooking equipment.
[0007] In an exemplary embodiment, a description text of the cooking process is generated based on the cooking action, the cooking ingredients, the equipment data of the cooking device and the audio signal, including: when it is determined that the cooking action includes an action to process the cooking ingredients, obtaining a first cooking event corresponding to the cooking action and a second cooking event corresponding to the cooking ingredients; when it is determined that the first cooking event and the second cooking event both indicate the same cooking process, merging a first preset text corresponding to the cooking action and a second preset text corresponding to the cooking ingredients to obtain a first merged result; obtaining a third preset text corresponding to the audio signal belonging to the same cooking process and a fourth preset text corresponding to the equipment data of the cooking device; and generating a description text of the cooking process from the third preset text and the fourth preset text according to the first merged result.
[0008] In an exemplary embodiment, a description text of the cooking process is generated based on the cooking action, the cooking ingredients, the equipment data of the cooking device and the audio signal, including: when it is determined that the cooking action includes an action of operating the cooking device, obtaining a first cooking event corresponding to the cooking action, a third cooking event corresponding to the audio signal and a fourth cooking event corresponding to the equipment data of the cooking device; when it is determined that the first cooking event, the third cooking event and the fourth cooking event all indicate the same cooking process, merging the first preset text corresponding to the cooking action, the third preset text corresponding to the audio signal and the fourth preset text corresponding to the equipment data of the cooking device to obtain a second merged result; obtaining a second preset text corresponding to the cooking ingredients belonging to the same cooking process; and generating a description text of the cooking process according to the second merged result and the second preset text.
[0009] In an exemplary embodiment, in the process of generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal, the method also includes: obtaining the interval time between different cooking actions; and when it is determined that the interval time is greater than a first preset value, adding associated words between different cooking actions in the description text when the different cooking actions are switched.
[0010] In an exemplary embodiment, a target cooking video is generated based on the cooking commentary audio corresponding to the description text and the initial cooking video, including: parsing the cooking commentary audio to obtain a first keyword of the cooking commentary audio, wherein the first keyword indicates a fifth cooking event of the cooking process; obtaining a second keyword corresponding to the cooking action of the initial cooking video, wherein the second keyword indicates a sixth cooking event of the cooking process; and when it is determined that the first keyword and the second keyword indicate the same cooking event, generating a target cooking video based on the cooking commentary audio corresponding to the description text and the initial cooking video.
[0011] In an exemplary embodiment, in the process of generating a target cooking video based on the cooking commentary audio corresponding to the descriptive text and the initial cooking video, the method also includes: obtaining other actions in the initial cooking video except the cooking action of the target object; when it is determined that the target object switches from the cooking action to the other action, obtaining the duration after the target object switches from the cooking action to the other action; when it is determined that the duration is greater than a second preset value, stopping collecting the user's initial cooking video.
[0012] According to another embodiment of the embodiments of the present application, a device for generating a target cooking video is also provided, including: a parsing module, used to collect the cooking process of a target object to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object and the cooking equipment used by the target object; an acquisition module, used to acquire an audio signal generated when the cooking equipment is working during the cooking process; a first generation module, used to generate a description text of the cooking process based on the cooking actions, the cooking ingredients, the equipment data of the cooking equipment and the audio signal; and a second generation module, used to generate a target cooking video based on the cooking commentary audio corresponding to the description text and the initial cooking video.
[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for generating a target cooking video when running.
[0014] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for generating a target cooking video through the computer program.
[0015] In an embodiment of the present application, the cooking process of a target object is collected to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object; an audio signal generated when the cooking equipment is working during the cooking process is obtained; a description text of the cooking process is generated based on the cooking actions, the cooking ingredients, the equipment data of the cooking equipment, and the audio signal; a target cooking video is generated based on the cooking commentary audio corresponding to the description text and the initial cooking video; the above-mentioned technical solution is used to solve the technical problem of how to generate a cooking video with commentary audio, thereby achieving the purpose of generating a cooking video with commentary audio. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 It is a hardware environment diagram of a method for generating a target cooking video according to an embodiment of the present application;
[0019] Figure 2 is a flowchart of a method for generating a target cooking video according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a method for generating a target cooking video according to an embodiment of the present application;
[0021] Figure 4 is a structural block diagram of a device for generating a target cooking video according to an embodiment of the present application (I);
[0022] Figure 5 This is a structural block diagram (II) of a device for generating a target cooking video according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] According to one aspect of an embodiment of the present application, a method for generating a target cooking video is provided. The method for generating a target cooking video is widely used in smart home, smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for generating a target cooking video can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0026] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0027] In this embodiment, a method for generating a target cooking video is provided, which is applied to the above-mentioned computer terminal. Figure 2 : is a flowchart of a method for generating a target cooking video according to an embodiment of the present application, and the process includes the following steps:
[0028] Step S202, collecting the cooking process of the target object to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object;
[0029] Step S204, obtaining an audio signal generated when the cooking device is working during the cooking process;
[0030] Step S206, generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal;
[0031] Step S208: generating a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video.
[0032] Through the above steps, the cooking process of the target object is collected to obtain the initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object and the cooking equipment used by the target object; the audio signal generated when the cooking equipment is working during the cooking process is obtained; a description text of the cooking process is generated based on the cooking actions, the cooking ingredients, the equipment data of the cooking equipment and the audio signal; and a target cooking video is generated according to the cooking commentary audio corresponding to the description text and the initial cooking video, which solves the technical problem of how to generate a cooking video with commentary audio in the related art, thereby achieving the purpose of generating a cooking video with commentary audio.
[0033] In an exemplary embodiment, before generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal, a technical solution is also proposed, and the specific steps include: determining whether the cooking equipment is pre-installed with a sensor according to the equipment type of the cooking equipment; when it is determined that the cooking equipment is pre-installed with a sensor, determining the sensor data of the sensor as the equipment data of the cooking equipment; when it is determined that the cooking equipment is not pre-installed with a sensor, using a monitoring device within a preset range of the cooking equipment to monitor the cooking equipment, and determining the monitoring data obtained by monitoring the cooking equipment as the equipment data of the cooking equipment.
[0034] It should be noted that different types of cooking equipment are equipped with different types of sensors. For example, temperature sensors can be set for cooking equipment such as frying pans and stoves, humidity sensors can be set for cooking equipment such as rice cookers and steamers, and smoke sensors can be set for range hoods. This application does not impose any restrictions on this.
[0035] In an exemplary embodiment, the audio receiving module can also obtain the sound data generated when the cooking device is working during the cooking process. And extract the key audio frame where the audio signal of the sound data changes from the sound data, identify it according to the key audio frame, and obtain the audio signal corresponding to the opening state, closing state and changing working state of the cooking device. In an exemplary embodiment, in order to better understand the implementation process of generating the description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking device and the audio signal in the above step S206, the following technical scheme is proposed, and the specific steps include: when it is determined that the cooking action includes an action of processing the cooking ingredients, obtaining the first cooking event corresponding to the cooking action and the second cooking event corresponding to the cooking ingredients; when it is determined that the first cooking event and the second cooking event both indicate the same cooking process, merging the first preset text corresponding to the cooking action and the second preset text corresponding to the cooking ingredients to obtain a first merged result; obtaining the third preset text corresponding to the audio signal belonging to the same cooking process and the fourth preset text corresponding to the equipment data of the cooking device; according to the first merged result, the third preset text and the fourth preset text generate the description text of the cooking process.
[0036] Among them, the same cooking process indicated by the first cooking event and the second cooking event may be, for example, cooking. Then, the text corresponding to the sound of cooking (i.e., the third preset text corresponding to the audio signal) and the text corresponding to the equipment data of the range hood (i.e., the fourth preset text corresponding to the equipment data of the cooking equipment) are obtained, and according to the first merging result corresponding to the cooking action, the text corresponding to the cooking sound and the text corresponding to the equipment data of the range hood are used to generate a description text of the cooking process, for example, "The user is currently cooking and there is a lot of smoke."
[0037] In an exemplary embodiment, further, other technical solutions are proposed for implementing step 206 of generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking device and the audio signal. The specific steps include: when it is determined that the cooking action includes an action of operating the cooking device, obtaining a first cooking event corresponding to the cooking action, a third cooking event corresponding to the audio signal and a fourth cooking event corresponding to the equipment data of the cooking device; when it is determined that the first cooking event, the third cooking event and the fourth cooking event all indicate the same cooking process, merging the first preset text corresponding to the cooking action, the third preset text corresponding to the audio signal and the fourth preset text corresponding to the equipment data of the cooking device to obtain a second merged result; obtaining a second preset text corresponding to the cooking ingredients belonging to the same cooking process; and generating a description text of the cooking process according to the second merged result and the second preset text.
[0038] Among them, the above-mentioned first cooking event, the third cooking event and the fourth cooking event all indicate the same cooking process, for example, it may be putting ingredients into the cooking equipment, then the text corresponding to the ingredients when the ingredients are put into the cooking equipment (that is, the second preset text corresponding to the above-mentioned cooking ingredients) is obtained, and a description text is generated according to the second merged result corresponding to when the ingredients are put into the cooking equipment and the text corresponding to the ingredients when the ingredients are put into the cooking equipment, for example, it may be "the user is currently putting beef and carrots into the wok."
[0039] In an exemplary embodiment, in the process of generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal in executing the above-mentioned step S206, the following steps can also be implemented: obtaining the interval time between different cooking actions; when it is determined that the interval time is greater than a first preset value, when the different cooking actions are switched, adding associated words between different cooking actions in the description text.
[0040] It should be noted that the above-mentioned conjunctions can be understood as words that connect different actions and are used to improve the continuity between different cooking actions. They may include "next", "then", "subsequently", etc. This application does not impose any restrictions on this.
[0041] Optionally, in other embodiments, when it is determined that the interval time is greater than a first preset value, when the different cooking actions are switched, the number of associated words between different cooking actions in the description text is adjusted according to the difference between the interval time and the first preset value.
[0042] In an exemplary embodiment, for the implementation process of generating a target cooking video based on the cooking commentary audio corresponding to the description text and the initial cooking video in the above-mentioned step S208, the following implementation steps are specifically proposed, including: parsing the cooking commentary audio to obtain a first keyword of the cooking commentary audio, wherein the first keyword indicates the fifth cooking event of the cooking process; obtaining a second keyword corresponding to the cooking action of the initial cooking video, wherein the second keyword indicates the sixth cooking event of the cooking process; and when it is determined that the first keyword and the second keyword indicate the same cooking event, generating a target cooking video based on the cooking commentary audio corresponding to the description text and the initial cooking video.
[0043] In an exemplary embodiment, further, in the process of executing the above-mentioned step S208 to generate a target cooking video according to the cooking commentary audio corresponding to the description text and the initial cooking video, the following technical solution is also proposed, and the specific steps include: obtaining other actions in the initial cooking video except the cooking action of the target object; when it is determined that the target object switches from the cooking action to the other action, obtaining the duration after the target object switches from the cooking action to the other action; when it is determined that the duration is greater than a second preset value, stopping collecting the user's initial cooking video.
[0044] Furthermore, in other embodiments, when the target object switches from the other actions to the cooking action, the target cooking video may be regenerated. Alternatively, when it is determined that the duration is greater than a second preset value, the collection of the user's initial cooking video may be paused until the target object switches from the other actions to the cooking action, at which time the collection of the user's initial cooking video may continue.
[0045] In order to better understand the process of the method for generating the above-mentioned target cooking video, the implementation method flow of generating the above-mentioned target cooking video is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0046] In this embodiment, a method for generating a target cooking video is provided. Figure 3 is a schematic diagram of a method for generating a target cooking video according to an embodiment of the present application, such as Figure 3 As shown in Figure 1, multimodal data can be obtained through device hardware such as cameras, microphones, and sensors, that is, Figure 3The video stream data, audio stream data, and sensor data in the video stream data. For the video stream data, the visual understanding system can be used to perform action recognition and ingredient recognition, wherein the result of action recognition includes cooking actions such as flipping the wok, heating oil, and stir-frying, and the result of ingredient recognition includes cooking ingredients such as beef, carrots, and green onions. For the audio stream data, the audio understanding technology can be used to obtain, for example, the sound of cooking equipment starting up. Then, the description text for explaining the cooking video corresponding to the video stream data, audio stream data, and sensor data is generated through the TTS technology, and the cooking process video obtained by collecting the cooking process is obtained, and the cooking video with explanation is generated based on the audio and cooking process video converted from the description text.
[0047] Through the above steps, during the cooking process, the multimodal data obtained by the multimodal sensing technology can be used to generate corresponding description text, and then the description text can be converted into commentary audio, and a cooking video with commentary can be generated through the commentary audio and the video of the cooking process.
[0048] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0049] Figure 4 is a structural block diagram of a device for generating a target cooking video according to an embodiment of the present application (I), such as Figure 4 As shown, including:
[0050] The parsing module 42 is used to collect the cooking process of the target object to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object;
[0051] An acquisition module 44 is used to acquire an audio signal generated when the cooking device is working during the cooking process;
[0052] A first generating module 46, configured to generate a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal;
[0053] The second generating module 48 is used to generate a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video.
[0054] Through the above-mentioned device, the cooking process of the target object is collected to obtain the initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object and the cooking equipment used by the target object; the audio signal generated when the cooking equipment is working during the cooking process is obtained; a description text of the cooking process is generated based on the cooking actions, the cooking ingredients, the equipment data of the cooking equipment and the audio signal; and a target cooking video is generated according to the cooking commentary audio corresponding to the description text and the initial cooking video, which solves the technical problem of how to generate a cooking video with commentary audio in the related art, thereby achieving the purpose of generating a cooking video with commentary audio.
[0055] In an exemplary embodiment, the first generation module is also used to: when it is determined that the cooking action includes an action of processing the cooking ingredients, obtain a first cooking event corresponding to the cooking action and a second cooking event corresponding to the cooking ingredients; when it is determined that the first cooking event and the second cooking event both indicate the same cooking process, merge the first preset text corresponding to the cooking action and the second preset text corresponding to the cooking ingredients to obtain a first merged result; obtain a third preset text corresponding to the audio signal belonging to the same cooking process and a fourth preset text corresponding to the equipment data of the cooking equipment; based on the first merged result, the third preset text and the fourth preset text generate a description text of the cooking process.
[0056] Among them, the same cooking process indicated by the first cooking event and the second cooking event may be, for example, cooking. Then, the text corresponding to the sound of cooking (i.e., the third preset text corresponding to the audio signal) and the text corresponding to the equipment data of the range hood (i.e., the fourth preset text corresponding to the equipment data of the cooking equipment) are obtained, and according to the first merging result corresponding to the cooking action, the text corresponding to the cooking sound and the text corresponding to the equipment data of the range hood are used to generate a description text of the cooking process, for example, "The user is currently cooking and there is a lot of smoke."
[0057] In an exemplary embodiment, further, the above-mentioned first generating module is also used to: when it is determined that the cooking action includes an action of operating the cooking device, obtain a first cooking event corresponding to the cooking action, a third cooking event corresponding to the audio signal, and a fourth cooking event corresponding to the equipment data of the cooking device; when it is determined that the first cooking event, the third cooking event, and the fourth cooking event all indicate the same cooking process, merge the first preset text corresponding to the cooking action, the third preset text corresponding to the audio signal, and the fourth preset text corresponding to the equipment data of the cooking device to obtain a second merged result; obtain a second preset text corresponding to the cooking ingredients belonging to the same cooking process; and generate a description text of the cooking process based on the second merged result and the second preset text.
[0058] Among them, the above-mentioned first cooking event, the third cooking event and the fourth cooking event all indicate the same cooking process, for example, it may be putting ingredients into the cooking equipment, then the text corresponding to the ingredients when the ingredients are put into the cooking equipment (that is, the second preset text corresponding to the above-mentioned cooking ingredients) is obtained, and a description text is generated according to the second merged result corresponding to when the ingredients are put into the cooking equipment and the text corresponding to the ingredients when the ingredients are put into the cooking equipment, for example, it may be "the user is currently putting beef and carrots into the wok."
[0059] In an exemplary embodiment, the first generation module is also used to: obtain the interval time between different cooking actions; and when it is determined that the interval time is greater than a first preset value, add associated words between different cooking actions in the description text when the different cooking actions are switched.
[0060] It should be noted that the above-mentioned conjunctions can be understood as words that connect different actions and are used to improve the continuity between different cooking actions. They may include "next", "then", "subsequently", etc. This application does not impose any restrictions on this.
[0061] Optionally, in other embodiments, when it is determined that the interval time is greater than a first preset value, when the different cooking actions are switched, the number of associated words between different cooking actions in the description text is adjusted according to the difference between the interval time and the first preset value.
[0062] In an exemplary embodiment, the second generation module is further used to: parse the cooking commentary audio to obtain a first keyword of the cooking commentary audio, wherein the first keyword indicates the fifth cooking event of the cooking process; obtain a second keyword corresponding to the cooking action of the initial cooking video, wherein the second keyword indicates the sixth cooking event of the cooking process; and when it is determined that the first keyword and the second keyword indicate the same cooking event, generate a target cooking video based on the cooking commentary audio corresponding to the description text and the initial cooking video.
[0063] In an exemplary embodiment, further, the second generating module is also used to: obtain other actions in the initial cooking video except the cooking action of the target object; when it is determined that the target object switches from the cooking action to the other actions, obtain the duration after the target object switches from the cooking action to the other actions; when it is determined that the duration is greater than a second preset value, stop collecting the user's initial cooking video.
[0064] Furthermore, in other embodiments, when the target object switches from the other actions to the cooking action, the target cooking video may be regenerated. Alternatively, when it is determined that the duration is greater than a second preset value, the collection of the user's initial cooking video may be paused until the target object switches from the other actions to the cooking action, at which time the collection of the user's initial cooking video may continue.
[0065] Figure 5 FIG. 2 is a structural block diagram of a device for generating a target cooking video according to an embodiment of the present application. In an exemplary embodiment, Figure 5 As shown, the device for generating the target cooking video further includes a determination module 52, which is used to: determine whether the cooking device is pre-installed with a sensor according to the device type of the cooking device; when it is determined that the cooking device is pre-installed with a sensor, determine the sensor data of the sensor as the device data of the cooking device; when it is determined that the cooking device is not pre-installed with a sensor, monitor the cooking device using a monitoring device within a preset range of the cooking device, and determine the monitoring data obtained by monitoring the cooking device as the device data of the cooking device.
[0066] It should be noted that different types of cooking equipment are equipped with different types of sensors. For example, temperature sensors can be set for cooking equipment such as frying pans and stoves, humidity sensors can be set for cooking equipment such as rice cookers and steamers, and smoke sensors can be set for range hoods. This application does not impose any restrictions on this.
[0067] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0068] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0069] S1, collecting the cooking process of the target object to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object;
[0070] S2, obtaining an audio signal generated when the cooking device is working during the cooking process;
[0071] S3, generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal;
[0072] S4, generating a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video.
[0073] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0074] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0075] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0076] S1, collecting the cooking process of the target object to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object;
[0077] S2, obtaining an audio signal generated when the cooking device is working during the cooking process;
[0078] S3, generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal;
[0079] S4, generating a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video.
[0080] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0081] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0082] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0083] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for generating a target cooking video, characterized in that: include: The cooking process of the target object is collected to obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object; Acquiring an audio signal generated when the cooking device is working during the cooking process; generating a description text of the cooking process based on the cooking action, the cooking ingredients, the device data of the cooking device and the audio signal; Generate a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video; Generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal, including: When it is determined that the cooking action includes an action of processing the cooking ingredient, acquiring a first cooking event corresponding to the cooking action and a second cooking event corresponding to the cooking ingredient; When it is determined that the first cooking event and the second cooking event both indicate the same cooking process, merging the first preset text corresponding to the cooking action and the second preset text corresponding to the cooking ingredient to obtain a first merging result; Acquire a third preset text corresponding to the audio signal belonging to the same cooking process and a fourth preset text corresponding to the equipment data of the cooking equipment; According to the first merging result, the third preset text and the fourth preset text generate a description text of the cooking process.
2. The method for generating a target cooking video according to claim 1, characterized in that: Before generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal, the method further includes: determining whether the cooking device is pre-installed with a sensor according to the device type of the cooking device; In a case where it is determined that the cooking device is pre-installed with a sensor, determining sensor data of the sensor as device data of the cooking device; When it is determined that the cooking device is not pre-installed with a sensor, the cooking device is monitored using a monitoring device within a preset range of the cooking device, and monitoring data obtained by monitoring the cooking device is determined as device data of the cooking device.
3. The method for generating a target cooking video according to claim 1, characterized in that: Generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal, further comprising: When it is determined that the cooking action includes an action of operating the cooking device, acquiring a first cooking event corresponding to the cooking action, a third cooking event corresponding to the audio signal, and a fourth cooking event corresponding to the device data of the cooking device; When it is determined that the first cooking event, the third cooking event, and the fourth cooking event all indicate the same cooking process, merging the first preset text corresponding to the cooking action, the third preset text corresponding to the audio signal, and the fourth preset text corresponding to the device data of the cooking device to obtain a second merging result; Acquire a second preset text corresponding to the cooking ingredients belonging to the same cooking process; A description text of the cooking process is generated according to the second merging result and the second preset text.
4. The method for generating a target cooking video according to claim 1, characterized in that: In the process of generating a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal, the method further includes: Get the interval time between different cooking actions; When it is determined that the interval time is greater than a first preset value, when the different cooking actions are switched, associated words between the different cooking actions are added to the description text.
5. The method for generating a target cooking video according to claim 1, characterized in that: Generating a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video, including: Parsing the cooking commentary audio to obtain a first keyword of the cooking commentary audio, wherein the first keyword indicates a fifth cooking event of the cooking process; Acquire a second keyword corresponding to the cooking action of the initial cooking video, wherein the second keyword represents a sixth cooking event of the cooking process; In the case where it is determined that the first keyword and the second keyword indicate the same cooking event, a target cooking video is generated according to the cooking explanation audio corresponding to the description text and the initial cooking video.
6. The method for generating a target cooking video according to claim 1, characterized in that: In the process of generating a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video, the method further includes: Acquire other actions in the initial cooking video except the cooking action of the target object; When it is determined that the target object switches from the cooking action to the other action, obtaining a duration after the target object switches from the cooking action to the other action; When it is determined that the duration is greater than the second preset value, the collection of the user's initial cooking video is stopped.
7. A device for generating a target cooking video, characterized in that: include: A parsing module, configured to collect the cooking process of the target object and obtain an initial cooking video of the target object, wherein the initial cooking video includes the cooking actions of the target object, the cooking ingredients used by the target object, and the cooking equipment used by the target object; An acquisition module, used for acquiring an audio signal generated when the cooking device is working during the cooking process; A first generating module, configured to generate a description text of the cooking process based on the cooking action, the cooking ingredients, the equipment data of the cooking equipment and the audio signal; A second generating module, configured to generate a target cooking video according to the cooking explanation audio corresponding to the description text and the initial cooking video; The first generating module is also used for: when it is determined that the cooking action includes an action of processing the cooking ingredients, obtaining a first cooking event corresponding to the cooking action and a second cooking event corresponding to the cooking ingredients; when it is determined that the first cooking event and the second cooking event both indicate the same cooking process, merging a first preset text corresponding to the cooking action and a second preset text corresponding to the cooking ingredients to obtain a first merging result; obtaining a third preset text corresponding to the audio signal belonging to the same cooking process and a fourth preset text corresponding to the equipment data of the cooking equipment; and based on the first merging result, the third preset text and the fourth preset text generate a description text of the cooking process.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
