Image reasoning method and related equipment

By dividing and allocating the initial image to CPU and GPU processing, and using the image inference model to optimize the processing of image blocks, the problem of long image inference time on the user side is solved, and the user experience and computing efficiency are improved.

CN118628332APending Publication Date: 2024-09-10SHENZHEN SHENXIN INFORMATION SECURITY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410869388.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

When the user side uses image super-resolution algorithm or image enhancement algorithm, the computing power is limited, resulting in long image inference time and poor user experience.

Method used

Divide the initial image into multiple image blocks and assign them to the CPU and GPU for processing respectively. Use the image inference models of the CPU and GPU for processing. Splice the processed image blocks to obtain the target image. Optimize the accuracy and allocation strategy of the image inference model. to improve efficiency.

Benefits of technology

It effectively reduces image inference time, improves computing efficiency and user experience, and ensures image quality and code stream savings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628332A
    Figure CN118628332A
Patent Text Reader

Abstract

The embodiment of the invention discloses an image reasoning method and related equipment, which are used for reducing the calculation delay in an image reasoning process, improving the calculation efficiency and then improving the user experience. The method provided by the embodiment of the invention comprises the following steps: after receiving an initial image sent by a server, dividing the initial image into a plurality of image blocks; distributing the plurality of image blocks to an image processor GPU and a central processing unit CPU of the user side, so that the CPU processes the image blocks distributed by the CPU based on an image reasoning model corresponding to the CPU to obtain processed image blocks, the GPU processes the image blocks distributed by the GPU based on the image reasoning model corresponding to the GPU to obtain processed image blocks; wherein the CPU and the GPU are respectively distributed with at least one image block; and splicing the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image output and displayed by a display end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing, and in particular to image reasoning methods and related equipment. Background Art

[0002] Virtual desktop infrastructure (VDI) is a virtualization solution that uses virtual machines to provide and manage virtual desktops. Through the deep integration of server virtualization, desktop virtualization and storage virtualization, only two devices, desktop cloud all-in-one machine and cloud terminal, are needed to achieve rapid delivery of cloud platform, simplify desktop operation and maintenance workload, ensure information security, and realize smooth and efficient mobile office.

[0003] In the existing technical solutions, the user side calls the central processing unit (CPU) or the graphics processing unit (GPU), and runs the image super-resolution algorithm or the image enhancement algorithm through the CPU or GPU to process each frame of the image sent by the server side, obtain the corresponding processed image, and display the processed image to the user. However, the computing power of the user side is limited, and the user side needs to spend a lot of reasoning time when using the image super-resolution algorithm or the image enhancement algorithm to enhance the image quality, resulting in a poor user experience. Summary of the invention

[0004] The embodiments of the present application provide an image reasoning method and related devices for reducing the reasoning time in the image reasoning process, improving computing efficiency, and thereby improving user experience.

[0005] A first aspect of an embodiment of the present application provides an image reasoning method, which is applied to a user terminal and includes:

[0006] After receiving the initial image sent by the server, dividing the initial image into a plurality of image blocks;

[0007] The plurality of image blocks are allocated to the image processor GPU and the central processing unit CPU of the user terminal, so that the CPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks; wherein the CPU and the GPU are respectively allocated with at least one of the image blocks;

[0008] The image blocks processed by the GPU and the image blocks processed by the CPU are spliced ​​to obtain a target image for output display on a display terminal.

[0009] In a specific implementation, before splicing the image block processed by the GPU and the image block processed by the CPU, the method further includes:

[0010] Obtaining a first image reasoning model parameter corresponding to the CPU and a second image reasoning model parameter corresponding to the GPU, wherein the initial precision of the first image reasoning model parameter is determined based on the minimum operation precision supported by the CPU, and the initial precision of the second image reasoning model parameter is determined based on the minimum operation precision supported by the GPU;

[0011] The image reasoning model corresponding to the CPU is determined based on a preset model structure of the image reasoning model and the first image reasoning model parameters, and the image reasoning model corresponding to the GPU is determined based on the preset model structure and the second image reasoning model parameters.

[0012] In a specific implementation, the initial precision of the first image reasoning model parameters is the minimum calculation precision supported by the CPU, and the initial precision of the second image reasoning model parameters is the minimum calculation precision supported by the GPU.

[0013] In a specific implementation, it also includes:

[0014] Displaying the target image on the display terminal;

[0015] In response to a user's image quality enhancement instruction for the target image, determining a target accuracy of a new image reasoning model corresponding to the CPU between a minimum computing accuracy supported by the CPU and a maximum computing accuracy supported by the CPU, and determining a target accuracy of a new image reasoning model corresponding to the GPU between a minimum computing accuracy supported by the GPU and a maximum computing accuracy supported by the GPU;

