WO2021139177A1 - Image augmentation method and apparatus, computer device, and storage medium - Google Patents

Image augmentation method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2021139177A1
WO2021139177A1 PCT/CN2020/111789 CN2020111789W WO2021139177A1 WO 2021139177 A1 WO2021139177 A1 WO 2021139177A1 CN 2020111789 W CN2020111789 W CN 2020111789W WO 2021139177 A1 WO2021139177 A1 WO 2021139177A1
Authority
WO
WIPO (PCT)
Prior art keywords
gpu
augmentation
image
task
cpu
Prior art date
Application number
PCT/CN2020/111789
Other languages
French (fr)
Chinese (zh)
Inventor
叶明�
陈欣
张国辉
宋晨
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021139177A1 publication Critical patent/WO2021139177A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to an image augmentation method, device, computer equipment, and storage medium.
  • Image augmentation refers to the generation of similar but different training samples by making a series of random changes to the training images, thereby expanding the size of the training data set.
  • Image augmentation is an important part of the current artificial intelligence model training. Through various augmentation of sample images, the final product accuracy can be significantly improved and its generalization ability in different business scenarios can be effectively improved.
  • image augmentation can be implemented by CPU (Central Processing Unit/Processor) or GPU (Graphics Processing Unit, image processor) calculations.
  • CPU Central Processing Unit/Processor
  • GPU Graphics Processing Unit, image processor
  • the embodiments of the present application provide an image augmentation method, device, computer equipment, and storage medium, aiming to solve the problems of slow CPU image augmentation speed and poor applicability of GUP image augmentation in the prior art.
  • an embodiment of the present application provides an image augmentation method, which includes:
  • the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks
  • sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
  • the first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs
  • the intermediate processing data is obtained after executing the GPU augmentation task.
  • an embodiment of the present application also provides an image augmentation device, which includes:
  • a receiving unit configured to receive an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
  • the first determining unit is configured to determine whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
  • the first distribution unit is configured to, if the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, obtain sample images from a preset sample library, and distribute the sample images to a preset The CPU in order to execute the non-GPU augmentation task on the sample image by the CPU;
  • the first storage unit is configured to store the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image of;
  • the second distribution unit is configured to obtain intermediate processing data from the data set, and distribute the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
  • the first sending unit is configured to store the first augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, the first augmented The image data is obtained after the GPU performs the GPU augmentation task on the intermediate processing data.
  • an embodiment of the present application also provides a computer device, including a memory and a processor connected to the memory; wherein, the memory is used to store a computer program; the processor is used to run the storage in the memory Computer program to perform the following steps:
  • the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks
  • sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
  • the first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs
  • the intermediate processing data is obtained after executing the GPU augmentation task.
  • the embodiments of the present application also provide a computer-readable storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
  • the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks
  • sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
  • the first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs
  • the intermediate processing data is obtained after executing the GPU augmentation task.
  • FIG. 1 is a schematic diagram of an application scenario of an image augmentation method provided by an embodiment of this application
  • FIG. 2 is a schematic flowchart of an image augmentation method provided by an embodiment of this application.
  • FIG. 3 is a schematic diagram of a sub-process of an image augmentation method provided by an embodiment of the application
  • FIG. 4 is a schematic diagram of a sub-process of an image augmentation method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of a sub-process of an image augmentation method provided by an embodiment of this application.
  • FIG. 6 is a schematic flowchart of an image augmentation method provided by another embodiment of this application.
  • FIG. 7 is a schematic block diagram of an image augmentation device provided by an embodiment of the application.
  • FIG. 8 is a schematic block diagram of a first sending unit of an image augmentation device according to an embodiment of the application.
  • FIG. 9 is a schematic block diagram of a first distribution unit of an image augmentation device provided by an embodiment of the application.
  • FIG. 10 is a schematic block diagram of a second distribution unit of an image augmentation device according to an embodiment of the application.
  • FIG. 11 is a schematic block diagram of an image augmentation device provided by another embodiment of this application.
  • FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of this application.
  • the term “if” can be interpreted as “when” or “once” or “in response to determination” or “in response to detection” depending on the context .
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • FIG. 1 is a schematic diagram of an application scenario of an image augmentation method provided by an embodiment of this application.
  • FIG. 2 is a schematic flowchart of an image augmentation method provided by an embodiment of the application. The image augmentation method is applied to the image augmentation server 1, and the image augmentation server 1 responds to the image augmentation request sent by the model training server 2 to process the image augmentation task.
  • FIG. 2 is a schematic flowchart of an image augmentation method provided by an embodiment of the present application. As shown in the figure, the method includes the following steps S1-S6.
  • the model training server refers to a server that performs model training tasks.
  • the model training task and the image augmentation task are deployed on different servers for execution.
  • the image augmentation server receives the image augmentation request sent by the model training server.
  • the image augmentation server refers to a server that performs image augmentation tasks.
  • the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task.
  • the image augmentation task can be, for example, tasks such as flipping, cropping, changing colors (adjusting brightness, contrast, saturation, and hue), superimposing, and combining images.
  • all image augmentation tasks can be processed by the CPU; and only a small part of the image augmentation tasks can be processed by the GPU (such as scaling and cropping).
  • the image augmentation task that can be processed by the GPU is defined as the GPU augmentation task.
  • the image augmentation tasks that cannot be processed by the GPU are defined as non-GPU augmentation tasks.
  • the image augmentation request includes the storage location of the sample image and the parameter settings for image augmentation.
  • the applicable probability of image augmentation can be selected between 0.0-1.0.
  • S2 Determine whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks.
  • the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks. It should be noted that GPU augmentation tasks and non-GPU augmentation tasks are preset by the user according to the processing capabilities of the GPU.
  • the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks
  • sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, so that The CPU performs the non-GPU augmentation task on the sample image.
  • sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, So that the CPU performs the non-GPU augmentation task on the sample image.
  • the storage location of the sample library is given in the image augmentation request, and the image augmentation server can obtain the sample library from the storage location.
  • the CPU includes multiple CPU execution threads, and the number of CPU execution threads is determined according to the number of CPU cores.
  • the above step S3 specifically includes the following steps: S31-S32.
  • the CPU execution thread in the idle state in the CPU is acquired as the target CPU execution thread.
  • the CPU executes the thread to obtain the task, it will mark itself as a working state, read the corresponding sample image, and perform augmentation processing on the sample image. After the task is processed, mark yourself as idle.
  • the image augmentation server allocates sample images to the target CPU execution thread. That is, real-time distribution of sample images to all CPU execution threads in an idle state can effectively improve processing efficiency.
  • S4 Store the intermediate processing data sent by the CPU in a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image.
  • the CPU obtains intermediate processing data after executing the non-GPU augmentation task on the sample image.
  • the intermediate processing data in the intermediate data set needs to be further processed by the GPU for image augmentation.
  • the image augmentation server obtains intermediate processing data from the intermediate data set, and distributes the intermediate processing data to a preset GPU.
  • the GPU augmentation task is executed by the GPU on the intermediate processing data.
  • the GPU includes multiple GPU execution threads, and the number of GPU execution threads is determined according to the number of GPU cores.
  • the above step S5 specifically includes the following steps: S41-S42.
  • the GPU execution thread in the idle state in the GPU is acquired as the target GPU execution thread.
  • the GPU execution thread obtains the task, it will mark itself as a working state, read the corresponding intermediate processing data, and further expand the intermediate processing data. After the task processing is completed, the GPU marks itself as an idle state.
  • the image augmentation server allocates intermediate processing data to the target GPU execution thread. That is, real-time allocation of intermediate processing data to all CPU execution threads in an idle state can effectively improve processing efficiency.
  • the GPU obtains the first augmented image data after executing the GPU augmentation task on the intermediate processing data.
  • the first augmented image data is obtained by the image augmentation server after executing all the image augmentation tasks in the image augmentation task set on the sample pictures.
  • the image augmentation server sends the augmented data set to the model training server, so that the model training server uses the first augmented image data in the augmented data set to train the model.
  • step S6 specifically includes the following steps: S51-S53.
  • model training server it is determined whether the model training server is deployed locally. That is, it is determined whether the model training server and the image augmentation server are deployed in the same local area network.
  • the augmented data set is sent to the model training server by way of shared memory.
  • Shared memory is a communication method between multiple processes under Unix. This method is usually used for communication between multiple processes of a program. In fact, multiple programs can also pass information through shared memory.
  • the augmented data set is sent to the model training server through RPC transmission or HTTP transmission.
  • RPC Remote Procedure Call Protocol
  • Remote Procedure Call Protocol is a protocol that requests services from remote computer programs through the network without needing to understand the underlying network technology.
  • HTTP Hyper Text Transfer Protocol, Hypertext Transfer Protocol
  • HTTP Hyper Text Transfer Protocol, Hypertext Transfer Protocol
  • the GPU augmentation task in the image augmentation request can be allocated to the GPU for processing, and the non-GPU augmentation tasks that the GPU cannot handle are handed over to the CPU for processing, so that the image augmentation server has both Strong applicability, and can maximize the efficiency of computing.
  • data augmentation and model training are processed on different servers, and the two do not interfere with each other, that is, they maintain their respective computing performance and greatly improve scalability.
  • the CPU image augmentation and GPU image augmentation are unified, which provides users with convenience in use.
  • FIG. 6 is a schematic flowchart of an image augmentation method provided by another embodiment of the present application. As shown in Fig. 6, the image augmentation method of this embodiment includes steps S61-S611. The steps S61-S66 are similar to the steps S1-S6 in the foregoing embodiment, and will not be repeated here. The steps S67-S611 added in this embodiment will be described in detail below.
  • the image augmentation task set does not include both GPU augmentation tasks and non-GPU augmentation tasks, it is determined whether the image augmentation task set includes only non-GPU augmentation tasks. If it does not include both GPU augmentation tasks and non-GPU augmentation tasks, it can only be that all are GPU augmentation tasks or all are non-GPU augmentation tasks.
  • sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, so that the CPU can The sample image performs the non-GPU augmentation task.
  • sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU so that the CPU Perform the non-GPU augmentation task on the sample image.
  • the storage location of the sample library is given in the image augmentation request, and the image augmentation server can obtain the sample library from the storage location.
  • the image augmentation server can obtain the sample library from the storage location.
  • the CPU obtains the second augmented image data after performing all non-GPU augmentation tasks on the sample image.
  • the second augmented image data is the final processing result of the sample image.
  • the image augmentation server stores the second augmented image data in a preset augmented data set, and sends the augmented data set to the model training server.
  • sample images are obtained from a preset sample library, and the sample images are distributed to a preset GPU, so that the GPU can The sample image performs the GPU augmentation task.
  • the storage location of the sample library is given in the image augmentation request, and the image augmentation server can obtain the sample library from the storage location.
  • all GPU augmentation tasks can be executed by the GPU to increase the computing speed.
  • the third augmented image data is obtained after the GPU performs all the GPU augmentation tasks on the sample image.
  • the third augmented image data is the final processing result of the sample image.
  • the image augmentation server stores the third augmented image data in a preset augmented data set, and sends the augmented data set to the model training server.
  • FIG. 7 is a schematic block diagram of an image augmentation device 60 provided by an embodiment of the present application. As shown in FIG. 7, corresponding to the above image augmentation method, the present application also provides an image augmentation device 60.
  • the image augmentation device 60 includes a unit for executing the above-mentioned image augmentation method, and the image augmentation device 60 may be configured in a server. Specifically, referring to FIG. 7, the image augmentation device 60 includes a receiving unit 61, a first determining unit 62, a first distributing unit 63, a first storage unit 64, a second distributing unit 65, and a first sending unit 66.
  • the receiving unit 61 is configured to receive an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
  • the first determining unit 62 is configured to determine whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
  • the first distribution unit 63 is configured to, if the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, obtain sample images from a preset sample library, and distribute the sample images to the preview Set a CPU to perform the non-GPU augmentation task on the sample image by the CPU;
  • the first storage unit 64 is configured to store the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is after the CPU performs the non-GPU augmentation task on the sample image owned;
  • the second distribution unit 65 is configured to obtain intermediate processing data from the data set, and distribute the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
  • the first sending unit 66 is configured to store the first augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, and the first augmented image data
  • the wide image data is obtained after the GPU performs the GPU augmentation task on the intermediate processing data.
  • the first sending unit 66 includes a second judging unit 661, a second sending unit 662, and a third sending unit 663.
  • the second judging unit 661 is used to judge whether the model training server is deployed locally.
  • the second sending unit 662 is configured to send the augmented data set to the model training server by way of shared memory if the model training server is deployed locally.
  • the third sending unit 663 is configured to send the augmented data set to the model training server through RPC transmission or HTTP transmission if the model training server is not deployed locally.
  • the CPU includes multiple CPU execution threads.
  • the first distribution unit 63 includes a first acquisition unit 631 and a first distribution unit 632.
  • the first obtaining unit 631 is configured to obtain a CPU execution thread in an idle state in the CPU as a target CPU execution thread
  • the first allocation unit 632 is configured to allocate sample images to the target CPU execution thread.
  • the GPU includes multiple GPU execution threads.
  • the second distribution unit 65 includes a second acquisition unit 651 and a second distribution unit 652.
  • the second obtaining unit 651 is configured to obtain a CPU execution thread in an idle state in the GPU as a target CPU execution thread
  • the second allocation unit 652 is configured to allocate intermediate processing data to the target GPU execution thread.
  • FIG. 11 is a schematic block diagram of an image augmentation device 60 provided by another embodiment of the present application. As shown in FIG. 11, the image augmentation device 60 of this embodiment adds a third judgment unit 67, a third distribution unit 68, a fourth transmission unit 69, a fourth distribution unit 610, and a fifth Sending unit 611.
  • the third determining unit 67 is configured to determine whether the image augmentation task set includes only non-GPU augmentation tasks if the image augmentation task set does not include both GPU augmentation tasks and non-GPU augmentation tasks.
  • the third distributing unit 68 is configured to, if the image augmentation task set contains only non-GPU augmentation tasks, obtain sample images from a preset sample library, and distribute the sample images to a preset CPU, The non-GPU augmentation task is executed by the CPU on the sample image.
  • the fourth sending unit 69 is configured to store the second augmented image data sent by the CPU in a preset augmented data set, and send the augmented data set to the model training server, and the second augmented image data
  • the wide image data is obtained after the CPU performs the non-GPU augmentation task on the sample image.
  • the fourth distribution unit 610 is configured to obtain sample images from a preset sample library if only GPU augmentation tasks are included in the image augmentation task set, and distribute the sample images to the preset GPU, The GPU performs the GPU augmentation task on the sample image.
  • the fifth sending unit 611 is configured to store the third augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, and the third augmented image data
  • the wide image data is obtained after the GPU performs the GPU augmentation task on the sample image.
  • the above-mentioned image augmentation device 60 may be implemented in the form of a computer program, and the computer program may be run on the computer device shown in FIG. 12.
  • the computer device 500 may be a terminal or a server, where the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
  • the server can be an independent server or a server cluster composed of multiple servers.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the processor 502 can execute an image augmentation method.
  • the processor 502 is used to provide calculation and control capabilities to support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can execute an image augmentation method.
  • the network interface 505 is used for network communication with other devices.
  • the structure shown in FIG. 12 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied.
  • the specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the processor 502 is configured to run a computer program 5032 stored in the memory to implement the image augmentation method of the present application.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • the computer program may be stored in a storage medium, and the storage medium is a computer-readable storage medium.
  • the computer program is executed by at least one processor in the computer system to implement the process steps of the foregoing method embodiment.
  • the storage medium may be a computer-readable storage medium.
  • the storage medium stores a computer program.
  • the processor executes the image augmentation method of the present application.
  • the storage medium is a physical, non-transitory storage medium, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk, etc., which can store program codes. medium.
  • a physical, non-transitory storage medium such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk, etc., which can store program codes. medium.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of each unit is only a logical function division, and there may be other division methods in actual implementation.
  • multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the steps in the method in the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs.
  • the units in the devices in the embodiments of the present application may be combined, divided, and deleted according to actual needs.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium.
  • the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Processing Or Creating Images (AREA)

