Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of a sample generation method according to some embodiments of the present disclosure.
The sample generation methods provided by some embodiments of the present disclosure are generally performed by a terminal device. The terminal device may be hardware or software. When the terminal device is hardware, it may be various electronic devices supporting video processing, including but not limited to a smart phone, a tablet computer, an electronic book reader, a vehicle-mounted terminal, and the like. When the terminal device is software, the terminal device can be installed in the electronic devices listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
As shown in fig. 1, the execution subject of the sample generation method may be a terminal device, such as a smartphone. The terminal device may first obtain training samples. The training sample includes a sample image 101 and corresponding label information. As an example, the annotation information may be annotation boxes 102, 103, 104, 105, 106, which are respectively used to characterize the positions of 5 objects "printer", "bell", "calendar" and "red flag" displayed in the sample image 101. Thereafter, at least two objects of the 5 objects may be combined to obtain a combined object. As an example, three objects of "bell", "calendar" and "red flag" may be combined to obtain a combined object. On the basis, the annotation information corresponding to the combined object can be determined, and the combined annotation information is obtained, for example, the annotation box 107. Finally, the sample image 101 and the combined annotation information 107 are determined as a new training sample.
With continued reference to fig. 2, a flow 200 of some embodiments of a sample generation method according to the present disclosure is shown. The sample generation method comprises the following steps:
step 201, a training sample is obtained.
In some embodiments, the executing entity of the sample generation method (e.g., the terminal device in fig. 1) may first obtain training samples. The training sample comprises a sample image and corresponding marking information, and the marking information is used for representing the positions of a plurality of (two or more) objects displayed in the sample image. In practice, the objects displayed in the sample image may include real objects such as people, articles, animals and plants, and may also be various virtual objects such as animated characters. The present disclosure is not limited thereto. On this basis, as an example, the annotation information may be a circumscribed rectangular frame of each of the plurality of objects displayed in the sample image. Of course, the label information may be coordinates of each object, and the like.
Step 202, at least two objects of the plurality of objects are combined to obtain a combined object.
In some embodiments, the execution subject may combine at least two objects of the plurality of objects to obtain a combined object. In practice, at least two objects of the plurality of objects may be determined in a variety of ways. For example, two objects closest in distance may be selected.
As an example, an image located at the center position of the sample image may be first selected as the first object. On the basis, the object closest to the first object is selected as the second object. Thereafter, at least two objects may be combined to obtain a combined object. In particular, at least two objects may be taken as a whole, i.e. a combined object.
Step 203, determining the labeling information corresponding to the combined object to obtain the combined labeling information.
In some embodiments, the execution subject may determine the label information corresponding to the combined object, and obtain the combined label information corresponding to the combined object. In practice, according to different labeling information, the execution main body may determine the labeling information corresponding to the combined object in various ways to obtain the combined labeling information. For example, in the case where the label information is a circumscribed rectangle frame, the circumscribed rectangle frame of the combined object may be determined according to the circumscribed rectangle frame of each of the at least two objects constituting the combined object. Specifically, as an example, a minimum bounding rectangle of bounding rectangle frames of respective ones of the at least two objects may be determined as the bounding rectangle frame of the combined object.
And step 204, determining the sample image and the combined annotation information as a new training sample.
In some embodiments, the execution subject may determine the sample image and the combined annotation information as a new training sample.
In particular, the target detection model can be trained by various machine learning methods by using the new training samples to improve the detection accuracy of the target detection model for salient objects, wherein the target detection model can comprise but is not limited to SSD, YO L O and the like.
Some embodiments of the present disclosure provide methods for improving the saliency of the combined objects in the entire sample image by combining the objects displayed in the sample image. Therefore, a foundation is provided for improving the accuracy of the significance detection model.
With further reference to fig. 3, a flow 300 of further embodiments of the sample generation methods of the present disclosure is illustrated. The process 300 of the sample generation method includes the following steps:
step 301, a training sample is obtained.
In some embodiments, the specific implementation of step 301 and the technical effect thereof may refer to step 201 in those embodiments corresponding to fig. 2, and are not described herein again.
Step 302, combining at least two objects of the plurality of objects to obtain a combined object, comprising the following substeps:
step 3021, selecting a target object from the plurality of objects, and performing the following combination steps:
in a first step, an object closest to a target object among a plurality of objects is determined. In particular, the distance of each of the plurality of objects from the target object may be determined separately. On the basis, the object closest to the target object is selected.
And secondly, combining the determined object with the target object to obtain a candidate combined object.
And thirdly, determining whether other objects exist in the preset range of the candidate combined object. In practice, the preset range can be set as required. For example, the preset range may be within a certain radius from the combined object. On this basis, it can be determined whether or not there are other objects than those constituting the combined object among the plurality of objects within the preset range of the combined object.
And fourthly, if the candidate combination object does not exist, determining the candidate combination object as the combination object.
Step 3022, if any, continues the combining step with the candidate combination object as the target object and the objects other than the target object and the object closest to the target object as the objects.
In some embodiments, if it is determined whether there are other objects within the preset range of the candidate combination object, the candidate combination object may be a target object, and a plurality of objects other than the target object and an object closest to the target object may be a plurality of objects, and the combining step may be continuously performed. Thus, step 3021 and step 3022 are executed in a loop until no other objects exist within the preset range of the candidate combined object, thereby obtaining a combined object.
Step 303, determining the labeling information corresponding to the combined object to obtain the combined labeling information.
Step 304, determining the sample image and the combined annotation information as a new training sample.
In some embodiments, the specific implementation of steps 303 and 304 and the technical effects thereof can refer to steps 203 and 204 in the embodiments corresponding to fig. 2, which are not described herein again.
Compared with the description of some embodiments corresponding to fig. 2, the combined object is finally obtained by selecting the target object and combining with other objects within the preset range. The combined object obtained in this way and combined objects obtained in other ways are more representative of salient content in the image. Therefore, the accuracy of the significance detection model is further improved.
With continued reference to fig. 4, an exemplary application scenario diagram is shown in which at least two of a plurality of objects are combined to obtain a combined object in some embodiments of the sample generation method of the present disclosure.
As shown in fig. 4, the sample image training sample includes a sample image 101 and corresponding annotation information. As an example, the annotation information may be annotation boxes 102, 103, 104, 105, 106 respectively used for characterizing the positions of 5 objects "car", "bell", "potted plant" and "light bulb" displayed in the sample image 101. Thereafter, at least two objects of the 5 objects may be combined to obtain a combined object.
As an example, a target object (taking the object "bell" as an example) may be selected first from 5 objects. Then, the object closest to the object "bell", that is, the object "bulb", among the 5 objects is determined. Then, the specified object "bulb" is combined with the target object "bell" to obtain a candidate combination object 107. Thereafter, it is determined whether there are other objects within a preset range of the candidate combination object 107. Namely, whether other objects exist in the preset range of the candidate combination object after the combination of the bulb and the bell. Taking the object "pot" within the preset range as an example, the candidate combination object 107 (i.e., the combination of "bulb" and "bell") may be the target object, and a plurality of objects other than the target object ("bell") and the object ("bulb") closest to the target object, i.e., "car", "clock" and "pot", may be the plurality of objects, and the combining step may be continued. That is, an object, i.e., an object "potting", among the plurality of objects ("cars", "clocks", "potting") that is closest to the target object, i.e., the candidate combination object (i.e., the combination of "bulbs" and "bells") is determined. Then, the object "pot culture" and the candidate combination object 107 (i.e., the combination of "bulb" and "bell") may be combined to obtain the candidate combination object 108, i.e., the combination of "bulb", "bell" and "pot culture". Then, it can be determined whether there are other objects within the preset range of the candidate combination object 108 after the combination of "bulb", "bell", and "potting". Taking "bell" and "car" not within the preset range as an example, the candidate combination object 108 may be determined as a combination object.
With further reference to fig. 5, as an implementation of the methods illustrated in the above figures, the present disclosure provides some embodiments of a sample generation apparatus, corresponding to those illustrated in fig. 2, which may be particularly applicable in various electronic devices.
As shown in fig. 5, the sample generation apparatus 500 of some embodiments of the present disclosure includes: an acquisition unit 501, a combining unit 502, an annotation information determination unit 503, and a sample generation unit 504. The obtaining unit 501 is configured to obtain a training sample, where the training sample includes a sample image and corresponding label information, and the label information is used to represent positions of a plurality of objects displayed in the sample image. A combining unit 502 configured to combine at least two objects of the plurality of objects to obtain a combined object. The annotation information determination unit 503 is configured to determine the annotation information corresponding to the combined object, and obtain the combined annotation information. A sample generation unit 504 configured to determine the sample image and the combined annotation information as a new training sample.
In an optional implementation of some embodiments, the combining unit 502 may be further configured to: selecting a target object from a plurality of objects, and performing the following combination steps: determining an object closest to the target object from among the plurality of objects; combining the determined object with the target object to obtain a candidate combined object; determining whether other objects exist in a preset range of the candidate combined object; if not, the candidate combination object is determined as the combination object.
In an optional implementation of some embodiments, the combining unit 502 may be further configured to: if the candidate combination object exists, the candidate combination object is used as a target object, a plurality of objects except the target object and the object closest to the target object are used as a plurality of objects, and the combination step is continuously executed.
In an optional implementation manner of some embodiments, the method may further include: a training unit (not shown in the figure). Wherein the training unit is configured to train the target detection model with the new training samples.
In an optional implementation of some embodiments, the annotation information is a bounding rectangle for each of a plurality of objects displayed in the sample image.
In some embodiments, the objects displayed in the sample image are combined to increase the saliency of the combined objects in the entire sample image. Therefore, a foundation is provided for improving the accuracy of the significance detection model.
Referring now to fig. 6, shown is a schematic diagram of an electronic device 600 suitable for use in implementing some embodiments of the present disclosure. The electronic device in some embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 607 including, for example, a liquid crystal display (L CD), speaker, vibrator, etc., storage devices 608 including, for example, a memory card, etc., and communication devices 609. the communication devices 609 may allow the electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). examples of communications networks include local area networks ("L AN"), wide area networks ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a training sample, wherein the training sample comprises a sample image and corresponding marking information, and the marking information is used for representing the positions of a plurality of objects displayed in the sample image; combining at least two objects in the plurality of objects to obtain a combined object; determining labeling information corresponding to the combined object to obtain combined labeling information; and determining the sample image and the combined marking information as a new training sample.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in any combination of one or more programming languages, including AN object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language, or similar programming languages.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a combining unit, a labeling information determination unit, and a sample generation unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, the acquisition unit may also be described as a "unit for acquiring training samples".
For example, without limitation, exemplary types of hardware logic that may be used include Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CP L D), and so forth.
According to one or more embodiments of the present disclosure, there is provided a sample generation method including: acquiring a training sample, wherein the training sample comprises a sample image and corresponding marking information, and the marking information is used for representing the positions of a plurality of objects displayed in the sample image; combining at least two objects in the plurality of objects to obtain a combined object; determining labeling information corresponding to the combined object to obtain combined labeling information; and determining the sample image and the combined marking information as a new training sample.
According to one or more embodiments of the present disclosure, combining at least two objects of a plurality of objects to obtain a combined object includes: selecting a target object from a plurality of objects, and performing the following combination steps: determining an object closest to the target object from among the plurality of objects; combining the determined object with the target object to obtain a candidate combined object; determining whether other objects exist in a preset range of the candidate combined object; if not, the candidate combination object is determined as the combination object.
According to one or more embodiments of the present disclosure, combining at least two objects of the plurality of objects to obtain a combined object further includes: if the candidate combination object exists, the candidate combination object is used as a target object, a plurality of objects except the target object and the object closest to the target object are used as a plurality of objects, and the combination step is continuously executed.
In accordance with one or more embodiments of the present disclosure, a method further comprises: and training the target detection model by using the new training sample.
According to one or more embodiments of the present disclosure, the annotation information is a circumscribed rectangular frame of each of the plurality of objects displayed in the sample image.
In accordance with one or more embodiments of the present disclosure, there is provided a sample generation apparatus including: the system comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is configured to acquire a training sample, wherein the training sample comprises a sample image and corresponding marking information, and the marking information is used for representing the positions of a plurality of objects displayed in the sample image; a combining unit configured to combine at least two objects of the plurality of objects to obtain a combined object; the annotation information determining unit is configured to determine annotation information corresponding to the combined object to obtain combined annotation information; a sample generation unit configured to determine the sample image and the combined annotation information as a new training sample.
According to one or more embodiments of the present disclosure, the combining unit may be further configured to: selecting a target object from a plurality of objects, and performing the following combination steps: determining an object closest to the target object from among the plurality of objects; combining the determined object with the target object to obtain a candidate combined object; determining whether other objects exist in a preset range of the candidate combined object; if not, the candidate combination object is determined as the combination object.
According to one or more embodiments of the present disclosure, the combining unit may be further configured to: if the candidate combination object exists, the candidate combination object is used as a target object, a plurality of objects except the target object and the object closest to the target object are used as a plurality of objects, and the combination step is continuously executed.
According to one or more embodiments of the present disclosure, the method may further include: and a training unit. Wherein the training unit is configured to train the target detection model with the new training samples.
According to one or more embodiments of the present disclosure, the annotation information is a circumscribed rectangular frame of each of the plurality of objects displayed in the sample image.
According to one or more embodiments of the present disclosure, there is provided an electronic device including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any above.
According to one or more embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as any one of the above.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.