[0016] Acquire a new image reasoning model corresponding to the CPU based on the corresponding target computing accuracy, and acquire a new image reasoning model corresponding to the GPU based on the corresponding target computing accuracy;

[0017] The reprocessed image blocks corresponding to each of the image blocks are spliced ​​to obtain a new image for output display on the display end, wherein the reprocessed image blocks are obtained by reprocessing the corresponding image blocks by the CPU based on the corresponding new image reasoning model or by the GPU based on the corresponding new image reasoning model; wherein the CPU and the GPU reprocess at least one of the image blocks respectively.

[0018] In a specific implementation, allocating the multiple image blocks to a graphics processor GPU and a central processing unit CPU of the user terminal includes:

[0019] Obtaining the computing power of the GPU and the computing power of the CPU;

[0020] Determine the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU according to the computing power of the CPU, the computing power of the CPU and the total number of image blocks;

[0021] According to the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU, the multiple image blocks are allocated to the CPU and the GPU without duplication.

[0022] A second aspect of an embodiment of the present application provides an image reasoning method, characterized in that it is applied to a server and includes:

[0023] An initial image is sent to a user terminal so that the user terminal divides the initial image into a plurality of image blocks, and allocates the plurality of image blocks to the GPU and the CPU, so that the CPU processes the image blocks allocated to itself based on its corresponding image inference model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image inference model to obtain processed image blocks, and splices the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display by the display terminal; wherein the CPU and the GPU are respectively allocated at least one of the image blocks.

[0024] A third aspect of an embodiment of the present application provides a user terminal, including:

[0025] A receiving unit, configured to divide the initial image into a plurality of image blocks after receiving the initial image sent by the server;

[0026] An allocating unit, configured to allocate the plurality of image blocks to an image processor GPU and a central processing unit CPU of the user terminal, so that the CPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks; wherein the CPU and the GPU are respectively allocated with at least one of the image blocks;

[0027] The splicing unit is used to splice the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display on a display terminal.

[0028] In a specific implementation, before splicing the image block processed by the GPU and the image block processed by the CPU, the user terminal further includes: a determination unit;

[0029] The receiving unit is further used to obtain a first image reasoning model parameter corresponding to the CPU and a second image reasoning model parameter corresponding to the GPU, wherein the initial precision of the first image reasoning model parameter is determined based on the minimum operation precision supported by the CPU, and the initial precision of the second image reasoning model parameter is determined based on the minimum operation precision supported by the GPU;

[0030] The determination unit is used to determine the image inference model corresponding to the CPU based on a preset model structure of the image inference model and the first image inference model parameters, and to determine the image inference model corresponding to the GPU based on the preset model structure and the second image inference model parameters.

[0031] In a specific implementation, the initial precision of the first image reasoning model parameters is the minimum calculation precision supported by the CPU, and the initial precision of the second image reasoning model parameters is the minimum calculation precision supported by the GPU.

[0032] In a specific implementation, the user terminal further includes: a display unit and a determination unit;

[0033] The display unit is used to display the target image on the display end;

[0034] The determination unit is used to determine, in response to a user's image quality enhancement instruction for the target image, a target accuracy of the new image reasoning model corresponding to the CPU between a minimum calculation accuracy supported by the CPU and a maximum calculation accuracy supported by the CPU, and to determine a target accuracy of the new image reasoning model corresponding to the GPU between a minimum calculation accuracy supported by the GPU and a maximum calculation accuracy supported by the GPU;

[0035] The receiving unit is further used to obtain a new image reasoning model corresponding to the CPU based on the corresponding target computing accuracy, and to obtain a new image reasoning model corresponding to the GPU based on the corresponding target computing accuracy;

[0036] The reprocessed image blocks corresponding to each of the image blocks are spliced ​​to obtain a new image for output display on the display end, wherein the reprocessed image blocks are obtained by reprocessing the corresponding image blocks by the CPU based on the corresponding new image reasoning model or by the GPU based on the corresponding new image reasoning model; wherein the CPU and the GPU reprocess at least one of the image blocks respectively.

[0037] In a specific implementation, the allocation unit is specifically used to obtain the computing power of the GPU and the computing power of the CPU;

[0038] Determine the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU according to the computing power of the CPU, the computing power of the CPU and the total number of image blocks;

[0039] According to the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU, the multiple image blocks are allocated to the CPU and the GPU without duplication.

[0040] A fourth aspect of the embodiments of the present application provides a server, including:

[0041] A sending unit is used to send an initial image to a user terminal, so that the user terminal divides the initial image into multiple image blocks, and allocates the multiple image blocks to the GPU and the CPU, so that the CPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and splices the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display on the display terminal; wherein the CPU and the GPU are respectively allocated at least one of the image blocks.