Abstract

Provided are an image augmentation method and apparatus, a computer device, and a storage medium. The method belongs to the technical field of artificial intelligence. The method comprises: receiving an image augmentation request; determining whether an image augmentation task set simultaneously includes a GPU augmentation task and a non-GPU augmentation task; if so, acquiring sample images from a sample library, and distributing the sample images to a preset CPU; storing intermediate processing data sent by the CPU in an intermediate data set; acquiring the intermediate processing data from the intermediate data set, and distributing the intermediate processing data to a GPU; and storing first augmented image data, sent by the GPU, in a preset augmented data set, and sending the augmented data set to a model training server.

Description

图像增广方法、装置、计算机设备及存储介质Image augmentation method, device, computer equipment and storage medium
本申请要求于2020年7月29日提交中国专利局、申请号为202010744544.4、申请名称为“图像增广方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on July 29, 2020, the application number is 202010744544.4, and the application name is "Image augmentation method, device, computer equipment and storage medium", the entire content of which is incorporated by reference Incorporated in this application.
技术领域Technical field
本申请涉及人工智能技术领域,尤其涉及一种图像增广方法、装置、计算机设备及存储介质。This application relates to the field of artificial intelligence technology, and in particular to an image augmentation method, device, computer equipment, and storage medium.
背景技术Background technique
图像增广(image augmentation)是指通过对训练图像做一系列随机改变,来产生相似但又不同的训练样本,从而扩大训练数据集的规模。图像增广是目前人工智能模型训练的一个重要环节,通过对样本图像的各种增广,可以显著提升最终的产品精度并有效提升其在不同业务场景下的泛化能力。Image augmentation refers to the generation of similar but different training samples by making a series of random changes to the training images, thereby expanding the size of the training data set. Image augmentation is an important part of the current artificial intelligence model training. Through various augmentation of sample images, the final product accuracy can be significantly improved and its generalization ability in different business scenarios can be effectively improved.
目前,图像增广可通过CPU(Central Processing Unit/Processor,中央处理器)或者GPU(Graphics Processing Unit,图像处理器)计算实现。发明人意识到,CPU能够处理绝大多数的图像增广任务,而其缺点在于处理速度较慢。GPU的处理速度较快,然而其只能处理少部分的图像增广任务,适用性较差。At present, image augmentation can be implemented by CPU (Central Processing Unit/Processor) or GPU (Graphics Processing Unit, image processor) calculations. The inventor realized that the CPU can handle most image augmentation tasks, but its disadvantage is that the processing speed is relatively slow. The GPU has a faster processing speed, but it can only handle a small number of image augmentation tasks, and its applicability is poor.
发明内容Summary of the invention
本申请实施例提供了一种图像增广方法、装置、计算机设备及存储介质,旨在解决现有技术中,CPU图像增广速度慢以及GUP图像增广适用性差的问题。The embodiments of the present application provide an image augmentation method, device, computer equipment, and storage medium, aiming to solve the problems of slow CPU image augmentation speed and poor applicability of GUP image augmentation in the prior art.
第一方面,本申请实施例提供了一种图像增广方法,其包括:In the first aspect, an embodiment of the present application provides an image augmentation method, which includes:
接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;Receiving an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;Judging whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像 执行所述非GPU增广任务;If the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;Storing the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image;
从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;Acquiring intermediate processing data from the intermediate data set, and distributing the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs The intermediate processing data is obtained after executing the GPU augmentation task.
第二方面,本申请实施例还提供了一种图像增广装置,其包括:In the second aspect, an embodiment of the present application also provides an image augmentation device, which includes:
接收单元,用于接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;A receiving unit, configured to receive an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
第一判断单元,用于判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;The first determining unit is configured to determine whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
第一分发单元,用于若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;The first distribution unit is configured to, if the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, obtain sample images from a preset sample library, and distribute the sample images to a preset The CPU in order to execute the non-GPU augmentation task on the sample image by the CPU;
第一存储单元,用于将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;The first storage unit is configured to store the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image of;
第二分发单元,用于从所述数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;The second distribution unit is configured to obtain intermediate processing data from the data set, and distribute the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
第一发送单元,用于将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first sending unit is configured to store the first augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, the first augmented The image data is obtained after the GPU performs the GPU augmentation task on the intermediate processing data.
第三方面,本申请实施例还提供了一种计算机设备,包括存储器以及与所述存储器相连的处理器;其中,所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行如下步骤:In a third aspect, an embodiment of the present application also provides a computer device, including a memory and a processor connected to the memory; wherein, the memory is used to store a computer program; the processor is used to run the storage in the memory Computer program to perform the following steps:
接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;Receiving an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;Judging whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样 本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;If the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;Storing the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image;
从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;Acquiring intermediate processing data from the intermediate data set, and distributing the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs The intermediate processing data is obtained after executing the GPU augmentation task.
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器执行以下步骤:In a fourth aspect, the embodiments of the present application also provide a computer-readable storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;Receiving an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;Judging whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;If the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;Storing the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image;
从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;Acquiring intermediate processing data from the intermediate data set, and distributing the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs The intermediate processing data is obtained after executing the GPU augmentation task.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的一种图像增广方法的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of an image augmentation method provided by an embodiment of this application;
图2为本申请实施例提供的一种图像增广方法的流程示意图;2 is a schematic flowchart of an image augmentation method provided by an embodiment of this application;
图3为本申请实施例提供的一种图像增广方法的子流程示意图;FIG. 3 is a schematic diagram of a sub-process of an image augmentation method provided by an embodiment of the application;
图4为本申请实施例提供的一种图像增广方法的子流程示意图;4 is a schematic diagram of a sub-process of an image augmentation method provided by an embodiment of the application;
图5为本申请实施例提供的一种图像增广方法的子流程示意图;FIG. 5 is a schematic diagram of a sub-process of an image augmentation method provided by an embodiment of this application;
图6为本申请另一实施例提供的一种图像增广方法的流程示意图;6 is a schematic flowchart of an image augmentation method provided by another embodiment of this application;
图7为本申请实施例提供的一种图像增广装置的示意性框图;FIG. 7 is a schematic block diagram of an image augmentation device provided by an embodiment of the application;
图8为本申请实施例提供的一种图像增广装置的第一发送单元的示意性框图;FIG. 8 is a schematic block diagram of a first sending unit of an image augmentation device according to an embodiment of the application;
图9为本申请实施例提供的一种图像增广装置的第一分发单元的示意性框图;FIG. 9 is a schematic block diagram of a first distribution unit of an image augmentation device provided by an embodiment of the application;
图10为本申请实施例提供的一种图像增广装置的第二分发单元的示意性框图;FIG. 10 is a schematic block diagram of a second distribution unit of an image augmentation device according to an embodiment of the application;
图11为本申请另一实施例提供的一种图像增广装置的示意性框图;FIG. 11 is a schematic block diagram of an image augmentation device provided by another embodiment of this application;
图12为本申请实施例提供的一种计算机设备的示意性框图。FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of this application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and appended claims, the terms "including" and "including" indicate the existence of the described features, wholes, steps, operations, elements and/or components, but do not exclude one or The existence or addition of multiple other features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification of this application and the appended claims, unless the context clearly indicates other circumstances, the singular forms "a", "an" and "the" are intended to include plural forms.
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should be further understood that the term "and/or" used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations .
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "once" or "in response to determination" or "in response to detection" depending on the context . Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
请参阅图1和图2,图1为本申请实施例提供的一种图像增广方法的应用场景示意图。 图2为本申请实施例提供的图像增广方法的示意性流程图。该图像增广方法应用于图像增广服务器1中,图像增广服务器1响应模型训练服务器2发送的图像增广请求而处理图像增广任务。Please refer to FIG. 1 and FIG. 2. FIG. 1 is a schematic diagram of an application scenario of an image augmentation method provided by an embodiment of this application. FIG. 2 is a schematic flowchart of an image augmentation method provided by an embodiment of the application. The image augmentation method is applied to the image augmentation server 1, and the image augmentation server 1 responds to the image augmentation request sent by the model training server 2 to process the image augmentation task.
图2是本申请实施例提供的一种图像增广方法的流程示意图。如图所示,该方法包括以下步骤S1-S6。FIG. 2 is a schematic flowchart of an image augmentation method provided by an embodiment of the present application. As shown in the figure, the method includes the following steps S1-S6.
S1,接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务。S1. Receive an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task.
具体实施中,模型训练服务器是指执行模型训练任务的服务器。本申请实施例中,将模型训练任务与图像增广任务部署在不同的服务器上执行。In specific implementation, the model training server refers to a server that performs model training tasks. In the embodiment of the present application, the model training task and the image augmentation task are deployed on different servers for execution.
图像增广服务器接收模型训练服务器发送的图像增广请求。图像增广服务器是指执行图像增广任务的服务器。图像增广请求中包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务。图像增广任务可例如为对图像进行翻转、剪裁、改变颜色(调节亮度、对比度、饱和度和色调)叠加、组合等任务。目前,图像增广任务均可由CPU处理;而只有少部分图像增广任务可由GPU处理(例如缩放以及剪裁)。本申请实施例中,将可由GPU处理的图像增广任务定义为GPU增广任务。将不能由GPU处理的图像增广任务定义为非GPU增广任务。The image augmentation server receives the image augmentation request sent by the model training server. The image augmentation server refers to a server that performs image augmentation tasks. The image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task. The image augmentation task can be, for example, tasks such as flipping, cropping, changing colors (adjusting brightness, contrast, saturation, and hue), superimposing, and combining images. At present, all image augmentation tasks can be processed by the CPU; and only a small part of the image augmentation tasks can be processed by the GPU (such as scaling and cropping). In the embodiment of the present application, the image augmentation task that can be processed by the GPU is defined as the GPU augmentation task. The image augmentation tasks that cannot be processed by the GPU are defined as non-GPU augmentation tasks.
进一步需要说明的是,图像增广请求中包含样本图像的存储位置以及图像增广的参数设定。例如,图像增广适用的概率,可在0.0-1.0之间选择。增广的可配置参数(例如亮度对比度增广(Brightness Contrast)中的brightness=[0.8,1.2],表示亮度值会在每次增广中,动态在0.8-1.2之间随机)It should be further noted that the image augmentation request includes the storage location of the sample image and the parameter settings for image augmentation. For example, the applicable probability of image augmentation can be selected between 0.0-1.0. Configurable parameters for augmentation (for example, brightness=[0.8,1.2] in Brightness Contrast, which means that the brightness value will be in each augmentation, and the dynamics will be random between 0.8-1.2)
S2,判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务。S2: Determine whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks.
具体实施中,判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务。需要说明的是,GPU增广任务以及非GPU增广任务是由用户根据GPU的处理能力预先设定的。In specific implementation, it is determined whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks. It should be noted that GPU augmentation tasks and non-GPU augmentation tasks are preset by the user according to the processing capabilities of the GPU.
S3,若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务。S3: If the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, so that The CPU performs the non-GPU augmentation task on the sample image.
具体实施中,如果所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务。In specific implementation, if the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, So that the CPU performs the non-GPU augmentation task on the sample image.
图像增广请求中给出了样本库的存储位置,图像增广服务器可从该存储位置获取样本库。The storage location of the sample library is given in the image augmentation request, and the image augmentation server can obtain the sample library from the storage location.
参见图3,在一实施例中,所述CPU包括多个CPU执行线程,CPU执行线程的数量根据CPU的核数确定。在本实施例中,以上步骤S3具体包括如下步骤:S31-S32。Referring to FIG. 3, in an embodiment, the CPU includes multiple CPU execution threads, and the number of CPU execution threads is determined according to the number of CPU cores. In this embodiment, the above step S3 specifically includes the following steps: S31-S32.
S31,获取所述CPU中处于空闲状态的CPU执行线程作为目标CPU执行线程。S31: Obtain a CPU execution thread in an idle state in the CPU as a target CPU execution thread.
具体实施中,获取所述CPU中处于空闲状态的CPU执行线程作为目标CPU执行线程。In specific implementation, the CPU execution thread in the idle state in the CPU is acquired as the target CPU execution thread.
需要说明的,CPU执行线程得到任务后,会将自己标志为工作状态,并读取对应的样本图像,并对样本图像进行增广处理。任务处理完成后,将自己标志为空闲状态。It should be noted that after the CPU executes the thread to obtain the task, it will mark itself as a working state, read the corresponding sample image, and perform augmentation processing on the sample image. After the task is processed, mark yourself as idle.
S32,向所述目标CPU执行线程分配样本图像。S32: Allocate sample images to the target CPU execution thread.
具体实施中,图像增广服务器向所述目标CPU执行线程分配样本图像。即实时向所有处于空闲状态的CPU执行线程分配样本图像,可有效提高处理效率。In specific implementation, the image augmentation server allocates sample images to the target CPU execution thread. That is, real-time distribution of sample images to all CPU execution threads in an idle state can effectively improve processing efficiency.
S4,将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的。S4: Store the intermediate processing data sent by the CPU in a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image.
具体实施中,CPU对所述样本图像执行所述非GPU增广任务后得到将得到中间处理数据。将中间处理数据储存到预设的中间数据集合中。中间数据集合中的中间处理数据还需由GPU进一步进行图像增广处理。In a specific implementation, the CPU obtains intermediate processing data after executing the non-GPU augmentation task on the sample image. Store the intermediate processing data in the preset intermediate data collection. The intermediate processing data in the intermediate data set needs to be further processed by the GPU for image augmentation.
S5,从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务。S5. Obtain intermediate processing data from the intermediate data set, and distribute the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data.
具体实施中,图像增广服务器从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU。由所述GPU对所述中间处理数据执行所述GPU增广任务。In specific implementation, the image augmentation server obtains intermediate processing data from the intermediate data set, and distributes the intermediate processing data to a preset GPU. The GPU augmentation task is executed by the GPU on the intermediate processing data.
参见图4,在一实施例中,所述GPU包括多个GPU执行线程,GPU执行线程的数量根据GPU的核数确定。以上步骤S5具体包括如下步骤:S41-S42。Referring to FIG. 4, in an embodiment, the GPU includes multiple GPU execution threads, and the number of GPU execution threads is determined according to the number of GPU cores. The above step S5 specifically includes the following steps: S41-S42.
S41,获取所述GPU中处于空闲状态的GPU执行线程作为目标GPU执行线程。S41: Obtain a GPU execution thread in an idle state in the GPU as a target GPU execution thread.
具体实施中,获取所述GPU中处于空闲状态的GPU执行线程作为目标GPU执行线程。In specific implementation, the GPU execution thread in the idle state in the GPU is acquired as the target GPU execution thread.
需要说明的,GPU执行线程得到任务后,会将自己标志为工作状态,并读取对应的中间处理数据,并对中间处理数据进一步进行增广处理。任务处理完成后,GPU将自己标志为空闲状态。It should be noted that after the GPU execution thread obtains the task, it will mark itself as a working state, read the corresponding intermediate processing data, and further expand the intermediate processing data. After the task processing is completed, the GPU marks itself as an idle state.
S42,向所述目标GPU执行线程分配中间处理数据。S42: Allocate intermediate processing data to the target GPU execution thread.
具体实施中,图像增广服务器向所述目标GPU执行线程分配中间处理数据。即实时向所有处于空闲状态的CPU执行线程分配中间处理数据,可有效提高处理效率。In specific implementation, the image augmentation server allocates intermediate processing data to the target GPU execution thread. That is, real-time allocation of intermediate processing data to all CPU execution threads in an idle state can effectively improve processing efficiency.
S6,将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。S6. Store the first augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, where the first augmented image data is the Obtained after the GPU performs the GPU augmentation task on the intermediate processing data.
具体实施中,GPU对所述中间处理数据执行所述GPU增广任务后得到第一增广图像数据。第一增广图像数据是图像增广服务器对样本图片执行完图像增广任务集合中的所有图像增广任务后得到的。图像增广服务器将增广数据集合发送给模型训练服务器,以由模型训练服务器使用增广数据集合中的第一增广图像数据训练模型。In specific implementation, the GPU obtains the first augmented image data after executing the GPU augmentation task on the intermediate processing data. The first augmented image data is obtained by the image augmentation server after executing all the image augmentation tasks in the image augmentation task set on the sample pictures. The image augmentation server sends the augmented data set to the model training server, so that the model training server uses the first augmented image data in the augmented data set to train the model.
参见图5,在一实施例中,以上步骤S6具体包括如下步骤:S51-S53。Referring to Fig. 5, in one embodiment, the above step S6 specifically includes the following steps: S51-S53.
S51,判断模型训练服务器是否部署在本地。S51: Determine whether the model training server is deployed locally.
具体实施中,判断模型训练服务器是否部署在本地。即,判断模型训练服务器是否与图像增广服务器部署在同一局域网内。In specific implementation, it is determined whether the model training server is deployed locally. That is, it is determined whether the model training server and the image augmentation server are deployed in the same local area network.
S52,若模型训练服务器部署在本地,通过共享内存的方式将所述增广数据集合发送给模型训练服务器。S52: If the model training server is deployed locally, the augmented data set is sent to the model training server by way of shared memory.
具体实施中,若模型训练服务器部署在本地,则通过共享内存的方式将所述增广数据集合发送给模型训练服务器。In specific implementation, if the model training server is deployed locally, the augmented data set is sent to the model training server by way of shared memory.
共享内存是Unix下的多进程之间的通信方法,这种方法通常用于一个程序的多进程间通信,实际上多个程序间也可以通过共享内存来传递信息。Shared memory is a communication method between multiple processes under Unix. This method is usually used for communication between multiple processes of a program. In fact, multiple programs can also pass information through shared memory.
S53,若模型训练服务器不是部署在本地,通过RPC传输或者HTTP传输的方式将所述增广数据集合发送给模型训练服务器。S53: If the model training server is not deployed locally, send the augmented data set to the model training server through RPC transmission or HTTP transmission.
具体实施中,若模型训练服务器不是部署在本地,通过RPC传输或者HTTP传输的方式将所述增广数据集合发送给模型训练服务器。RPC(Remote Procedure Call Protocol,远程过程调用协议)是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议。HTTP(Hyper Text Transfer Protocol,超文本传输协议)是因特网上应用最为广泛的一种网络传输协议,其基于TCP/IP通信协议来传递数据。In specific implementation, if the model training server is not deployed locally, the augmented data set is sent to the model training server through RPC transmission or HTTP transmission. RPC (Remote Procedure Call Protocol, Remote Procedure Call Protocol) is a protocol that requests services from remote computer programs through the network without needing to understand the underlying network technology. HTTP (Hyper Text Transfer Protocol, Hypertext Transfer Protocol) is the most widely used network transmission protocol on the Internet, which transfers data based on the TCP/IP communication protocol.
通过应用本实施例的技术方案,可实现将图像增广请求中的GPU增广任务分配给GPU处理,将GPU无法处理的非GPU增广任务交给CPU处理,从而使得图像增广服务器既具有很强的适用性,又能够最大程度提高运算的效率。同时,将数据增广与模型训练分别在不同的服务器上处理,二者互不干扰,即保持了各自的运算性能,又极大的提高了可扩展性。进一步地,统一了CPU图像增广以及GPU图像增广,为用户提供了使用上的便利性。By applying the technical solution of this embodiment, the GPU augmentation task in the image augmentation request can be allocated to the GPU for processing, and the non-GPU augmentation tasks that the GPU cannot handle are handed over to the CPU for processing, so that the image augmentation server has both Strong applicability, and can maximize the efficiency of computing. At the same time, data augmentation and model training are processed on different servers, and the two do not interfere with each other, that is, they maintain their respective computing performance and greatly improve scalability. Furthermore, the CPU image augmentation and GPU image augmentation are unified, which provides users with convenience in use.
图6是本申请另一实施例提供的一种图像增广方法的流程示意图。如图6所示,本实施 例的图像增广方法包括步骤S61-S611。其中步骤S61-S66与上述实施例中的步骤S1-S6类似,在此不再赘述。下面详细说明本实施例中所增加的步骤S67-S611。FIG. 6 is a schematic flowchart of an image augmentation method provided by another embodiment of the present application. As shown in Fig. 6, the image augmentation method of this embodiment includes steps S61-S611. The steps S61-S66 are similar to the steps S1-S6 in the foregoing embodiment, and will not be repeated here. The steps S67-S611 added in this embodiment will be described in detail below.
S67,若所述图像增广任务集合中不是同时包含GPU增广任务以及非GPU增广任务,判断所述图像增广任务集合中是否只包含非GPU增广任务。S67: If the image augmentation task set does not include both GPU augmentation tasks and non-GPU augmentation tasks, it is determined whether the image augmentation task set includes only non-GPU augmentation tasks.
具体实施中,若所述图像增广任务集合中不是同时包含GPU增广任务以及非GPU增广任务,判断所述图像增广任务集合中是否只包含非GPU增广任务。若不是同时包含GPU增广任务以及非GPU增广任务,则只能为全部都是GPU增广任务,或者全部都是非GPU增广任务。In specific implementation, if the image augmentation task set does not include both GPU augmentation tasks and non-GPU augmentation tasks, it is determined whether the image augmentation task set includes only non-GPU augmentation tasks. If it does not include both GPU augmentation tasks and non-GPU augmentation tasks, it can only be that all are GPU augmentation tasks or all are non-GPU augmentation tasks.
S68,若所述图像增广任务集合中只包含非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务。S68: If only non-GPU augmentation tasks are included in the image augmentation task set, sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU, so that the CPU can The sample image performs the non-GPU augmentation task.
具体实施中,如果所述图像增广任务集合中只包含非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务。In specific implementation, if the image augmentation task set contains only non-GPU augmentation tasks, sample images are obtained from a preset sample library, and the sample images are distributed to a preset CPU so that the CPU Perform the non-GPU augmentation task on the sample image.
图像增广请求中给出了样本库的存储位置,图像增广服务器可从该存储位置获取样本库。在图像增广任务集合中只包含非GPU增广任务时,所有的非GPU增广任务均需要由CPU执行。The storage location of the sample library is given in the image augmentation request, and the image augmentation server can obtain the sample library from the storage location. When only non-GPU augmentation tasks are included in the image augmentation task set, all non-GPU augmentation tasks need to be executed by the CPU.
S69,将所述CPU发送的第二增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第二增广图像数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的。S69. Store the second augmented image data sent by the CPU in a preset augmented data set, and send the augmented data set to the model training server, where the second augmented image data is the Obtained after the CPU performs the non-GPU augmentation task on the sample image.
具体实施中,由于图像增广任务集合中只包含非GPU增广任务,因此CPU对所述样本图像执行完所有的非GPU增广任务后即得到第二增广图像数据。第二增广图像数据即为样本图像的最终处理结果。In a specific implementation, since the image augmentation task set includes only non-GPU augmentation tasks, the CPU obtains the second augmented image data after performing all non-GPU augmentation tasks on the sample image. The second augmented image data is the final processing result of the sample image.
图像增广服务器将第二增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器。The image augmentation server stores the second augmented image data in a preset augmented data set, and sends the augmented data set to the model training server.
增广数据集合具体地发送方式在上述实施例提供的步骤S51-S53中有详细描述,在此不再赘述。The specific sending mode of the augmented data set is described in detail in steps S51-S53 provided in the foregoing embodiment, and will not be repeated here.
S610,若所述图像增广任务集合中只包含GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的GPU,以由所述GPU对所述样本图像执行所述GPU增广任务。S610: If only GPU augmentation tasks are included in the image augmentation task set, sample images are obtained from a preset sample library, and the sample images are distributed to a preset GPU, so that the GPU can The sample image performs the GPU augmentation task.
具体实施中,若所述图像增广任务集合中只包含GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的GPU,以由所述GPU对所述样本图像执行所述GPU增广任务。In specific implementation, if the image augmentation task set includes only GPU augmentation tasks, sample images are obtained from a preset sample library, and the sample images are distributed to a preset GPU, so that the GPU can The sample image performs the GPU augmentation task.
图像增广请求中给出了样本库的存储位置,图像增广服务器可从该存储位置获取样本库。在图像增广任务集合中只包含GPU增广任务时,所有的GPU增广任务均可由GPU执行,以提高运算速率。The storage location of the sample library is given in the image augmentation request, and the image augmentation server can obtain the sample library from the storage location. When only the GPU augmentation task is included in the image augmentation task set, all GPU augmentation tasks can be executed by the GPU to increase the computing speed.
S611,将所述GPU发送的第三增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第三增广图像数据是所述GPU对所述样本图像执行所述GPU增广任务后得到的。S611. Store the third augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, where the third augmented image data is the Obtained after the GPU performs the GPU augmentation task on the sample image.
具体实施中,由于图像增广任务集合中只包含GPU增广任务,因此GPU对所述样本图像执行完所有的GPU增广任务后即得到第三增广图像数据。第三增广图像数据即为样本图像的最终处理结果。In specific implementation, since only the GPU augmentation task is included in the image augmentation task set, the third augmented image data is obtained after the GPU performs all the GPU augmentation tasks on the sample image. The third augmented image data is the final processing result of the sample image.
图像增广服务器将第三增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器。The image augmentation server stores the third augmented image data in a preset augmented data set, and sends the augmented data set to the model training server.
增广数据集合具体地发送方式在上述实施例提供的步骤S51-S53中有详细描述,在此不再赘述。The specific sending mode of the augmented data set is described in detail in steps S51-S53 provided in the foregoing embodiment, and will not be repeated here.
图7是本申请实施例提供的一种图像增广装置60的示意性框图。如图7所示,对应于以上图像增广方法,本申请还提供一种图像增广装置60。该图像增广装置60包括用于执行上述图像增广方法的单元,该图像增广装置60可以被配置于服务器中。具体地,请参阅图7,该图像增广装置60包括接收单元61、第一判断单元62、第一分发单元63、第一存储单元64、第二分发单元65以及第一发送单元66。FIG. 7 is a schematic block diagram of an image augmentation device 60 provided by an embodiment of the present application. As shown in FIG. 7, corresponding to the above image augmentation method, the present application also provides an image augmentation device 60. The image augmentation device 60 includes a unit for executing the above-mentioned image augmentation method, and the image augmentation device 60 may be configured in a server. Specifically, referring to FIG. 7, the image augmentation device 60 includes a receiving unit 61, a first determining unit 62, a first distributing unit 63, a first storage unit 64, a second distributing unit 65, and a first sending unit 66.
接收单元61,用于接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;The receiving unit 61 is configured to receive an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
第一判断单元62,用于判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;The first determining unit 62 is configured to determine whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
第一分发单元63,用于若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;The first distribution unit 63 is configured to, if the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, obtain sample images from a preset sample library, and distribute the sample images to the preview Set a CPU to perform the non-GPU augmentation task on the sample image by the CPU;
第一存储单元64,用于将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;The first storage unit 64 is configured to store the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is after the CPU performs the non-GPU augmentation task on the sample image owned;
第二分发单元65,用于从所述数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;The second distribution unit 65 is configured to obtain intermediate processing data from the data set, and distribute the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
第一发送单元66,用于将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first sending unit 66 is configured to store the first augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, and the first augmented image data The wide image data is obtained after the GPU performs the GPU augmentation task on the intermediate processing data.
在一实施例中,如图8所示,所述第一发送单元66包括第二判断单元661、第二发送单元662以及第三发送单元663。In an embodiment, as shown in FIG. 8, the first sending unit 66 includes a second judging unit 661, a second sending unit 662, and a third sending unit 663.
第二判断单元661,用于判断模型训练服务器是否部署在本地。The second judging unit 661 is used to judge whether the model training server is deployed locally.
第二发送单元662,用于若模型训练服务器部署在本地,通过共享内存的方式将所述增广数据集合发送给模型训练服务器。The second sending unit 662 is configured to send the augmented data set to the model training server by way of shared memory if the model training server is deployed locally.
第三发送单元663,用于若模型训练服务器不是部署在本地,通过RPC传输或者HTTP传输的方式将所述增广数据集合发送给模型训练服务器。The third sending unit 663 is configured to send the augmented data set to the model training server through RPC transmission or HTTP transmission if the model training server is not deployed locally.
在一实施例中,所述CPU包括多个CPU执行线程,如图9所示,所述第一分发单元63包括第一获取单元631以及第一分配单元632。In an embodiment, the CPU includes multiple CPU execution threads. As shown in FIG. 9, the first distribution unit 63 includes a first acquisition unit 631 and a first distribution unit 632.
第一获取单元631,用于获取所述CPU中处于空闲状态的CPU执行线程作为目标CPU执行线程;The first obtaining unit 631 is configured to obtain a CPU execution thread in an idle state in the CPU as a target CPU execution thread;
第一分配单元632,用于向所述目标CPU执行线程分配样本图像。The first allocation unit 632 is configured to allocate sample images to the target CPU execution thread.
在一实施例中,所述GPU包括多个GPU执行线程,如图10所示,所述第二分发单元65包括第二获取单元651以及第二分配单元652。In an embodiment, the GPU includes multiple GPU execution threads. As shown in FIG. 10, the second distribution unit 65 includes a second acquisition unit 651 and a second distribution unit 652.
第二获取单元651,用于获取所述GPU中处于空闲状态的CPU执行线程作为目标CPU执行线程;The second obtaining unit 651 is configured to obtain a CPU execution thread in an idle state in the GPU as a target CPU execution thread;
第二分配单元652,用于向所述目标GPU执行线程分配中间处理数据。The second allocation unit 652 is configured to allocate intermediate processing data to the target GPU execution thread.
图11是本申请另一实施例提供的一种图像增广装置60的示意性框图。如图11所示,本实施例的图像增广装置60是上述实施例的基础上增加了第三判断单元67、第三分发单元68、第四发送单元69、第四分发单元610以及第五发送单元611。FIG. 11 is a schematic block diagram of an image augmentation device 60 provided by another embodiment of the present application. As shown in FIG. 11, the image augmentation device 60 of this embodiment adds a third judgment unit 67, a third distribution unit 68, a fourth transmission unit 69, a fourth distribution unit 610, and a fifth Sending unit 611.
第三判断单元67,用于若所述图像增广任务集合中不是同时包含GPU增广任务以及非GPU增广任务,判断所述图像增广任务集合中是否只包含非GPU增广任务。The third determining unit 67 is configured to determine whether the image augmentation task set includes only non-GPU augmentation tasks if the image augmentation task set does not include both GPU augmentation tasks and non-GPU augmentation tasks.
第三分发单元68,用于若所述图像增广任务集合中只包含非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务。The third distributing unit 68 is configured to, if the image augmentation task set contains only non-GPU augmentation tasks, obtain sample images from a preset sample library, and distribute the sample images to a preset CPU, The non-GPU augmentation task is executed by the CPU on the sample image.
第四发送单元69,用于将所述CPU发送的第二增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第二增广图像数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的。The fourth sending unit 69 is configured to store the second augmented image data sent by the CPU in a preset augmented data set, and send the augmented data set to the model training server, and the second augmented image data The wide image data is obtained after the CPU performs the non-GPU augmentation task on the sample image.
第四分发单元610,用于若所述图像增广任务集合中只包含GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的GPU,以由所述GPU对所述样本图像执行所述GPU增广任务。The fourth distribution unit 610 is configured to obtain sample images from a preset sample library if only GPU augmentation tasks are included in the image augmentation task set, and distribute the sample images to the preset GPU, The GPU performs the GPU augmentation task on the sample image.
第五发送单元611,用于将所述GPU发送的第三增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第三增广图像数据是所述GPU对所述样本图像执行所述GPU增广任务后得到的。The fifth sending unit 611 is configured to store the third augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, and the third augmented image data The wide image data is obtained after the GPU performs the GPU augmentation task on the sample image.
需要说明的是,所属领域的技术人员可以清楚地了解到,上述图像增广装置60和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned image augmentation device 60 and each unit can be referred to the corresponding description in the foregoing method embodiment. For the convenience and conciseness of the description, here is No longer.
上述图像增广装置60可以实现为一种计算机程序的形式,该计算机程序可以在如图12所示的计算机设备上运行。The above-mentioned image augmentation device 60 may be implemented in the form of a computer program, and the computer program may be run on the computer device shown in FIG. 12.
请参阅图12,图12是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500可以是终端,也可以是服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。Please refer to FIG. 12, which is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal or a server, where the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server can be an independent server or a server cluster composed of multiple servers.
参阅图12,该计算机设备500包括通过***总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。Referring to FIG. 12, the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
该非易失性存储介质503可存储操作***5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行一种图像增广方法。The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute an image augmentation method.
该处理器502用于提供计算和控制能力,以支撑整个计算机设备500的运行。The processor 502 is used to provide calculation and control capabilities to support the operation of the entire computer device 500.
该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种图像增广方法。The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute an image augmentation method.
该网络接口505用于与其它设备进行网络通信。本领域技术人员可以理解,图12中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The network interface 505 is used for network communication with other devices. Those skilled in the art can understand that the structure shown in FIG. 12 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现本申请的图 像增广方法。Wherein, the processor 502 is configured to run a computer program 5032 stored in the memory to implement the image augmentation method of the present application.
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in this embodiment of the application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成。该计算机程序可存储于一存储介质中,该存储介质为计算机可读存储介质。该计算机程序被该计算机***中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments may be implemented by computer programs instructing relevant hardware. The computer program may be stored in a storage medium, and the storage medium is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the foregoing method embodiment.
因此,本申请还提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序。该计算机程序被处理器执行时使处理器执行本申请的图像增广方法。Therefore, this application also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by the processor, the processor executes the image augmentation method of the present application.
所述存储介质为实体的、非瞬时性的存储介质,例如可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的实体存储介质。The storage medium is a physical, non-transitory storage medium, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk, etc., which can store program codes. medium.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both, in order to clearly illustrate the hardware and software Interchangeability, in the above description, the composition and steps of each example have been generally described in accordance with the function. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed device and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。The steps in the method in the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs. The units in the devices in the embodiments of the present application may be combined, divided, and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存 储在一个存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,尚且本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, even if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application also intends to include these modifications and variations.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Anyone familiar with the technical field can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (20)

  1. 一种图像增广方法,包括:An image augmentation method, including:
    接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;Receiving an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
    判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;Judging whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
    若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;If the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
    将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;Storing the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image;
    从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;Acquiring intermediate processing data from the intermediate data set, and distributing the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
    将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs The intermediate processing data is obtained after executing the GPU augmentation task.
  2. 根据权利要求1所述的图像增广方法,其中,所述方法还包括:The image augmentation method according to claim 1, wherein the method further comprises:
    若所述图像增广任务集合中不是同时包含GPU增广任务以及非GPU增广任务,判断所述图像增广任务集合中是否只包含非GPU增广任务;If the image augmentation task set does not include both GPU augmentation tasks and non-GPU augmentation tasks, determining whether the image augmentation task set includes only non-GPU augmentation tasks;
    若所述图像增广任务集合中只包含非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;If the image augmentation task set contains only non-GPU augmentation tasks, sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the CPU can perform the processing of the sample Image performing the non-GPU augmentation task;
    将所述CPU发送的第二增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第二增广图像数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的。The second augmented image data sent by the CPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server. The second augmented image data is the CPU pair The sample image is obtained after performing the non-GPU augmentation task.
  3. 根据权利要求2所述的图像增广方法,其中,所述方法还包括:The image augmentation method according to claim 2, wherein the method further comprises:
    若所述图像增广任务集合中只包含GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的GPU,以由所述GPU对所述样本图像执行所述GPU增广任务;If the image augmentation task set includes only GPU augmentation tasks, sample images are obtained from a preset sample library, and the sample images are distributed to a preset GPU, so that the GPU can perform a comparison of the sample image Performing the GPU augmentation task;
    将所述GPU发送的第三增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第三增广图像数据是所述GPU对所述样本图像执行所述 GPU增广任务后得到的。The third augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the third augmented image data is a pair of the GPU The sample image is obtained after executing the GPU augmentation task.
  4. 根据权利要求1任一项所述的图像增广方法,其中,所述将所述增广数据集合发送给模型训练服务器,包括:The image augmentation method according to any one of claim 1, wherein the sending the augmented data set to a model training server comprises:
    判断模型训练服务器是否部署在本地;Determine whether the model training server is deployed locally;
    若模型训练服务器部署在本地,通过共享内存的方式将所述增广数据集合发送给模型训练服务器。If the model training server is deployed locally, the augmented data set is sent to the model training server by way of shared memory.
  5. 根据权利要求4所述的图像增广方法,其中,所述将所述增广数据集合发送给模型训练服务器,还包括:The image augmentation method according to claim 4, wherein said sending the augmented data set to a model training server further comprises:
    若模型训练服务器不是部署在本地,通过RPC传输或者HTTP传输的方式将所述增广数据集合发送给模型训练服务器。If the model training server is not deployed locally, the augmented data set is sent to the model training server through RPC transmission or HTTP transmission.
  6. 根据权利要求1所述的图像增广方法,其中,所述CPU包括多个CPU执行线程,所述将所述样本图像分发给预设的CPU,包括:The image augmentation method according to claim 1, wherein the CPU includes a plurality of CPU execution threads, and the distributing the sample image to a preset CPU includes:
    获取所述CPU中处于空闲状态的CPU执行线程作为目标CPU执行线程;Acquiring a CPU execution thread in an idle state in the CPU as a target CPU execution thread;
    向所述目标CPU执行线程分配样本图像。Allocate sample images to the target CPU execution thread.
  7. 根据权利要求1所述的图像增广方法,其中,所述GPU包括多个GPU执行线程,所述将中间处理数据分发给预设的GPU,包括:The image augmentation method according to claim 1, wherein the GPU includes a plurality of GPU execution threads, and the distributing the intermediate processing data to a preset GPU includes:
    获取所述GPU中处于空闲状态的GPU执行线程作为目标GPU执行线程;Acquiring a GPU execution thread in an idle state in the GPU as a target GPU execution thread;
    向所述目标GPU执行线程分配中间处理数据。Allocate intermediate processing data to the target GPU execution thread.
  8. 根据权利要求1所述的图像增广方法,其中,所述GPU增广任务以及所述非GPU增广任务是由用户根据GPU的处理能力预先设定的。The image augmentation method according to claim 1, wherein the GPU augmentation task and the non-GPU augmentation task are preset by the user according to the processing capability of the GPU.
  9. 根据权利要求1所述的图像增广方法,其中,所述图像增广请求还包含样本图像的存储位置。The image augmentation method according to claim 1, wherein the image augmentation request further includes a storage location of the sample image.
  10. 一种图像增广装置,包括:An image augmentation device, including:
    接收单元,用于接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;A receiving unit, configured to receive an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
    第一判断单元,用于判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;The first determining unit is configured to determine whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
    第一分发单元,用于若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;The first distribution unit is configured to, if the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, obtain sample images from a preset sample library, and distribute the sample images to a preset The CPU in order to execute the non-GPU augmentation task on the sample image by the CPU;
    第一存储单元,用于将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;The first storage unit is configured to store the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image of;
    第二分发单元,用于从所述数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;The second distribution unit is configured to obtain intermediate processing data from the data set, and distribute the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
    第一发送单元,用于将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first sending unit is configured to store the first augmented image data sent by the GPU in a preset augmented data set, and send the augmented data set to the model training server, the first augmented The image data is obtained after the GPU performs the GPU augmentation task on the intermediate processing data.
  11. 一种计算机设备,包括存储器以及与所述存储器相连的处理器;其中,所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行如下步骤:A computer device includes a memory and a processor connected to the memory; wherein the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the following steps:
    接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;Receiving an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
    判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;Judging whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
    若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;If the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
    将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;Storing the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image;
    从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;Acquiring intermediate processing data from the intermediate data set, and distributing the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
    将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs The intermediate processing data is obtained after executing the GPU augmentation task.
  12. 根据权利要求1所述的计算机设备,其中,所述处理器还执行如下步骤:The computer device according to claim 1, wherein the processor further executes the following steps:
    若所述图像增广任务集合中不是同时包含GPU增广任务以及非GPU增广任务,判断所述图像增广任务集合中是否只包含非GPU增广任务;If the image augmentation task set does not include both GPU augmentation tasks and non-GPU augmentation tasks, determining whether the image augmentation task set includes only non-GPU augmentation tasks;
    若所述图像增广任务集合中只包含非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;If the image augmentation task set contains only non-GPU augmentation tasks, sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the CPU can perform the processing of the sample Image performing the non-GPU augmentation task;
    将所述CPU发送的第二增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第二增广图像数据是所述CPU对所述样本图像执行所述 非GPU增广任务后得到的。The second augmented image data sent by the CPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the second augmented image data is the CPU pair The sample image is obtained after performing the non-GPU augmentation task.
  13. 根据权利要求12所述的计算机设备,其中,所述处理器还执行如下步骤:The computer device according to claim 12, wherein the processor further executes the following steps:
    若所述图像增广任务集合中只包含GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的GPU,以由所述GPU对所述样本图像执行所述GPU增广任务;If the image augmentation task set includes only GPU augmentation tasks, sample images are obtained from a preset sample library, and the sample images are distributed to a preset GPU, so that the GPU can perform a comparison of the sample image Performing the GPU augmentation task;
    将所述GPU发送的第三增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第三增广图像数据是所述GPU对所述样本图像执行所述GPU增广任务后得到的。The third augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the third augmented image data is a pair of the GPU The sample image is obtained after executing the GPU augmentation task.
  14. 根据权利要求11任一项所述的计算机设备,其中,所述将所述增广数据集合发送给模型训练服务器的步骤包括:The computer device according to any one of claims 11, wherein the step of sending the augmented data set to a model training server comprises:
    判断模型训练服务器是否部署在本地;Determine whether the model training server is deployed locally;
    若模型训练服务器部署在本地,通过共享内存的方式将所述增广数据集合发送给模型训练服务器。If the model training server is deployed locally, the augmented data set is sent to the model training server by way of shared memory.
  15. 根据权利要求14所述的计算机设备,其中,所述将所述增广数据集合发送给模型训练服务器的步骤还包括:The computer device according to claim 14, wherein the step of sending the augmented data set to a model training server further comprises:
    若模型训练服务器不是部署在本地,通过RPC传输或者HTTP传输的方式将所述增广数据集合发送给模型训练服务器。If the model training server is not deployed locally, the augmented data set is sent to the model training server through RPC transmission or HTTP transmission.
  16. 根据权利要求11所述的计算机设备,其中,所述CPU包括多个CPU执行线程,所述将所述样本图像分发给预设的CPU的步骤包括:The computer device according to claim 11, wherein the CPU includes a plurality of CPU execution threads, and the step of distributing the sample image to a preset CPU includes:
    获取所述CPU中处于空闲状态的CPU执行线程作为目标CPU执行线程;Acquiring a CPU execution thread in an idle state in the CPU as a target CPU execution thread;
    向所述目标CPU执行线程分配样本图像。Allocate sample images to the target CPU execution thread.
  17. 根据权利要求11所述的计算机设备,其中,所述GPU包括多个GPU执行线程,所述将中间处理数据分发给预设的GPU的步骤包括:The computer device according to claim 11, wherein the GPU comprises a plurality of GPU execution threads, and the step of distributing the intermediate processing data to a preset GPU comprises:
    获取所述GPU中处于空闲状态的GPU执行线程作为目标GPU执行线程;Acquiring a GPU execution thread in an idle state in the GPU as a target GPU execution thread;
    向所述目标GPU执行线程分配中间处理数据。Allocate intermediate processing data to the target GPU execution thread.
  18. 根据权利要求11所述的计算机设备,其中,所述GPU增广任务以及所述非GPU增广任务是由用户根据GPU的处理能力预先设定的。11. The computer device according to claim 11, wherein the GPU augmentation task and the non-GPU augmentation task are preset by the user according to the processing capability of the GPU.
  19. 根据权利要求11所述的计算机设备,其中,所述图像增广请求还包含样本图像的存储位置。The computer device according to claim 11, wherein the image augmentation request further includes a storage location of the sample image.
  20. 一种计算机可读存储介质,其中,所述存储介质存储有计算机程序,所述计算机程序 被处理器执行时使所述处理器执行以下步骤:A computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
    接收模型训练服务器发送的图像增广请求,所述图像增广请求包含图像增广任务集合,所述图像增广任务集合包含至少一个图像增广任务;Receiving an image augmentation request sent by a model training server, where the image augmentation request includes an image augmentation task set, and the image augmentation task set includes at least one image augmentation task;
    判断所述图像增广任务集合中是否同时包含GPU增广任务以及非GPU增广任务;Judging whether the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks;
    若所述图像增广任务集合中同时包含GPU增广任务以及非GPU增广任务,从预设的样本库中获取样本图像,并将所述样本图像分发给预设的CPU,以由所述CPU对所述样本图像执行所述非GPU增广任务;If the image augmentation task set includes both GPU augmentation tasks and non-GPU augmentation tasks, sample images are obtained from the preset sample library, and the sample images are distributed to the preset CPU, so that the The CPU executes the non-GPU augmentation task on the sample image;
    将所述CPU发送的中间处理数据储存到预设的中间数据集合中,所述中间处理数据是所述CPU对所述样本图像执行所述非GPU增广任务后得到的;Storing the intermediate processing data sent by the CPU into a preset intermediate data set, where the intermediate processing data is obtained after the CPU performs the non-GPU augmentation task on the sample image;
    从所述中间数据集合中获取中间处理数据,并将中间处理数据分发给预设的GPU,以由所述GPU对所述中间处理数据执行所述GPU增广任务;Acquiring intermediate processing data from the intermediate data set, and distributing the intermediate processing data to a preset GPU, so that the GPU performs the GPU augmentation task on the intermediate processing data;
    将所述GPU发送的第一增广图像数据储存到预设的增广数据集合中,并将所述增广数据集合发送给模型训练服务器,所述第一增广图像数据是所述GPU对所述中间处理数据执行所述GPU增广任务后得到的。The first augmented image data sent by the GPU is stored in a preset augmented data set, and the augmented data set is sent to the model training server, where the first augmented image data is the pair of GPUs The intermediate processing data is obtained after executing the GPU augmentation task.
