Instruction data set construction method and device, equipment and medium
By performing target recognition and motion description processing on videos in the traffic field, and combining a large language model to generate an overall description of the video, it solves the problem of difficulty in taking into account video details and timing in the existing technology, and improves the accuracy of model training.
Patent Information
- Application Number
- CN202410855745.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-15
AI Technical Summary
It is difficult for the existing technology to take into account the details and timing information of the video in the construction of the video-text instruction data set in the transportation field, resulting in insufficient model training accuracy.
By performing target recognition on each frame of the image in the sample video, the target and position information are determined, and these information and the pre-saved motion description prompt words are input into the multi-modal large model to generate a sample motion description of each target, and the sample video is and motion description are saved into the instruction data set, and combined with the large language model to generate an overall description of the video, ensuring that the data set contains details and timing information.
The extraction effect of video content in the traffic field is improved, so that the constructed data set contains both detailed information and timing information, thereby better training multi-modal large models.
Smart Images

Figure CN118779654A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and medium for constructing an instruction data set. Background Art
[0002] With the development of technology, multimodal large models are widely used in various fields. Among them, the quality of instruction dataset construction seriously affects the ability of multimodal large models. For video instruction datasets, the content of the video is described from the overall perspective, which often cannot preserve the details well. In terms of task setting, there is no targeted design to improve the acquisition of details and temporal information.
[0003] When constructing a video-text instruction dataset for the transportation field, the detailed content of each frame in the video often cannot cover the key points that the video wants to express (such as dynamic information). However, the overall description of the entire video lacks details. Especially in vertical applications, in terms of domain data construction, the direction of key analysis is often required, and the existing instruction dataset construction method cannot take into account both details and timing at the same time. Summary of the invention
[0004] The present application provides a method, device, equipment and medium for constructing an instruction data set, so as to solve the problem that the method for constructing an instruction data set in the prior art cannot take into account both details and timing at the same time.
[0005] In a first aspect, an embodiment of the present application provides a method for constructing an instruction data set, the method comprising:
[0006] Perform target recognition on each frame of the sample video to determine the target contained in each frame and the corresponding position information;
[0007] Inputting the sample video, the targets and corresponding position information contained in each frame of the image, and a pre-saved first prompt word for prompting the generation of a motion description of each target into a multimodal large model, and obtaining each sample motion description corresponding to each target output by the multimodal large model;
[0008] The sample video and each sample motion description are correspondingly saved in an instruction data set.
[0009] In a second aspect, an embodiment of the present application further provides an instruction data set construction device, the device comprising:
[0010] The recognition module is used to perform target recognition on each frame of the sample video and determine the target contained in each frame and the corresponding position information;
[0011] The instruction data set construction module is used to input the sample video, the targets contained in each frame of the image and the corresponding position information, and the pre-saved first prompt word for prompting the generation of a motion description of each target into the multimodal large model, obtain each sample motion description corresponding to each target output by the multimodal large model; and save the sample video and each sample motion description correspondingly into the instruction data set.
[0012] In a third aspect, an embodiment of the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of the instruction data set construction method as described above when executing a computer program stored in the memory.
[0013] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the instruction data set construction method as described above.
[0014] In an embodiment of the present application, target recognition is performed on each frame of the sample video to determine the target contained in each frame and the corresponding position information; the sample video, the target contained in each frame and the corresponding position information and the first prompt word saved in advance for prompting the generation of the motion description of each target are input into the multimodal large model to obtain each sample motion description corresponding to each target output by the multimodal large model; the sample video and each sample motion description are correspondingly saved in the instruction data set. In an embodiment of the present application, the sample motion description corresponding to each target in the video is determined by the multimodal large model, and the video content in the transportation field is better extracted, so that the final constructed data contains both detailed information and timing information, which can better train the large model. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments 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.
[0016] Figure 1 A schematic diagram of a process for constructing an instruction data set provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of a sample video provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of a process for constructing an image text instruction dataset provided in an embodiment of the present application;
[0019] Figure 4 A schematic diagram of constructing an instruction data set provided in an embodiment of the present application;
[0020] Figure 5 A schematic diagram of the structure of an instruction data set construction device provided in an embodiment of the present application;
[0021] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0023] In order to take into account the details and timing of the video when constructing an instruction data set and improve the accuracy of subsequent model training, an embodiment of the present application provides an instruction data set construction method and device.
[0024] In an embodiment of the present application, target recognition is performed on each frame image in a sample video to determine the target contained in each frame image and the corresponding position information; the sample video, the target contained in each frame image and the corresponding position information and a pre-saved first prompt word for prompting the generation of a motion description of each target are input into a multimodal large model to obtain each sample motion description corresponding to each target output by the multimodal large model; the sample video and each sample motion description are correspondingly saved in an instruction data set.
[0025] Figure 1 A schematic diagram of a command data set construction process provided in an embodiment of the present application, the process includes:
[0026] S101: Perform target recognition on each frame of the sample video to determine the target contained in each frame and the corresponding position information.
[0027] An instruction data set construction method provided in an embodiment of the present application is applied to an electronic device, which may be a PC or a server.
[0028] In order to take into account the details and timing of the video when constructing the instruction data set and improve the accuracy of subsequent model training, in an embodiment of the present application, the electronic device performs target recognition on each frame image in the sample video to determine the target contained in each frame image and the corresponding position information.
[0029] Among them, the electronic device can use a small model to perform target recognition on each frame of the sample image, and can also use manual labeling to perform target recognition, which is not limited here.
[0030] When the electronic device performs target recognition on each frame of image, the electronic device can determine the rectangular area corresponding to the target contained in each frame of image, and determine the coordinates of any vertex of the rectangular area and the height and width of the rectangle.
[0031] For example, in an embodiment of the present application, the electronic device recognizes that a frame image contains a vehicle and determines that the location information of the vehicle is [x, y, w, h], where x is the horizontal coordinate of the rectangular area where the vehicle is located, y is the vertical coordinate of the rectangular area where the vehicle is located, w is the width of the rectangular area where the vehicle is located, and h is the height of the rectangular area where the vehicle is located.
[0032] S102: Input the sample video, the targets contained in each frame image and the corresponding position information, and the pre-saved first prompt word for prompting the generation of a motion description of each target into the multimodal large model, and obtain each sample motion description corresponding to each target output by the multimodal large model; save the sample video and each sample motion description correspondingly into the instruction data set.
[0033] In an embodiment of the present application, after the electronic device determines the targets contained in each frame image in the sample video and the corresponding position information, the electronic device can use a multimodal large model to determine the sample motion description corresponding to each target based on the targets contained in each frame image in the sample video and the corresponding position information, and save the sample data and the sample motion description corresponding to each target in the instruction data set accordingly, so that the model can be fine-tuned and trained subsequently based on the sample data and the sample motion description corresponding to each target.
[0034] Specifically, in an embodiment of the present application, the electronic device inputs the sample video, the targets contained in each frame image and the corresponding position information and the pre-saved first prompt word for prompting the generation of the motion description of each target into the multimodal large model. The multimodal large model determines that the current task is to generate a sample motion description for each target based on the first prompt word, and then the multimodal large model generates the motion description corresponding to each target based on the sample video, the targets contained in each frame image and the corresponding position information. The electronic device obtains each sample motion description corresponding to each target output by the multimodal large model, and saves the sample video and each sample motion description correspondingly into the instruction data set.
[0035] Figure 2 A schematic diagram of a sample video provided in an embodiment of the present application, such as the Figure 2As shown, the sample video contains four frames of images, on this basis, the electronic device inputs the sample video into the multimodal large model.
[0036] On this basis, electronic equipment will Figure 2 The corresponding sample video is input into the multimodal large model, and the electronic device will also input the first prompt word and the target and position information included in each frame image of the sample video into the multimodal large model.
[0037] Specifically, the first prompt input by the electronic device and the target and position information included in each frame of image are:
[0038] Prompt: Compare multiple frames of images and trajectory information to generate motion descriptions for the same target.
[0039] frame1:<im_start> XX.jpg<im_end> , <car>id1[x,y,w,h],id2[x,y,w,h],id3[x,y,w,h];
[0040] frame2:<im_start>XX.jpg<im_end>, <car>id1[x,y,w,h],id2[x,y,w,h],id3[x,y,w,h],
[0041] frame3:<im_start>XX.jpg<im_end>, <car>id1[x,y,w,h],id2[x,y,w,h],id3[x,y,w,h],
[0042] frame4:<im_start> XX.jpg<im_end> , <car>id1[x,y,w,h],id2[x,y,w,h],id3[x,y,w,h],id4[x,y,w,h].
[0043] Among them, Prompt is used to identify the first prompt word, "Compare multiple frames of images and trajectory information to generate motion descriptions for the same target" is the first prompt word, frame1, frame2, frame3 and frame4 are used to identify the first frame image, the second frame image, the third frame image and the fourth frame image respectively, id1, id2, id3, id4 represent each target respectively, and the following [x, y, w, h] is the corresponding location information.
[0044] Based on this, the motion description output by the multimodal large model can be:
[0045] Frame1: White van <id1>and white electric car <id2>They are all parked on the zebra crossing. There is an Audi SUV on the road behind. <id3>Driving.
[0046] Frame 2: Audi SUV <id3>Approaching white electric car <id2>, electric vehicles <id2>and vans <id1>Still parked in place.
[0047] Frame 3: Audi SUV <id3>White electric car <id2>Keep close, van <id1>Pull out to the middle of the intersection.
[0048] Frame 4: Audi SUV <id3>White electric car <id2>Still keeping a close distance, the van <id1>Passing the intersection, another white tram <id4>Drive straight ahead in the second lane on the right.
[0049] It should be noted that, in the embodiment of the present application, the first prompt word used to prompt the generation of the motion description of each target is not only one of the above examples, but can also be other words or sentences that can be used to indicate the generation of the motion description.
[0050] In an embodiment of the present application, a sample motion description corresponding to each target in the video is determined through a multimodal large model, so that the video content in the transportation field is better extracted, so that the final constructed data contains both detailed information and timing information, which can better train the large model.
[0051] In order to take into account the details and timing of the video when constructing the instruction data set and improve the accuracy of subsequent model training, based on the above embodiment, in the embodiment of the present application, the method further includes:
[0052] Obtaining a pre-saved video description corresponding to the sample video, an image description corresponding to each frame of the sample video, and a region description;
[0053] Input the video description, the image description and the region description corresponding to each frame of the image, and the pre-saved second prompt word for prompting the generation of the overall video description into the large model, and obtain the overall video description corresponding to the sample video output by the large model;
[0054] The sample video and the overall description of the video are correspondingly saved in the instruction data set.
[0055] In the embodiment of the present application, in addition to generating a sample motion description corresponding to each target in the sample video, the electronic device can also generate an overall description of the sample video.
[0056] Although in the existing related technology, the sample video can be directly input into the multimodal large model, so that the multimodal large model analyzes the sample video as a whole and outputs a video description corresponding to the sample video, the overall description obtained by directly analyzing the sample video by the multimodal large model is too general and cannot well display the information in the sample video.
[0057] Based on this, in order to better display the information contained in the sample video, in an embodiment of the present application, the electronic device can obtain a pre-saved video description corresponding to the sample video, an image description and an area description corresponding to each frame of the sample video; the electronic device inputs the video description, the image description and the area description corresponding to each frame of the image, and a pre-saved second prompt word for prompting the generation of an overall video description into the large model, and the large model generates and outputs an overall video description corresponding to the sample video; the electronic device obtains the overall video description, and saves the sample video and the overall video description corresponding to the instruction data set.
[0058] Among them, the video description input into the multimodal big model can be obtained by inputting a sample video into the multimodal big model and analyzing it by the multimodal big model, or it can be obtained by analyzing by technical personnel, or it can be obtained based on template summary, and there is no limitation here.
[0059] The image description and region description corresponding to each frame of the image input into the multimodal large model may be based on the output of the large model used to analyze the image, or may be obtained through analysis by technical personnel, or may be obtained based on template summary, without limitation here.
[0060] In a possible implementation, the electronic device may also separately input the image description corresponding to each frame of the sample video into the large model to obtain the overall video description corresponding to the sample video output by the large model. For example, the following content may be input into the large model:
[0061] System prompt: You are a text analysis assistant. Please extract the description of XX elements based on the detailed description of each frame of the video. Focus on describing the targets that appear in each frame and describe the changes of the targets in a dynamic way. For example, in the field of transportation: vehicle location information, crowd behavior, reaction, vehicle trajectory, and traffic condition description. Use the big model to filter the detailed description of each frame and remove excessive redundant information.
[0062] Frame 1: A white van and a white electric car are parked on the zebra crossing, and an Audi SUV is driving on the road behind.
[0063] Frame 2: The Audi SUV gradually approaches the white electric car, while the electric car and the van remain parked in their original positions.
[0064] Frame 3: The Audi SUV keeps a close distance to the white electric car. The van drives to the middle of the intersection. The driver of the Audi SUV has got out and opened the door.
[0065] Frame 4: The standing position of the personnel changes slightly, perhaps they are exchanging information or checking the damage of the vehicle.
[0066] Among them, system prompt is used to represent the second prompt word, and Frame1, Frame2, Frame3 and Frame4 are used to identify the image descriptions corresponding to the first frame, the second frame, the third frame and the fourth frame images respectively.
[0067] In order to take into account the details and timing of the video when constructing the instruction data set and improve the accuracy of subsequent model training, on the basis of the above embodiments, in an embodiment of the present application, the second prompt word also carries a sub-prompt word for deleting redundant information.
[0068] In an embodiment of the present application, the second prompt word used to prompt the generation of the overall description of the video may also carry a sub-prompt word for deleting redundant information, so that the large model can filter the information of the image description of each frame of the image and remove excessive redundant information.
[0069] In order to take into account the details and timing of the video when constructing the instruction data set and improve the accuracy of subsequent model training, on the basis of the above embodiments, in the embodiments of the present application, the large model is a language large model or a multimodal large model.
[0070] In an embodiment of the present application, when the electronic device generates an overall video description corresponding to the sample video based on the video description of the sample video, the image description corresponding to each frame image in the sample video, and the region description, since the formats of the video description, the image description corresponding to each frame image in the sample video, and the region description are all text, the big model used by the electronic device can be a language big model.
[0071] In addition, the electronic device may also use a multimodal large model to generate an overall video description corresponding to the sample video based on the video description of the sample video, the image description corresponding to each frame image in the sample video, and the region description, which is not limited here.
[0072] In order to take into account the details and timing of the video when constructing the instruction data set and improve the accuracy of subsequent model training, based on the above embodiments, in the embodiment of the present application, the method further includes:
[0073] For each frame of image, identify a target region of interest in the image, and mark the target region of interest in the image through a detection frame;
[0074] Sort each labeled frame of image according to the order of each frame of image in the sample video to obtain a candidate sample video;
[0075] Inputting the candidate sample video and a third prompt word for prompting the generation of a video region description corresponding to the region of interest into the multimodal large model, and obtaining a video region description output by the multimodal large model for the content in the detection frame annotated in each frame of the image;
[0076] The sample video and the video area description are correspondingly saved in the instruction data set.
[0077] In actual applications, some videos have complex content and many targets. It is difficult to describe all the contents comprehensively when generating descriptions, especially when constructing vertical domain instruction data for specific tasks. Complex and redundant descriptions are not conducive to drawing correct conclusions. Based on this, in an embodiment of the present application, the electronic device can also understand the region of interest in the sample video based on the multimodal large model to obtain a video region description of the region of interest.
[0078] Specifically, in an embodiment of the present application, for each frame of image, the electronic device identifies the target region of interest in the image, and marks the target region of interest in the image through a detection box; the electronic device sorts each marked frame of image according to the order of each frame of image in the sample video, obtains a candidate sample video, and inputs the candidate sample video and a third prompt word for prompting the generation of a video area description corresponding to the region of interest into the multimodal large model, so that the multimodal large model understands the region of interest in the sample video and obtains a video area description of the region of interest.
[0079] The electronic device obtains a video region description of the content in the detection frame marked for each frame of the image output by the multimodal large model, and saves the sample video and the video region description in a corresponding manner into an instruction data set.
[0080] In order to take into account the details and timing of the video when constructing the instruction data set and improve the accuracy of subsequent model training, based on the above embodiments, in the embodiment of the present application, the identifying the target region of interest in the image includes:
[0081] Input the image into the small model to detect the region of interest, and obtain the information of the region of interest output by the small model; or,
[0082] The pre-saved detection frame position information is obtained, and the area corresponding to the detection frame position information in the image is determined as the region of interest.
[0083] In an embodiment of the present application, the electronic device may use a small model to identify the region of interest in each frame of the image, and may also determine the region of interest by pre-configuring the detection frame position information.
[0084] Among them, the electronic device can use a small model to determine the area of interest in each frame of the image, and give the experience accumulated by the small model in video understanding to the large model in the form of boxes or coordinates to express understanding. This solution can accurately annotate the video. The electronic device first uses a small model or a rule to annotate the area of interest in the video frame, and then gives the annotated video frame to the large model to generate the corresponding description according to the instruction.
[0085] The electronic device determines the region of interest by pre-configuring the detection frame position information, and can generate a video region description at the same position. Specifically, the electronic device stores the detection frame position information, and the electronic device uses the detection frame to mark the region corresponding to the detection frame position information of each frame image of the sample video, thereby obtaining each marked frame image.
[0086] In order to take into account the details and timing of the video when constructing the instruction data set and improve the accuracy of subsequent model training, on the basis of the above embodiments, in the embodiment of the present application, the small model is a target detection model.
[0087] In an embodiment of the present application, when the electronic device determines the region of interest in each frame of an image based on a small model, the small model may be a target detection model.
[0088] The quality of instruction data construction seriously affects the capabilities of large models. For instruction data sets for images and videos, the content of the images and videos is described as a whole, and the details are often not well preserved. In terms of task setting, there is no targeted design to improve the acquisition of details and timing information. The embodiments of the present application make full use of the advantages of large and small models to improve the description of details and timing information. It is difficult to make specific judgments on some complex events through a single-frame image, and it is necessary to make answers based on a comprehensive understanding of multi-frame timing information. Therefore, the design improves the task of understanding video timing information, including: multi-frame image comparison; video understanding, complex reasoning; VQA; multi-round question and answer; multiple choice; detailed description; multiple choice. On the basis of single-frame image understanding, it is possible to pay attention to multi-frame information and achieve understanding and complex reasoning of videos.
[0089] Among them, the construction of image text instruction data can include five major steps: data collection, data cleaning and processing, image detailed description, instruction data construction, and quality control. Among them, data collection, cleaning, and processing are routine operations for data work. The detailed description of the image requires the use of LLM's understanding and generation capabilities to organize a detailed image description based on the annotated information such as caption (global, local), bbox or label (from small model detection, recognition; general data annotation; other large model annotation). Then guide LLM to build an instruction data set according to the task (target detection, recognition; attribute recognition; referring expression understanding; referring expression generation; counting; complex reasoning; VQA; OCR; multi-round question and answer; multiple choice; detailed description), and it is necessary to design context examples and system prompts for LLM according to the task.
[0090] Figure 3 A flowchart of the image text instruction data set construction provided in the embodiment of the present application is shown in the figure. Figure 3 As shown, the process includes screening sample images containing description, attributes, visual question and answer, target and category information from the annotation data and domain data, and generating a detailed description and / or area description of the sample image through a template or a language model, and saving the detailed description and / or area description of the sample image, the input context example and the system prompt as the instruction data corresponding to the sample image into the instruction data set.
[0091] The embodiment of the present application is a method for constructing an instruction data set that focuses on temporal information based on the fusion of large and small models. By constructing multi-task, multi-scenario, and multi-format instruction data, the multi-modal large model is fine-tuned to enable it to have the perception and cognition capabilities of images, especially videos. It belongs to the construction of large and small models combined with instruction data. The quality of instruction data construction directly affects the capabilities of the large model.
[0092] In the actual application process, the most important thing for applying a large model to a certain vertical field is to instill domain knowledge into the large model by constructing an instruction data set. The embodiment of the present application designs a detailed domain large model task planning, and adopts a combination of large and small models to construct an instruction data set that pays more attention to timing information. Among them, the tasks for constructing a single-frame image include: target detection and recognition; attribute recognition; referential expression understanding; referential expression generation; counting; complex reasoning; VQA; OCR; multi-round question and answer; multiple choices; detailed description. The tasks for video construction include: multi-frame image comparison; multi-frame comparison referential expression understanding; referential description extraction; video understanding, complex reasoning; VQA; multi-round question and answer; multiple choices; detailed description. By combining large and small models, an instruction data set is constructed for the above tasks to form a set of instruction data construction methods for image, video, and text multimodality. The instruction data constructed based on this scheme is used to fine-tune the multimodal large model. While improving the model's fine-grained understanding of images, it also greatly improves the understanding and complex reasoning of videos.
[0093] The instruction data set construction method provided in the embodiment of the present application can select different multiple tasks according to different vertical fields for constructing instruction data, and has strong generalization. The fine-tuned multimodal large model can enhance the ability to generalize and execute various task instructions, while also bridging the gap between user preferences and model outputs. The instruction data set is constructed by combining large and small models, and the prior knowledge accumulated by the small model is used as an initial screening, combined with the understanding and generalization advantages of the large model for instruction data set construction. And add a strategy for constructing temporal information data for videos to enhance the ability of multimodal large models to process videos and complex reasoning.
[0094] Figure 4 A schematic diagram of the construction of the instruction data set provided in the embodiment of the present application, such as the Figure 4 As shown, the construction of the instruction data set includes referential description extraction, multi-frame comparison referential expression understanding, and multi-frame description of the target area. Among them, referential description extraction is the process of generating the overall description corresponding to the sample video according to the video description corresponding to the sample video, the image description and region description corresponding to each frame image in the sample video; multi-frame comparison referential expression refers to the process of generating the sample motion description corresponding to each target according to the sample video, the target contained in each frame image in the sample video and the corresponding position information; multi-frame description of the target area refers to the process of generating the video area description according to the content in the area of interest of each frame image in the sample video.
[0095] Based on the above embodiments, Figure 5 A schematic diagram of the structure of an instruction data set construction device provided in an embodiment of the present application, the device comprising:
[0096] The recognition module 501 is used to perform target recognition on each frame of the sample video, and determine the target contained in each frame and the corresponding position information;
[0097] The instruction data set construction module 502 is used to input the sample video, the targets contained in each frame of the image and the corresponding position information, and the pre-saved first prompt word for prompting the generation of a motion description of each target into the multimodal large model, and obtain each sample motion description corresponding to each target output by the multimodal large model; and save the sample video and each sample motion description correspondingly into the instruction data set.
[0098] In a possible implementation, the instruction data set construction module 502 is also used to obtain a pre-saved video description corresponding to the sample video, an image description and a region description corresponding to each frame of the sample video; input the video description, the image description and the region description corresponding to each frame of the image, and a pre-saved second prompt word for prompting the generation of an overall video description into the large model, and obtain the overall video description corresponding to the sample video output by the large model; and save the sample video and the overall video description corresponding to the instruction data set.
[0099] In a possible implementation manner, the second prompt word further carries a sub-prompt word for deleting redundant information.
[0100] In a possible implementation, the large model is a language large model or a multimodal large model.
[0101] In a possible implementation, the recognition module 501 is further configured to recognize, for each frame of image, a target region of interest in the image, and mark the target region of interest in the image through a detection frame;
[0102] The instruction data set construction module 502 is also used to sort each labeled frame of the image according to the order of each frame of the image in the sample video to obtain a candidate sample video; input the candidate sample video and a third prompt word for prompting the generation of a video area description corresponding to the area of interest into the multimodal large model, and obtain the video area description of the content in the detection box labeled for each frame of the image output by the multimodal large model; and save the sample video and the video area description in the instruction data set accordingly.
[0103] In a possible implementation, the recognition module 501 is specifically used to input the image into a small model to perform region of interest detection and obtain information about the region of interest output by the small model; or, obtain pre-saved detection frame position information and determine the area corresponding to the detection frame position information in the image as the region of interest.
[0104] In a possible implementation, the small model is a target detection model.
[0105] Based on the above embodiments, the present application also provides an electronic device, Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, it includes: a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604;
[0106] The memory 603 stores a computer program. When the program is executed by the processor 601, the processor 601 executes the steps of the instruction data set construction method provided in the above embodiments.
[0107] Since the principle of solving the problem by the above electronic device is similar to the instruction data set construction method, the implementation of the above electronic device can refer to the embodiment of the method, and the repeated parts will not be repeated.
[0108] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 602 is used for communication between the above electronic device and other devices. The memory may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0109] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0110] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program executable by a processor. When the program runs on the processor, the processor implements the instruction data set construction method steps provided in the above embodiments.
[0111] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0112] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0113] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0115] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations. < / car> < / car> < / car> < / car>
Claims
1. A method for constructing an instruction data set, characterized in that: The method comprises: Perform target recognition on each frame of the sample video to determine the target contained in each frame and the corresponding position information; Inputting the sample video, the targets and corresponding position information contained in each frame of the image, and a pre-saved first prompt word for prompting the generation of a motion description of each target into a multimodal large model, and obtaining each sample motion description corresponding to each target output by the multimodal large model; The sample video and each sample motion description are correspondingly saved in an instruction data set.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining a pre-saved video description corresponding to the sample video, an image description corresponding to each frame of the sample video, and a region description; Input the video description, the image description and the region description corresponding to each frame of the image, and the pre-saved second prompt word for prompting the generation of the overall video description into the large model, and obtain the overall video description corresponding to the sample video output by the large model; The sample video and the overall description of the video are correspondingly saved in the instruction data set.
3. The method according to claim 2, characterized in that The second prompt word also carries a sub-prompt word for deleting redundant information.
4. The method according to claim 2, characterized in that: The large model is a language large model or a multimodal large model.
5. The method according to claim 1, characterized in that The method further comprises: For each frame of image, identify a target region of interest in the image, and mark the target region of interest in the image through a detection frame; Sort each labeled frame of image according to the order of each frame of image in the sample video to obtain a candidate sample video; Inputting the candidate sample video and a third prompt word for prompting the generation of a video region description corresponding to the region of interest into the multimodal large model, and obtaining a video region description output by the multimodal large model for the content in the detection frame annotated in each frame of the image; The sample video and the video area description are correspondingly saved in the instruction data set.
6. The method according to claim 5, characterized in that The identifying of the target region of interest in the image comprises: Input the image into the small model to detect the region of interest, and obtain the information of the region of interest output by the small model; or, The pre-saved detection frame position information is obtained, and the area corresponding to the detection frame position information in the image is determined as the region of interest.
7. The method according to claim 6, characterized in that The small model is a target detection model.
8. A device for constructing an instruction data set, characterized in that: The device comprises: The recognition module is used to perform target recognition on each frame of the sample video and determine the target contained in each frame and the corresponding position information; The instruction data set construction module is used to input the sample video, the targets contained in each frame of the image and the corresponding position information, and the pre-saved first prompt word for prompting the generation of a motion description of each target into the multimodal large model, obtain each sample motion description corresponding to each target output by the multimodal large model; and save the sample video and each sample motion description correspondingly into the instruction data set.
9. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is used to implement the steps of the instruction data set construction method as described in any one of claims 1 to 7 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the instruction data set construction method as described in any one of claims 1 to 7.
Citation Information
Cited By
Cabin wallpaper generation method and device, electronic equipment and storage medium
CN119741191A
A cockpit wallpaper generation method and device, electronic equipment and storage medium
CN119741191B