[0042] A fifth aspect of an embodiment of the present application provides a computer device, including:

[0043] CPU, memory and input / output interface;

[0044] The memory is a short-term storage memory or a persistent storage memory;

[0045] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method described in the first aspect or the second aspect.

[0046] A sixth aspect of the embodiments of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect or the second aspect.

[0047] A seventh aspect of an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the method described in the first aspect or the second aspect.

[0048] It can be seen from the above technical scheme that the embodiment of the present application has the following advantages: after receiving the initial image sent by the server, the initial image is divided into multiple image blocks; the multiple image blocks are allocated to the image processor GPU and the central processing unit CPU of the user end, so that the CPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks; wherein the CPU and the GPU are respectively allocated at least one image block; the image blocks processed by the GPU and the image blocks processed by the CPU are spliced ​​to obtain the target image for output and display on the display end. In the embodiment of the present application, the CPU computing power and the GPU computing power are used at the same time. The GPU and the CPU only need to process part of the image blocks obtained by dividing the initial image. Under the premise of ensuring image quality and bit stream saving, the inference time of each image can be effectively reduced, the computing efficiency can be improved, and then the user experience can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A system architecture diagram of the image reasoning method disclosed in the embodiment of the present application;

[0050] Figure 2 A schematic diagram of a flow chart of the image reasoning method disclosed in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of the structure of a user terminal disclosed in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of the structure of the server disclosed in the embodiment of the present application;

[0053] Figure 5 A schematic diagram of the structure of a computer device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0055] The embodiments of the present application provide an image reasoning method and related equipment for reducing computational delays in the image reasoning process, improving computational efficiency, and thereby improving user experience.

[0056] In order to better implement the image reasoning method of the embodiment of the present application, please refer to Figure 1, an embodiment of the present application provides an image reasoning system, including at least one server 101 and at least one user terminal 102, the server 101 is used to send an initial image to the user terminal 102, and the user terminal 102 is used to divide the initial image into multiple image blocks, and allocate the multiple image blocks to the CPU and GPU of the user terminal 102 without duplication. Then, the CPU and GPU of the user terminal 102 can respectively call their corresponding image reasoning models to process the image blocks assigned to them, and obtain corresponding processed image blocks. Finally, by splicing the processed image blocks obtained by the CPU or GPU corresponding to different image blocks, the target image that can be used for output display on the display end can be obtained.

[0057] In actual applications, when the user end and the server end are deployed based on VDI, the server end is used to provide an operating environment, provide applications running in the aforementioned operating environment, and render a desktop screen, and send the rendered desktop screen to the user end. The user end performs image reasoning operations on the rendered desktop screen to obtain a desktop screen with higher image quality for display on the display end. Among them, the rendered desktop screen can be an image or a video composed of multiple frames of images arranged in sequence. For example, the initial image sent by the server end to the user end can be a single image or any frame of the video sent by the server end.

[0058] It should be noted that the initial images required by different user terminals to perform image reasoning operations can be provided by one or more server terminals, which is not specifically limited here. In addition, the display terminal and the user terminal can be different components of the same device, such as the display screen (display terminal) and the host part (user terminal) of an all-in-one machine, such as a cloud terminal box (or VDI box) and a display device connected to the cloud terminal box. Among them, the communication connection can be any connection method such as a wired connection or a wireless connection.

[0059] Based on the aforementioned image reasoning system, the embodiment of the present application further provides an image reasoning method, which is applied to the server 101 and / or the user end 102, and includes the following steps:

[0060] 201. The server sends an initial image to the client.

[0061] As described in the above embodiments, when the user terminal needs to display a picture, the server terminal will send the corresponding initial image to the user terminal. Usually, the initial image sent by the server terminal in this step has limited image quality and is not enough to meet the output display requirements of the display terminal. Therefore, the user terminal needs to process it through subsequent steps to obtain a target image with better image quality for output display by the display terminal. Among them, the initial image sent by the server terminal to the user terminal can be a single image or any frame image in the video sent by the server terminal, which is not limited here.

[0062] 202. The user terminal divides the initial image into multiple image blocks.

[0063] In the embodiment of the present application, considering the limited computing power of the CPU and GPU, in order to reduce the difficulty of image reasoning and improve the efficiency of image reasoning, the initial image is divided into multiple image blocks by the user end. Generally, the initial image is divided into multiple image blocks of substantially the same size. For example, Figure 1 The initial image is divided into two image blocks by the vertical division method shown in the figure, or the initial image is divided into multiple image blocks by the horizontal division method, or the initial image is divided into multiple image blocks by combining the horizontal division method and the vertical division method.