PCT/CN2020/111789 2020-07-29 2020-08-27 Image augmentation method and apparatus, computer device, and storage medium WO2021139177A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010744544.4 2020-07-29
CN202010744544.4A CN111897639B (en) 2020-07-29 2020-07-29 Image augmentation method, image augmentation device, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021139177A1 true WO2021139177A1 (en) 2021-07-15

Family

ID=73182520

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/111789 WO2021139177A1 (en) 2020-07-29 2020-08-27 Image augmentation method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN111897639B (en)
WO (1) WO2021139177A1 (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018176000A1 (en) 2017-03-23 2018-09-27 DeepScale, Inc. Data synthesis for autonomous control systems
US11893393B2 (en) 2017-07-24 2024-02-06 Tesla, Inc. Computational array microprocessor system with hardware arbiter managing memory requests
US11409692B2 (en) 2017-07-24 2022-08-09 Tesla, Inc. Vector computational unit
US10671349B2 (en) 2017-07-24 2020-06-02 Tesla, Inc. Accelerated mathematical engine
US11157441B2 (en) 2017-07-24 2021-10-26 Tesla, Inc. Computational array microprocessor system using non-consecutive data formatting
US11561791B2 (en) 2018-02-01 2023-01-24 Tesla, Inc. Vector computational unit receiving data elements in parallel from a last row of a computational array
US11215999B2 (en) 2018-06-20 2022-01-04 Tesla, Inc. Data pipeline and deep learning system for autonomous driving
US11361457B2 (en) 2018-07-20 2022-06-14 Tesla, Inc. Annotation cross-labeling for autonomous control systems
US11636333B2 (en) 2018-07-26 2023-04-25 Tesla, Inc. Optimizing neural network structures for embedded systems
US11562231B2 (en) 2018-09-03 2023-01-24 Tesla, Inc. Neural networks for embedded devices
IL282172B2 (en) 2018-10-11 2024-02-01 Tesla Inc Systems and methods for training machine models with augmented data
US11196678B2 (en) 2018-10-25 2021-12-07 Tesla, Inc. QOS manager for system on a chip communications
US11816585B2 (en) 2018-12-03 2023-11-14 Tesla, Inc. Machine learning models operating at different frequencies for autonomous vehicles
US11537811B2 (en) 2018-12-04 2022-12-27 Tesla, Inc. Enhanced object detection for autonomous vehicles based on field view
US11610117B2 (en) 2018-12-27 2023-03-21 Tesla, Inc. System and method for adapting a neural network model on a hardware platform
US10997461B2 (en) 2019-02-01 2021-05-04 Tesla, Inc. Generating ground truth for machine learning from time series elements
US11150664B2 (en) 2019-02-01 2021-10-19 Tesla, Inc. Predicting three-dimensional features for autonomous driving
US11567514B2 (en) 2019-02-11 2023-01-31 Tesla, Inc. Autonomous and user controlled vehicle summon to a target
US10956755B2 (en) 2019-02-19 2021-03-23 Tesla, Inc. Estimating object properties using visual image data
CN112506483B (en) * 2020-12-04 2024-04-05 北京五八信息技术有限公司 Data augmentation method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107688495A (en) * 2017-06-22 2018-02-13 平安科技(深圳)有限公司 The method and apparatus of dispatch processor
CN108921070A (en) * 2018-06-22 2018-11-30 北京旷视科技有限公司 Image processing method, model training method and corresponding intrument
CN109886859A (en) * 2019-01-30 2019-06-14 上海赜睿信息科技有限公司 Data processing method, system, electronic equipment and computer readable storage medium
CN109933429A (en) * 2019-03-05 2019-06-25 北京达佳互联信息技术有限公司 Data processing method, device, electronic equipment and storage medium
US20190205170A1 (en) * 2017-06-22 2019-07-04 Banuba Limited Operation of computing devices by dynamically adaptive distribution of workload between central processing unit(s) and graphics processing unit(s), and computer systems and computer-implemented methods in accordance with thereof
CN110992241A (en) * 2019-11-21 2020-04-10 支付宝(杭州)信息技术有限公司 Heterogeneous embedded system and method for accelerating neural network target detection

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105900064B (en) * 2014-11-19 2019-05-03 华为技术有限公司 The method and apparatus for dispatching data flow task
CN106296616B (en) * 2016-08-18 2019-01-29 中国航空工业集团公司洛阳电光设备研究所 A kind of infrared image detail enhancing method and a kind of infrared image details enhancement device
CN107135257A (en) * 2017-04-28 2017-09-05 东方网力科技股份有限公司 Task is distributed in a kind of node cluster method, node and system
CN108710897A (en) * 2018-04-24 2018-10-26 江苏科海智能***有限公司 A kind of online general target detecting system in distal end based on SSD-T
CN110489223B (en) * 2019-08-26 2022-03-29 北京邮电大学 Task scheduling method and device in heterogeneous cluster and electronic equipment
CN111144494A (en) * 2019-12-27 2020-05-12 睿魔智能科技(深圳)有限公司 Object detection model training method, object detection device, object detection equipment and object detection medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107688495A (en) * 2017-06-22 2018-02-13 平安科技(深圳)有限公司 The method and apparatus of dispatch processor
US20190205170A1 (en) * 2017-06-22 2019-07-04 Banuba Limited Operation of computing devices by dynamically adaptive distribution of workload between central processing unit(s) and graphics processing unit(s), and computer systems and computer-implemented methods in accordance with thereof
CN108921070A (en) * 2018-06-22 2018-11-30 北京旷视科技有限公司 Image processing method, model training method and corresponding intrument
CN109886859A (en) * 2019-01-30 2019-06-14 上海赜睿信息科技有限公司 Data processing method, system, electronic equipment and computer readable storage medium
CN109933429A (en) * 2019-03-05 2019-06-25 北京达佳互联信息技术有限公司 Data processing method, device, electronic equipment and storage medium
CN110992241A (en) * 2019-11-21 2020-04-10 支付宝(杭州)信息技术有限公司 Heterogeneous embedded system and method for accelerating neural network target detection

Also Published As

Publication number Publication date
CN111897639A (en) 2020-11-06
CN111897639B (en) 2022-12-27

Similar Documents

Publication Publication Date Title
WO2021139177A1 (en) Image augmentation method and apparatus, computer device, and storage medium
WO2018119602A1 (en) Rendering method and device
JP2021111359A (en) Audio wakeup method and apparatus
WO2021088964A1 (en) Inference system, inference method, electronic device and computer storage medium
US10129332B2 (en) Load balancing of distributed services
US7925785B2 (en) On-demand capacity management
US20050267980A1 (en) Regulating client requests in an electronic messaging environment
WO2020042769A1 (en) Image information transmission method and apparatus, and storage medium and electronic device
US10783685B2 (en) Banner image generation
US10104165B1 (en) Sharing network connections to content sources
DE102021123338A1 (en) PREDICTIVE CONTROL USING ONE OR MORE NEURAL NETWORKS
WO2020259208A1 (en) Memory scheduling method and apparatus, device and storage medium
CN114979286B (en) Access control method, device, equipment and computer storage medium for container service
CN112473126A (en) Scene blanking processing method and device, electronic equipment and medium
WO2016095377A1 (en) Image display method and device for thin client and electronic equipment
WO2014067494A1 (en) Method and device for processing image
CN111724262B (en) Subsequent package query system of application server and working method thereof
JP2023031248A (en) Edge computing network, data transmission method, apparatus, device, and storage medium
US10887381B1 (en) Management of allocated computing resources in networked environment
US11233847B1 (en) Management of allocated computing resources in networked environment
CN111416852A (en) Method for session synchronization among multiple load balancers and load balancer
CN112527454A (en) Container group scheduling method and device, electronic equipment and computer readable medium
US10721160B2 (en) Method of distributing data and device supporting the same
CN112615928B (en) Data processing method, device and storage medium
TWI845008B (en) Method for detecting workpieces based on homogeneous multi-core architecture, and edge computing device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20912336

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20912336

Country of ref document: EP

Kind code of ref document: A1