[0064] In practical applications, if the number of divided image blocks is too large, there may be obvious boundaries between the different processed image blocks in the spliced ​​target image, resulting in a decrease in the image quality of the target image. In some specific implementations, in order to ensure the image quality of the target image, the total number of divided image blocks can be limited, such as 2 blocks, 4 blocks or 6 blocks, etc., which can be configured as needed.

[0065] 203. The user end allocates multiple image blocks to the CPU and the GPU, so that the CPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, wherein the CPU and the GPU are respectively allocated to at least one image block.

[0066] After multiple image blocks are obtained through division, in order to improve data processing efficiency, the embodiment of the present application allocates multiple image blocks to the CPU and GPU of the user side without duplication, and enables the CPU and GPU to process the image blocks allocated to them according to their corresponding image reasoning models to obtain processed image blocks. That is to say, the CPU of the user side can be allocated to at least one image block, and the GPU of the user side can also be allocated to at least one image block; then, the CPU of the user side will process each image block allocated to it according to its corresponding image reasoning model to obtain the processed image block corresponding to each image block; similarly, the GPU of the user side will process each image block allocated to it according to its corresponding image reasoning model to obtain the processed image block corresponding to each image block. It should be noted that after the image block is input into the corresponding image reasoning model, the image reasoning model will output the processed image block, and the specific way in which the image reasoning model obtains the processed image block depends on the model structure (or network structure) of the image reasoning model, which is not limited here.

[0067] Among them, the image inference models corresponding to the CPU and GPU respectively can be any model that can improve image quality, such as a super-resolution model or an image enhancement model, and are not specifically limited here.

[0068] In practical applications, in order to allow the CPU and GPU of the user end to perform image reasoning on the initial image sent by the server end, the user end can preset the image reasoning model corresponding to the CPU and GPU. In this way, it is convenient for the user end to perform image reasoning operations on the initial image sent by the server end, such as processing the initial image through the image reasoning model to obtain the corresponding target image with higher image quality. Among them, the image quality of the image can be evaluated by image indicators in at least one dimension including but not limited to resolution, noise and contrast; the image reasoning model sent can be a model parameter (in this case, the user end itself is assigned a model structure) or a complete image reasoning model; different versions of the image reasoning model can have different model accuracy or different model parameters, and this embodiment does not specifically limit the above content.

[0069] In addition to the above method, which allows the CPU and GPU of the user side to obtain the required image inference models, the user side can also choose to preset different versions of image inference models corresponding to the CPU and GPU respectively, wherein different versions of image inference models can be distinguished by version identifiers, and at least one image inference model corresponding to the CPU and GPU can have different version identifiers. In this case, in order for the CPU and GPU to smoothly perform image inference on the initial image sent by the server, the server also needs to send to the user side a first version identifier that instructs the CPU to determine the image inference model required to process the image block assigned to itself, and a second version identifier that instructs the GPU to determine the image inference model required to process the image block assigned to itself, so that the CPU selects a unique image inference model from the preset different versions of image inference models according to the first version identifier for processing the image block assigned to itself, and the GPU selects a unique image inference model from the preset different versions of image inference models according to the second version identifier for processing the image block assigned to itself.

[0070] 204. The user end splices the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output and display by the display end.

[0071] According to the above content, the image blocks processed by the GPU and the image blocks processed by the CPU correspond to a certain image block segmented from the initial image respectively. In this way, the spliced ​​image blocks processed by the GPU and the image blocks processed by the CPU can obtain the target image for output display on the display end. Specifically, when splicing the image blocks processed by the GPU and the image blocks processed by the CPU, it is necessary to place each processed image block according to the position of the target image block corresponding to itself in the initial image, and then splice each placed image block to obtain the target image. Among them, the image content contained in each processed image block is consistent with the image content contained in the corresponding target image block, and the difference between the two is that the image quality is different, and the image quality of the processed image block is higher than the image quality of the corresponding target image block.

[0072] In the embodiment of the present application, the CPU computing power and the GPU computing power are used simultaneously. The GPU and the CPU only need to process part of the image blocks obtained by dividing the initial image. Under the premise of ensuring image quality and bit rate saving, the inference time of each image can be effectively reduced, the computing efficiency can be improved, and the user experience can be improved.

[0073] In order to give full play to the potential of the image reasoning method and user-end hardware of the present application while ensuring the efficiency of image reasoning, the embodiments of the present application can allocate image reasoning models of different precisions for different hardware. In some specific implementations, before the CPU and GPU use the corresponding image reasoning models, the image reasoning models corresponding to the CPU and GPU can be determined by referring to the following steps: obtaining the first image reasoning model parameters corresponding to the CPU and the second image reasoning model parameters corresponding to the GPU, the initial precision of the first image reasoning model parameters is determined based on the minimum operation precision supported by the CPU, and the initial precision of the second image reasoning model parameters is determined based on the minimum operation precision supported by the GPU; determining the image reasoning model corresponding to the CPU based on the preset model structure of the image reasoning model and the first image reasoning model parameters, and determining the image reasoning model corresponding to the GPU based on the preset model structure and the second image reasoning model parameters.

[0074] This application divides the image reasoning tasks that are completed by the CPU or GPU alone into tasks that are completed by the CPU and the GPU together, and the computing resources of the GPU or CPU occupied by the image reasoning tasks are greatly reduced. Therefore, the embodiment of the present application determines the initial accuracy of the first image reasoning model parameters of the image reasoning model corresponding to the CPU based on the minimum operating accuracy supported by the CPU, and determines the initial accuracy of the second image reasoning model parameters of the image reasoning model corresponding to the GPU based on the minimum operating accuracy supported by the GPU. After determining the initial accuracy of the first image reasoning model parameters and the initial accuracy of the second image reasoning model parameters, the first image reasoning model parameters and the second image reasoning model parameters can be determined, and then the image reasoning models corresponding to the CPU and GPU are determined respectively.

[0075] Specifically, the image reasoning model corresponding to the CPU and the image reasoning model corresponding to the GPU may be the same or different. If the image reasoning model corresponding to the CPU is different from the image reasoning model corresponding to the GPU, the difference between the two is only the model accuracy. In other words, regardless of whether the image reasoning models corresponding to the CPU and the GPU are the same, the model structure of the image reasoning model corresponding to the CPU and the GPU is the same, that is, the two use the same network structure. A trained model has a specific network structure and specific model parameters. The model structure of the image reasoning model corresponding to the CPU and the GPU is the same. Therefore, according to the preset model structure corresponding to the two and the first image reasoning model parameters, the image reasoning model corresponding to the CPU can be obtained; according to the preset model structure corresponding to the two and the second image reasoning model parameters, the image reasoning model corresponding to the GPU can be obtained. Among them, the model accuracy of the image reasoning model is determined by the parameter accuracy of the image reasoning model.

[0076] It should be noted that the first image reasoning model parameters and the second image reasoning model parameters can be obtained through perceptual quantization technology. Generally, perceptual quantization technology can be quantization-aware training or post-training quantization. The execution timing of the two is interoperable, and quantization-aware training is performed during the training process of the model. Quantization-aware training may modify the structure and parameters of the model to adapt to quantization, or to better adapt to the noise and precision changes caused by quantization. This method enables the model to perform reasoning at lower precision while maintaining good performance by introducing quantization noise or using quantization activation functions during the training process. This means that the model begins to model the quantization error during the training phase, thereby optimizing its weights and activations to obtain better performance after quantization. In contrast, post-training quantization is performed after the model training is completed. Post-training quantization usually does not modify the structure and parameters of the original model. This method quantizes the trained model parameters and converts them into a lower precision representation, thereby reducing the model size and computational complexity, so as to reduce storage and computing costs during the model deployment phase.

[0077] Furthermore, the initial precision of the first image reasoning model parameters is the minimum calculation precision supported by the CPU, and the initial precision of the second image reasoning model parameters is the minimum calculation precision supported by the GPU.

[0078] In actual applications, it has been found through testing that most CPUs and GPUs can complete some of the image reasoning tasks assigned to them (such as processing the image blocks assigned to them and obtaining the processed image blocks, and splicing the processed image blocks to obtain the target image) under the minimum computing precision they support, and obtain the target image with good image quality for the user. Therefore, in order to improve the image reasoning efficiency as much as possible and reduce the processing cost of the image reasoning model corresponding to the CPU and GPU, the embodiment of the present application can directly determine the minimum computing precision supported by the CPU as the initial precision of the first image reasoning model parameters; and determine the minimum computing precision supported by the GPU as the initial precision of the second image reasoning model parameters.

[0079] Furthermore, due to the different minimum computing precisions supported by different CPUs and GPUs, the image reasoning model obtained under the minimum computing precision supported by some CPUs or GPUs cannot obtain a high-quality target image after the processed image blocks are spliced. Therefore, for this situation, the embodiment of the present application also provides the following steps for the GPU and CPU to obtain a new image reasoning model and re-execute the image reasoning task based on the new image reasoning model: display the target image on the display end; in response to the user's image quality enhancement instruction for the target image, determine the target precision of the new image reasoning model corresponding to the CPU between the minimum computing precision supported by the CPU and the maximum computing precision supported by the CPU, and determine the target precision of the new image reasoning model corresponding to the GPU between the minimum computing precision supported by the GPU and the maximum computing precision supported by the GPU; obtain the new image reasoning model corresponding to the CPU based on the corresponding target computing precision, and obtain the new image reasoning model corresponding to the GPU based on the corresponding target computing precision; splice the reprocessed image blocks corresponding to each image block to obtain a new image for output display on the display end, and the reprocessed image blocks are obtained by the CPU based on the corresponding new image reasoning model or the GPU based on the corresponding new image reasoning model Reprocessing the corresponding image blocks; wherein the CPU and the GPU reprocess at least one image block respectively.

[0080] It is understandable that, in addition to the minimum computing precision supported by the CPU and GPU, the maximum computing precision supported is also included. In order to ensure that the target precision of the new image reasoning model corresponding to the CPU does not exceed the computing precision range it supports (i.e., between the minimum computing precision it supports and the maximum computing precision it supports), and the target precision of the new image reasoning model corresponding to the GPU does not exceed the computing precision range it supports (i.e., between the minimum computing precision it supports and the maximum computing precision it supports), it is necessary to determine the target precision for the new image reasoning model corresponding to the corresponding processor between the minimum computing precision and the maximum computing precision supported by the corresponding processor (i.e., the CPU or GPU). In general, the model precision of the image reasoning model is determined by the parameter precision of the image reasoning model, and the higher the parameter precision, the higher the image quality of the image obtained after being processed by the image reasoning model. Therefore, the target precision of the new image reasoning model corresponding to the corresponding processor should be greater than the initial precision of the image reasoning model parameters (such as the first image reasoning model parameters or the second image reasoning model parameters) corresponding to the processor.

[0081] Specifically, the specific implementation method of obtaining the new image reasoning model corresponding to the CPU based on the corresponding target operation accuracy, and obtaining the new image reasoning model corresponding to the GPU based on the corresponding target operation accuracy in the embodiment of the present application is similar to the specific implementation method of obtaining the image reasoning model corresponding to the CPU based on the initial accuracy of the first image reasoning model parameters, or obtaining the image reasoning model corresponding to the GPU based on the initial accuracy of the second image reasoning model parameters in the aforementioned embodiment, and will not be repeated here. After obtaining the new image reasoning models corresponding to the CPU and GPU respectively, the CPU and GPU can reprocess the image blocks allocated in the aforementioned step 203 according to the corresponding new image reasoning models, and obtain the reprocessed image blocks. Finally, the reprocessed image blocks are spliced ​​to obtain a new image with higher image quality than the target image. Among them, the way in which the new image reasoning model reprocesses the allocated image blocks is similar to the relevant embodiment of the aforementioned step 203, and the way in which the reprocessed image blocks are spliced ​​to obtain a new image is similar to the relevant embodiment of the aforementioned step 204, and will not be repeated here.

[0082] It can be understood that in the steps where the CPU and GPU can respectively reprocess the allocated image blocks according to the corresponding new image inference models and obtain the reprocessed image blocks, the image blocks respectively allocated by the CPU and GPU can be consistent with or different from the image blocks allocated in step 203, which is not limited here.

[0083] Based on the foregoing embodiments, the embodiments of the present application can specifically allocate multiple image blocks to the CPU and the GPU in the following manner: obtain the computing power of the GPU and the computing power of the CPU; determine the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU based on the computing power of the CPU, the computing power of the CPU and the total number of image blocks; allocate multiple image blocks to the CPU and the GPU without duplication according to the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU.

[0084] In general, the computing power of a CPU can be measured by at least one computing indicator including but not limited to: the number of instructions, main frequency, cache, and the number of cores; the computing power of a GPU can be measured by at least one computing indicator including but not limited to: the size of video memory and the bandwidth of video memory. Among them, the number of instructions refers to the number of instructions that the CPU can process per second, and the main frequency refers to the clock frequency of the CPU processing instructions. If the computing power of a CPU or GPU needs to be measured by multiple computing indicators, different values ​​such as the sum, weighted sum, or weighted average of the computing indicators can be used as the value to measure the computing power of the CPU or GPU, and the computing indicators can be normalized if necessary. The weights of different computing indicators can be configured as needed and are not limited here.

[0085] Next, you can The product of the total number of image blocks is used as the number of image blocks allocated to the CPU; The product of and the total number of image blocks is the number of image blocks allocated to the GPU. The product of the total number of image blocks or If the product of the number of image blocks allocated to the CPU and the total number of image blocks is not an integer, the product can be rounded up or down so that the sum of the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU is equal to the total number of image blocks.

[0086] Finally, a corresponding number of image blocks are allocated to the CPU and GPU respectively, and it is ensured that there are no identical image blocks between the image blocks allocated to the CPU and the GPU.

[0087] Generally, the computing power of GPU and CPU is comparable. Therefore, in some implementations, the image blocks obtained by the division in step 202 can be directly divided equally between the CPU and GPU, which reduces the image reasoning time occupied by the image block allocation process and improves the image reasoning efficiency.

[0088] It should be noted that the model accuracy or parameter accuracy mentioned in this application can be 64-bit floating point numbers, 32-bit floating point numbers, 16-bit floating point numbers or 8-bit integer numbers, etc., and is not limited here.

[0089] See also Figure 3 The present application implements a user terminal, including:

[0090] The receiving unit 301 is configured to divide the initial image into a plurality of image blocks after receiving the initial image sent by the server;

[0091] The allocation unit 302 is used to allocate multiple image blocks to the image processor GPU and the central processing unit CPU of the user end, so that the CPU processes the image blocks allocated to itself based on the image reasoning model corresponding to itself to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on the image reasoning model corresponding to itself to obtain processed image blocks; wherein the CPU and the GPU are respectively allocated with at least one image block;

[0092] The splicing unit 303 is used to splice the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display on the display end.

[0093] In a specific implementation, before splicing the image block processed by the GPU and the image block processed by the CPU, the user terminal further includes: a determination unit;

[0094] The receiving unit 301 is further used to obtain a first image reasoning model parameter corresponding to the CPU and a second image reasoning model parameter corresponding to the GPU, wherein the initial precision of the first image reasoning model parameter is determined based on the minimum operation precision supported by the CPU, and the initial precision of the second image reasoning model parameter is determined based on the minimum operation precision supported by the GPU;

[0095] A determination unit is used to determine the image reasoning model corresponding to the CPU based on a preset model structure of the image reasoning model and a first image reasoning model parameter, and to determine the image reasoning model corresponding to the GPU based on the preset model structure and a second image reasoning model parameter.

[0096] In a specific implementation, the initial precision of the first image reasoning model parameters is the minimum calculation precision supported by the CPU, and the initial precision of the second image reasoning model parameters is the minimum calculation precision supported by the GPU.

[0097] In a specific implementation, the user terminal further includes: a display unit and a determination unit;

[0098] A display unit, used for displaying a target image on a display terminal;

[0099] a determination unit, configured to determine, in response to a user's image quality enhancement instruction for a target image, a target accuracy of a new image reasoning model corresponding to the CPU between a minimum calculation accuracy supported by the CPU and a maximum calculation accuracy supported by the CPU, and to determine a target accuracy of a new image reasoning model corresponding to the GPU between a minimum calculation accuracy supported by the GPU and a maximum calculation accuracy supported by the GPU;

[0100] The receiving unit 301 is further used to obtain a new image reasoning model corresponding to the CPU based on the corresponding target computing accuracy, and to obtain a new image reasoning model corresponding to the GPU based on the corresponding target computing accuracy;

[0101] The reprocessed image blocks corresponding to each image block are spliced ​​to obtain a new image for output display on the display end, and the reprocessed image blocks are obtained by reprocessing the corresponding image blocks by the CPU based on the corresponding new image reasoning model or by the GPU based on the corresponding new image reasoning model; wherein the CPU and the GPU reprocess at least one image block respectively.

[0102] In a specific implementation, the allocation unit 302 is specifically used to obtain the computing power of the GPU and the computing power of the CPU;

[0103] Determine the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU according to the computing power of the CPU, the computing power of the CPU and the total number of image blocks;

[0104] According to the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU, multiple image blocks are allocated to the CPU and the GPU without duplication.

[0105] See also Figure 4 The present application implements a service end, including:

[0106] The sending unit 401 is also used to send the initial image to the user end, so that the user end divides the initial image into multiple image blocks, and allocates the multiple image blocks to the GPU and the CPU, so that the CPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image reasoning model to obtain processed image blocks, and splices the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display on the display end; wherein the CPU and the GPU are respectively allocated at least one image block.

[0107] Figure 5It is a schematic diagram of a computer device structure provided in an embodiment of the present application. The computer device 500 may include one or more central processing units (CPU) 501 and a memory 505. The memory 505 stores one or more application programs or data.

[0108] The memory 505 may be a volatile storage or a persistent storage. The program stored in the memory 505 may include one or more modules, each of which may include a series of instruction operations in the computer device. Furthermore, the central processing unit 501 may be configured to communicate with the memory 505 and execute a series of instruction operations in the memory 505 on the computer device 500.

[0109] The computer device 500 may also include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input and output interfaces 504, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0110] The CPU 501 can execute the aforementioned Figures 1 to 4 The operations performed by the user end or the server end in the illustrated embodiment will not be described in detail here.

[0111] It should be noted that, although the steps in the flowcharts involved in the embodiments are drawn in sequence according to the instructions of the arrows, unless otherwise clearly stated in this document, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0112] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0113] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art 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, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

[0117] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the image reasoning method as described above.

Claims

1. An image reasoning method, characterized in that: Applied to the user side, including: After receiving the initial image sent by the server, dividing the initial image into multiple image blocks; Allocating the plurality of image blocks to a graphics processor (GPU) and a central processing unit (CPU) of the user terminal, so that the CPU processes the image blocks allocated to it based on its corresponding image inference model to obtain processed image blocks, and the GPU processes the image blocks allocated to it based on its corresponding image inference model to obtain processed image blocks; wherein the CPU and the GPU are each allocated at least one of the image blocks; The image blocks processed by the GPU and the image blocks processed by the CPU are spliced ​​together to obtain a target image for output display on a display terminal.

2. The image reasoning method according to claim 1, characterized in that: Before splicing the image blocks processed by the GPU and the image blocks processed by the CPU, the method further includes: Obtaining first image reasoning model parameters corresponding to the CPU and second image reasoning model parameters corresponding to the GPU, where an initial precision of the first image reasoning model parameters is determined based on a minimum computing precision supported by the CPU, and an initial precision of the second image reasoning model parameters is determined based on a minimum computing precision supported by the GPU; The image inference model corresponding to the CPU is determined based on the preset model structure of the image inference model and the first image inference model parameters, and the image inference model corresponding to the GPU is determined based on the preset model structure and the second image inference model parameters.

3. The image reasoning method according to claim 2, characterized in that: The initial precision of the first image reasoning model parameters is the minimum computing precision supported by the CPU, and the initial precision of the second image reasoning model parameters is the minimum computing precision supported by the GPU.

4. The image reasoning method according to claim 3, characterized in that: Also includes: Displaying the target image on the display terminal; In response to a user instruction for enhancing the image quality of the target image, determining a target accuracy of a new image inference model corresponding to the CPU between a minimum computing accuracy supported by the CPU and a maximum computing accuracy supported by the CPU, and determining a target accuracy of a new image inference model corresponding to the GPU between a minimum computing accuracy supported by the GPU and a maximum computing accuracy supported by the GPU; Obtaining a new image inference model corresponding to the CPU based on the corresponding target computing accuracy, and obtaining a new image inference model corresponding to the GPU based on the corresponding target computing accuracy; The reprocessed image blocks corresponding to each of the image blocks are spliced ​​together to obtain a new image for output display on a display terminal, wherein the reprocessed image blocks are obtained by reprocessing the corresponding image blocks by the CPU based on a corresponding new image inference model or by the GPU based on a corresponding new image inference model; wherein the CPU and the GPU respectively reprocess at least one of the image blocks.

5. The image reasoning method according to any one of claims 1 to 4, characterized in that: The allocating the plurality of image blocks to the graphics processing unit (GPU) and the central processing unit (CPU) of the user terminal comprises: Obtaining the computing power of the GPU and the computing power of the CPU; Determining the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU according to the computing power of the CPU, the computing power of the CPU, and the total number of image blocks; According to the number of image blocks allocated to the CPU and the number of image blocks allocated to the GPU, the multiple image blocks are allocated to the CPU and the GPU without duplication.

6. An image reasoning method, characterized in that: Applied to the server, including: An initial image is sent to a user terminal so that the user terminal divides the initial image into multiple image blocks, and allocates the multiple image blocks to an image processor (GPU) and a central processing unit (CPU) of the user terminal, so that the CPU processes the image blocks allocated to itself based on its corresponding image inference model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image inference model to obtain processed image blocks, and splices the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display on a display terminal; wherein the CPU and the GPU are respectively allocated at least one of the image blocks.

7. A user terminal, characterized in that: include: A receiving unit, configured to divide the initial image into a plurality of image blocks after receiving the initial image sent by the server; an allocating unit, configured to allocate the plurality of image blocks to a graphics processing unit (GPU) and a central processing unit (CPU) of the user terminal, so that the CPU processes the image blocks allocated to it based on its corresponding image inference model to obtain processed image blocks, and the GPU processes the image blocks allocated to it based on its corresponding image inference model to obtain processed image blocks; wherein the CPU and the GPU are each allocated at least one of the image blocks; The splicing unit is used to splice the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display on a display terminal.

8. A server, characterized in that: include: A sending unit is used to send an initial image to a user terminal so that the user terminal divides the initial image into multiple image blocks and allocates the multiple image blocks to the image processor GPU and central processing unit CPU of the user terminal, so that the CPU processes the image blocks allocated to itself based on its corresponding image inference model to obtain processed image blocks, and the GPU processes the image blocks allocated to itself based on its corresponding image inference model to obtain processed image blocks, and splices the image blocks processed by the GPU and the image blocks processed by the CPU to obtain a target image for output display on the display terminal; wherein the CPU and the GPU are respectively allocated at least one of the image blocks.

9. A computer device, characterized in that: include: CPU, memory and input / output interfaces; The memory is a transient storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 5 or 6.

10. A computer storage medium, characterized in that The computer storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 5 or 6.