A method, device, electronic device and medium for testing performance of coding and decoding algorithms
By encoding and decoding the codec algorithm image, and evaluating the quality of the reconstructed image using machine vision detection, the problem of inaccurate performance test results of the codec algorithm in the prior art is solved, and more accurate performance evaluation is achieved.
Patent Information
- Application Number
- CN202210831679.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-07-14
AI Technical Summary
现有的编解码算法性能测试方法无法准确评估编解码算法对图像质量的影响,导致测试结果不准确。
By obtaining the test image, encoding it using the encoding algorithm to be tested, and decoding it using the decoding algorithm to be tested, the reconstructed image is obtained. Then, machine vision detection is performed on the reconstructed image, detection accuracy is determined, and used as the result of the performance test of the codec algorithm.
This method can accurately evaluate the performance of the codec algorithm based on the image quality of the reconstruction image itself, and improve the accuracy of the test results.
Smart Images

Figure CN115086649B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image coding and machine vision technology, and in particular to a method, device, electronic equipment and medium for testing the performance of a coding and decoding algorithm. Background Art
[0002] In the process of image transmission, in order to reduce transmission time and improve transmission efficiency, the transmitting end usually encodes and compresses the image and transmits it to the receiving end, and the receiving end reconstructs the image through decoding. After the image is encoded and decoded, the image quality will decrease to a certain extent. The smaller the image quality decreases, the better the performance of the encoding and decoding algorithm.
[0003] The current test method for the performance of a codec algorithm is to use the codec algorithm to be tested to encode and decode the image, and by comparing the original image with the reconstructed image, obtain image quality evaluation indicators such as Peak Signal to Noise Ratio (PSNR) and Structural Similarity (SSIM), thereby evaluating the performance of the codec algorithm. However, this test method can only evaluate the similarity between the original image and the reconstructed image, and the similarity between the two cannot accurately reflect the image quality of the reconstructed image itself. Therefore, this method cannot evaluate the performance of the codec algorithm based on the image quality of the reconstructed image itself, resulting in inaccurate test results for the performance of the codec algorithm. Summary of the invention
[0004] The purpose of the embodiments of the present disclosure is to provide a method, device, electronic device and medium for testing the performance of a codec algorithm, so as to improve the accuracy of the test results of the performance of the codec algorithm. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present disclosure provides a method for testing performance of a coding and decoding algorithm, the method comprising:
[0006] Get a test image;
[0007] Encoding the test image using the coding algorithm to be tested, and decoding the encoded image using the decoding algorithm to be tested to obtain a reconstructed image;
[0008] Performing machine vision detection on the reconstructed image to obtain a detection result, and determining a detection accuracy of the detection result;
[0009] The detection accuracy is used as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested.
[0010] In some embodiments of the present disclosure, before encoding the test image using the coding algorithm to be tested, the method further includes:
[0011] Get the specified codec algorithm identifier and specified version identifier selected by the user;
[0012] The codec algorithm of the version identified by the specified version identifier in the specified codec algorithm identified by the specified codec algorithm identifier is obtained as the codec algorithm to be tested, wherein the codec algorithm to be tested includes the encoding algorithm to be tested and the decoding algorithm to be tested.
[0013] In some embodiments of the present disclosure, after taking the detection accuracy as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested, the method further includes:
[0014] Obtain performance test results of other versions of the specified encoding and decoding algorithm;
[0015] Comparing the performance test result of the codec algorithm to be tested with the performance test results of other versions to obtain a comparison result;
[0016] The comparison results are shown.
[0017] In some embodiments of the present disclosure, the performance test result further includes: number of bits per pixel, encoding duration, and decoding duration; after encoding the test image using the encoding algorithm to be tested, the method further includes:
[0018] Generate a bitstream file based on the encoded image, and determine the number of bits per pixel of the bitstream file;
[0019] Counting the encoding time consumed for encoding the test image;
[0020] After decoding the encoded image using the decoding algorithm to be tested, the method further includes:
[0021] The decoding time consumed for decoding the code stream file is counted.
[0022] In some embodiments of the present disclosure, before encoding the test image using the coding algorithm to be tested, the method further includes:
[0023] Determining whether there is a reconstructed image obtained by decoding the encoded image using the decoding algorithm to be tested;
[0024] If it exists, perform machine vision detection on the existing reconstructed image to obtain a detection result, and determine the detection accuracy of the obtained detection result, and use the determined detection accuracy as the performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested;
[0025] If not, the steps of encoding the test image using the encoding algorithm to be tested and decoding the encoded image using the decoding algorithm to be tested are performed.
[0026] In some embodiments of the present disclosure, the performing machine vision inspection on the reconstructed image to obtain the inspection result includes:
[0027] Find the machine vision detection model corresponding to the machine vision detection model identifier selected by the user;
[0028] The reconstructed image is input into the machine vision detection model to obtain the detection result.
[0029] In some embodiments of the present disclosure, the format of the reconstructed image is a specified image format; before encoding the test image using the coding algorithm to be tested, the method further includes:
[0030] The format of the test image is converted into the specified image format.
[0031] In a second aspect, an embodiment of the present disclosure provides a coding and decoding algorithm performance testing device, the device comprising:
[0032] An acquisition module, used for acquiring a test image;
[0033] A coding and decoding module, used to encode the test image acquired by the acquisition module using the coding algorithm to be tested, and decode the encoded image using the decoding algorithm to be tested to obtain a reconstructed image;
[0034] A machine vision detection module, used for performing machine vision detection on the reconstructed image obtained by the encoding and decoding module, obtaining a detection result, and determining the detection accuracy of the detection result;
[0035] A result output module is used to use the detection accuracy obtained by the machine vision detection module as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested.
[0036] In some embodiments of the present disclosure, the acquisition module is further used to:
[0037] Before encoding the test image using the coding algorithm to be tested, obtaining a specified coding algorithm identifier and a specified version identifier selected by a user;
[0038] The codec algorithm of the version identified by the specified version identifier in the specified codec algorithm identified by the specified codec algorithm identifier is obtained as the codec algorithm to be tested, wherein the codec algorithm to be tested includes the encoding algorithm to be tested and the decoding algorithm to be tested.
[0039] In some embodiments of the present disclosure, the device further comprises:
[0040] The acquisition module is further configured to acquire performance test results of other versions of the specified encoding and decoding algorithm after taking the detection accuracy as the performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested;
[0041] A comparison module, used to compare the performance test result of the codec algorithm to be tested with the performance test results of other versions to obtain a comparison result;
[0042] A display module is used to display the comparison result obtained by the comparison module.
[0043] In some embodiments of the present disclosure, the performance test result further includes: number of bits per pixel, encoding duration, and decoding duration; the device further includes:
[0044] A determination module, configured to generate a bitstream file based on the encoded image after encoding the test image using the encoding algorithm to be tested, and determine the number of bits per pixel of the bitstream file;
[0045] A statistics module, used for counting the encoding time consumed for encoding the test image;
[0046] The statistical module is further used to count the decoding time consumed for decoding the bitstream file after decoding the encoded image using the decoding algorithm to be tested.
[0047] In some embodiments of the present disclosure, the device further comprises:
[0048] A judgment module, used for judging whether there is a reconstructed image obtained by decoding the coded image using the decoding algorithm to be tested before encoding the test image using the coding algorithm to be tested;
[0049] a determination module, configured to, if the determination result of the determination module is yes, perform machine vision detection on the existing reconstructed image to obtain a detection result, and determine the detection accuracy of the obtained detection result, and use the determined detection accuracy as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested;
[0050] The calling module is used for calling the encoding and decoding module to execute the steps of encoding the test image by using the encoding algorithm to be tested, and decoding the encoded image by using the decoding algorithm to be tested, if the judgment result of the judging module is non-existent.
[0051] In some embodiments of the present disclosure, the machine vision detection module is specifically used to:
[0052] Find the machine vision detection model corresponding to the machine vision detection model identifier selected by the user;
[0053] The reconstructed image is input into the machine vision detection model to obtain the detection result.
[0054] In some embodiments of the present disclosure, the format of the reconstructed image is a specified image format; the apparatus further comprises:
[0055] The conversion module is used to convert the format of the test image into the specified image format before encoding the test image using the coding algorithm to be tested.
[0056] In a third aspect, an embodiment of the present disclosure provides a test platform, including: an encoding library, a decoding library, a model library, and an electronic device; wherein the encoding library is used to store a plurality of encoding algorithms, the decoding library is used to store a plurality of decoding algorithms, and the model library is used to store a plurality of machine vision detection models;
[0057] The electronic device is used to acquire a test image; and encode the test image using the encoding algorithm to be tested selected from the encoding library, and decode the encoded image using the decoding algorithm to be tested selected from the decoding library to obtain a reconstructed image; and use the machine vision detection model selected from the model library to perform machine vision detection on the reconstructed image to obtain a detection result, and determine the detection accuracy of the detection result; and use the detection accuracy as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested.
[0058] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, characterized in that it includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0059] Memory, used to store computer programs;
[0060] The processor is used to implement the steps of the encoding and decoding algorithm performance testing method described in any one of the first aspects when executing the program stored in the memory.
[0061] In a fifth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the encoding and decoding algorithm performance testing method described in any one of the first aspects are implemented.
[0062] In a sixth aspect, an embodiment of the present disclosure provides an embodiment of the present disclosure further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the encoding and decoding algorithm performance testing method described in any one of the above-mentioned first aspects.
[0063] Beneficial effects of the embodiments of the present disclosure:
[0064] The codec algorithm performance test method, device, electronic device and medium provided by the embodiments of the present disclosure use the coding algorithm to be tested to encode the test image, and use the decoding algorithm to be tested to decode the encoded image to obtain a reconstructed image, and perform machine vision detection on the reconstructed image, thereby obtaining the accuracy of machine vision detection of the reconstructed image, and using the detection accuracy as the performance test result of the codec algorithm to be tested. Since the accuracy of machine vision detection of the reconstructed image can represent the detection accuracy of the target in the reconstructed image, and the higher the detection accuracy, the clearer the target in the reconstructed image, the detection accuracy can reflect the clarity of the target in the reconstructed image, that is, it can reflect the image quality of the reconstructed image. Therefore, the embodiments of the present disclosure can determine the performance of the codec algorithm to be tested based on the image quality of the reconstructed image itself, thereby improving the accuracy of the test results of the codec algorithm performance.
[0065] Of course, it is not necessary to achieve all the advantages described above at the same time to implement any product or method of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0067] Figure 1 A flowchart of a method for testing the performance of a coding and decoding algorithm provided in an embodiment of the present disclosure;
[0068] Figure 2 An exemplary schematic diagram of a test platform interface provided by an embodiment of the present disclosure;
[0069] Figure 3 A comparison chart of multiple performance test results provided by an embodiment of the present disclosure;
[0070] Figure 4 An exemplary schematic diagram of a decoding algorithm performance test process provided by an embodiment of the present disclosure;
[0071] Figure 5 An exemplary schematic diagram of another decoding algorithm performance test process provided by an embodiment of the present disclosure;
[0072] Figure 6 A flowchart of another coding and decoding algorithm performance testing method provided by an embodiment of the present disclosure;
[0073] Figure 7 A schematic diagram of the structure of a coding and decoding algorithm performance testing device provided in an embodiment of the present disclosure;
[0074] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field based on the present disclosure belong to the scope of protection of the present disclosure.
[0076] In order to improve the accuracy of the test results of the codec algorithm performance, the embodiment of the present disclosure provides a codec algorithm performance test method, which is applied to electronic devices, where the electronic devices can be devices with image processing capabilities such as servers, computers or mobile phones. Figure 1 As shown, the method comprises the following steps:
[0077] S101: Acquire a test image.
[0078] In the embodiment of the present disclosure, the user may select a specified image set, and the electronic device may use an image in the specified image set as a test image, or the test image may be a video frame included in a video selected by the user. Alternatively, the test image may be a randomly selected image or video frame, etc., which is not specifically limited in the embodiment of the present disclosure.
[0079] The test image includes a target object so that the test image can be subsequently subjected to machine vision inspection. For example, the target object may be a person, an animal, or a vehicle.
[0080] S102 . Encode the test image using the coding algorithm to be tested, and decode the encoded image using the decoding algorithm to be tested to obtain a reconstructed image.
[0081] The decoding algorithm to be tested is the inverse process of the encoding algorithm to be tested.
[0082] S103: Perform machine vision inspection on the reconstructed image to obtain an inspection result, and determine the inspection accuracy of the inspection result.
[0083] Among them, machine vision detection can be target detection, instance segmentation or posture estimation, etc. The machine vision detection result includes: whether the target object is included in the image and the category of the target object in the image. When the machine vision detection is target detection, the detection result also includes the position of the detection box containing the target object in the image; when the machine vision detection is instance segmentation, the detection result also includes the contour position of the target object in the image; when the machine vision detection is posture estimation, the detection result also includes the position of the feature points of the target object in the image, such as the position of the skeleton points of the target object in the image.
[0084] In the disclosed embodiment, the detection result can be compared with the standard detection result of the test image to obtain the detection accuracy of the detection result, that is, the accuracy of the machine vision detection of the reconstructed image. The standard detection result can be a detection result obtained manually, or by the machine vision detection algorithm of the reconstructed image in S103, or by other high-precision machine vision detection methods.
[0085] In practical applications, there are multiple test images obtained, and encoding, decoding and machine vision detection are performed on each test image. When the target object categories included in each test image are the same, the average accuracy (AP) of the target object of that category can be calculated based on the detection results of each reconstructed image, and used as the detection accuracy. When the target object categories included in each test image are different, the average value of the AP corresponding to each type of target object can be calculated to obtain the mean average precision (mAP), which can also be called the average detection accuracy, and mAP is used as the detection accuracy.
[0086] According to the detection results of target detection, instance segmentation and pose estimation, the method of calculating AP and mAP is similar. The following takes the calculation of AP based on the detection results of target detection as an example. The calculation method of AP can be: for each reconstructed image, obtain the detection frame that is identified as including the target object of this category from the reconstructed image, calculate the coordinates of the detection frame and the intersection over union (IoU) of the standard detection frame of the object of this category in the test image corresponding to the reconstructed image. When IoU is greater than the threshold, it is determined that the recognition is accurate, otherwise it is determined that the recognition is inaccurate. Then, according to the number of detection frames that are accurately identified and the number of detection frames that are inaccurately identified in the detection frame that includes the target object of this category, the precision (Precision, P) and recall (Recall, R) are calculated to obtain the PR curve, and the area under the PR curve is calculated to obtain the AP of the target object of this category. For example, the standard detection result of the test image is that the image contains a vehicle, and the position of the detection frame containing the vehicle is A. The target detection result of the reconstructed image is that the image contains a mouse, and the position of the detection frame containing the mouse is B. Assuming that A and B have no intersection, it is obtained by comparison that the detection frame is inaccurate.
[0087] Optionally, the detection accuracy in the embodiments of the present disclosure includes the above-mentioned AP or mAP. Moreover, the detection accuracy may also include the accuracy level obtained according to the AP or mAP. For example, when the mAP is greater than the first preset value, the accuracy level is determined to be accurate; when the mAP is greater than the second preset value and less than or equal to the first preset value, the accuracy level is determined to be relatively accurate; when the mAP is less than or equal to the second preset value, the accuracy level is determined to be inaccurate. Among them, the first preset value is greater than the second preset value.
[0088] Optionally, the detection accuracy determined by the machine vision detection results in the embodiments of the present disclosure may also include other evaluation indicators. For example, according to the different sizes of the target objects included in the reconstructed image, the target objects may be divided into large targets, medium targets, and small targets, and the large target detection accuracy may be further determined for the detection frame including the large target. The large target detection accuracy may also be referred to as the large target recognition accuracy (AP for large objects, AP1). Similarly, the medium target recognition accuracy (AP for medium objects, APm) and the small target recognition accuracy (AP for small objects, APs) may also be determined.
[0089] S104: Use the detection accuracy as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested.
[0090] In the disclosed embodiment, a test report may be generated as a performance test result based on the average detection accuracy, large target recognition, medium target recognition, small target recognition, and the identification of the codec algorithm to be tested.
[0091] Optionally, the test report may also include a certain number of test images and corresponding reconstructed images, etc.
[0092] The codec algorithm performance test method provided by the embodiment of the present disclosure uses the coding algorithm to be tested to encode the test image, and uses the decoding algorithm to be tested to decode the encoded image to obtain a reconstructed image, and performs machine vision detection on the reconstructed image, thereby obtaining the accuracy of machine vision detection of the reconstructed image, and using the detection accuracy as the performance test result of the codec algorithm to be tested. Since the accuracy of machine vision detection of the reconstructed image can represent the recognition accuracy of the target in the reconstructed image, and the higher the recognition accuracy, the clearer the target in the reconstructed image, the detection accuracy can reflect the clarity of the target in the reconstructed image, that is, it can reflect the image quality of the reconstructed image. Therefore, the embodiment of the present disclosure can determine the performance of the codec algorithm to be tested based on the image quality of the reconstructed image itself, thereby improving the accuracy of the test results of the codec algorithm performance.
[0093] In some embodiments of the present disclosure, before the encoding and decoding is performed in the above S102, a codec algorithm to be tested may also be determined, wherein the codec algorithm to be tested includes a coding algorithm to be tested and a decoding algorithm to be tested. The codec algorithm to be tested is determined by obtaining a specified codec algorithm identifier and a specified version identifier selected by a user, and then obtaining a codec algorithm of a version identified by the specified version identifier from the specified codec algorithm identified by the specified codec algorithm identifier as the codec algorithm to be tested.
[0094] The electronic device may also provide a test platform interface, for example, Figure 2 See Figure 2 The user can log in to the test platform interface on the web page, and select the codec algorithm identifier to be tested, select the quality parameter or quantization parameter, that is, specify the version identifier, select the identifier of the machine vision detection model used for machine vision detection, select whether to complete the codec in the central processing unit (CPU) or the graphics processing unit (GPU), select the evaluation index for the machine vision detection result, and select the test image set. Figure 2 This is only an exemplary schematic diagram of a test platform interface provided in an embodiment of the present disclosure. The embodiment of the present disclosure does not specifically limit the content and display form of the test platform interface.
[0095] In the disclosed embodiment, after the user submits the test related parameters in the test platform interface, the web page sends the test related parameters to the electronic device, for example, the test related parameters include the specified codec algorithm identifier and the specified version identifier, after which the electronic device can search for the coding algorithm to be tested from the coding library according to the specified codec algorithm identifier and the specified version identifier, search for the decoding algorithm to be tested from the decoding library according to the specified codec algorithm identifier and the specified version identifier, and search for the machine vision detection model from the model library according to the identifier of the machine vision detection model. Then, the codec algorithm to be tested is directly used to encode and decode the test image to obtain a reconstructed image, and the machine vision detection model is used to perform machine vision detection on the reconstructed image, without the need to test the codec and machine vision detection separately, thereby saving test time. Moreover, if the test is performed separately, the intermediate results generated during the test process must be saved, and the disclosed embodiment avoids separate testing, so the intermediate results generated during the test process can be saved, thereby saving the storage pressure of the electronic device.
[0096] For the same codec algorithm, different versions have different compression levels for images, and the quality of the reconstructed images is different accordingly. For the same codec algorithm, different quantization parameters (QuantizerParameter) can be set to obtain reconstructed images of different qualities, so different versions of the codec algorithm can be distinguished by quantization parameters. Alternatively, different versions of the codec algorithm can also be distinguished by quality parameters.
[0097] For example, the codec algorithm identifier is specified as mbt2018-mean, and the version identifier, that is, the quality parameter, is specified as 1. Alternatively, the codec algorithm identifier is specified as VTM10.2, and the version identifier, that is, the quality parameter, is specified as 42.
[0098] In the embodiment of the present disclosure, a user may select a version of a specified codec algorithm as the codec algorithm to be tested, so that the electronic device may test the codec algorithm to be tested selected by the user.
[0099] In some embodiments of the present disclosure, before the performance test of the codec algorithm to be tested is performed this time, the codec algorithm to be tested may have been previously subjected to a performance test. For example, in the previous test process, after obtaining a reconstructed image using the codec algorithm to be tested, the Peak Signal to Noise Ratio (PSNR) and Structural Similarity (SSIM) of the reconstructed image and the test image are used as performance test results, and the reconstructed image obtained in the test process is saved. Alternatively, in the previous test process, after obtaining a reconstructed image by encoding and decoding using the codec algorithm to be tested, machine vision detection is performed using a machine vision detection method other than the current machine vision detection method, and the reconstructed image obtained in the test process is saved.
[0100] Therefore, there may be a reconstructed image obtained by using the coding and decoding algorithm to be tested in the past. At this time, the reconstructed image obtained in the past can be directly obtained for machine vision detection, thereby improving the efficiency of the performance test. That is, before the above S102, the electronic device can also determine whether there is a reconstructed image obtained by decoding the encoded image using the decoding algorithm to be tested. If so, the existing reconstructed image is subjected to machine vision detection to obtain a detection result, and the detection accuracy of the obtained detection result is determined, based on the determined detection accuracy as the performance test result of the coding algorithm to be tested and the decoding algorithm to be tested. If not, execute S102 to encode the test image using the coding algorithm to be tested, and decode the encoded image using the decoding algorithm to be tested.
[0101] During each performance test of a codec algorithm, the electronic device may store the reconstructed image restored by the tested codec algorithm in correspondence with the identifier and version identifier of the tested codec algorithm, so that subsequent electronic devices can search whether there is a reconstructed image corresponding to the identifier and version identifier of the tested codec algorithm.
[0102] Since the embodiment of the present disclosure can directly perform machine vision inspection on an existing reconstructed image when a reconstructed image obtained using the codec algorithm to be tested already exists, the time consumed in encoding and decoding the test image using the codec algorithm to be tested is reduced, thereby improving the efficiency of performance testing.
[0103] In some embodiments of the present disclosure, after the user logs in to the test platform interface on the web page, in addition to selecting the codec algorithm to be tested and the test image, the user can also select the identification of the machine vision detection model in the login test platform interface, so as to use the machine vision detection model for machine vision detection during the test. For example, the machine vision detection model is identified as Faster-RCNN X101 FPN.
[0104] Therefore, the method in which the electronic device performs machine vision detection on the reconstructed image in the above S103 to obtain the detection result can be implemented as follows: searching for the machine vision detection model corresponding to the machine vision detection model identifier selected by the user, and then inputting the reconstructed image into the machine vision detection model to obtain the detection result. Among them, the electronic device can search for the machine vision detection model corresponding to the specified machine vision detection model identifier from the model library, and the model library stores the correspondence between each model identifier and the model. Each model in the model library is used to perform machine vision detection on the image, and each model uses a different detection algorithm. For example, the user can select a machine vision detection model for target detection, a machine vision detection model for target segmentation, or a machine vision detection model for target tracking, etc. in the login test platform interface.
[0105] In the disclosed embodiment, the reconstructed image can be subjected to machine vision inspection using a machine vision inspection model selected by a user, so that the test result better meets the test requirements.
[0106] In one implementation, the performance test results may include, in addition to the detection accuracy, the number of bits per pixel (bits per pixel, bpp), encoding time, and decoding time. Therefore, after the electronic device encodes the test image using the encoding algorithm to be tested in the above S102, it may also generate a bitstream file based on the encoded image, determine the number of bits per pixel of the bitstream file, and count the encoding time consumed for encoding the test image. Moreover, after the electronic device decodes the encoded image using the decoding algorithm to be tested in the above S102, it may also count the decoding time consumed for decoding the bitstream file.
[0107] Optionally, after obtaining the performance test results, you can also fill in the various parameters of the performance test results into the report template, and fill in the test image identifier, the identifier of the codec algorithm to be tested, the version identifier and the machine vision detection model identifier into the report template, so as to generate a performance test report for the codec algorithm to be tested.
[0108] Optionally, in addition to the above parameters, the performance test results may also include other performance evaluation indicators, such as PSNR and SSIM, which are not specifically limited in the embodiments of the present disclosure.
[0109] In another implementation, in addition to the detection accuracy, the user can also select other performance evaluation indicators in the test platform interface, so that the electronic device can obtain performance evaluation parameters according to the performance evaluation indicators selected by the user. For example, when the performance evaluation indicators selected by the user include the number of bits per pixel and the encoding time, the electronic device encodes the test image using the coding algorithm to be tested in the above S102, generates a bitstream file based on the encoded image, determines the number of bits per pixel of the bitstream file, and counts the encoding time consumed for encoding the test image.
[0110] Through the above method, the disclosed embodiment can also use performance test parameters such as bits per pixel, encoding time and decoding time as performance test results, so that the performance test results can more comprehensively reflect the performance of the codec algorithm to be tested. In addition, users can select performance evaluation indicators so that the performance test results can better meet the test requirements.
[0111] In an embodiment of the present disclosure, after obtaining the number of bits per pixel, encoding time and decoding time, the electronic device may also store the number of bits per pixel, encoding time and decoding time in correspondence with the identifier and version identifier of the codec algorithm to be tested, so that after the subsequent machine vision inspection is completed, the corresponding number of bits per pixel, encoding time and decoding time can be found according to the identifier and version identifier of the codec algorithm to be tested, and the found parameters can be used together with the detection accuracy as the performance test results.
[0112] In some embodiments of the present disclosure, since there are different versions of the same codec algorithm, and different versions produce different image qualities of reconstructed images after encoding and decoding the test image, the embodiments of the present disclosure can compare the performance test results of different versions of the same codec algorithm.
[0113] That is, after the electronic device uses the detection accuracy as the performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested in the above S104, it can also obtain the performance test results of other versions of the specified encoding and decoding algorithm, and then compare the performance test results of the encoding and decoding algorithm to be tested with the performance test results of other versions to obtain the comparison results, and display the comparison results.
[0114] The electronic device may store the identifier and version identifier of the codec algorithm in correspondence with the performance test result, so that the performance test results corresponding to the identifier of the specified codec algorithm and other version identifiers may be searched later.
[0115] Optionally, the comparison result may be a comparison table generated based on the performance test results. For example, the comparison table is shown in Table 1:
[0116] Table 1
[0117] mbt2018-mean, quality parameter is 1 mbt2018-mean, quality parameter is 2 Detection accuracy x y Bits per pixel xx yy Coding time xxx yyy Decoding time xxxx yyyy
[0118] Among them, mbt2018-mean is the algorithm identifier of the codec algorithm to be tested.
[0119] Alternatively, the comparison result may be a comparison chart generated based on the performance test results. Figure 3 As shown, Figure 3 The vertical axis represents the mean average precision (mAP), and the horizontal axis represents the number of bits per pixel, which can also be called the bit rate point. The number of bits per pixel of the bitstream file obtained after encoding each image with one version of the codec algorithm is the same, and the number of bits per pixel of the bitstream file obtained after encoding the image with different versions of the codec algorithm is different, so each version of the codec algorithm corresponds to a number of bits per pixel, so Figure 3 Each dot in the solid line represents the average detection accuracy of machine vision detection of the reconstructed image after a version of the codec algorithm to be tested encodes the test image to obtain the reconstructed image. Figure 3 It can be seen that the smaller the number of bits per pixel of the codec algorithm to be tested, the lower the average detection accuracy.
[0120] Optionally, the comparison result may also include other performance test results. The other performance test results include performance test results of other encoding and decoding algorithms, and the detection accuracy of machine vision detection of unencoded test images. For example, Figure 3 The solid line in the middle represents the average detection accuracy of machine vision inspection directly on the test image. Figure 3 Each dot in the dotted line represents the average detection accuracy of the reconstructed image after encoding the test image with a version of other codec algorithms. Generally speaking, the encoding and decoding processing of the image by the codec algorithm will cause a certain loss in image quality, so Figure 3 It can be seen that the average detection accuracy of the codec algorithm to be tested and the average detection accuracy of other codec algorithms are both lower than the average detection accuracy of machine vision detection of the test image directly. Moreover, when the number of bits per pixel is less than 0.4, the average detection accuracy of other codec algorithms is higher than the average detection accuracy of the codec algorithm to be tested, and when the number of bits per pixel is greater than 0.4, the average detection accuracy of the codec algorithm to be tested is higher than the average detection accuracy of other codec algorithms.
[0121] Optionally, the performance test result may also include a distortion rate (Bjontegaard Delta-Rate, BD rate), where the BD rate can be obtained by Figure 3The solid line and the dotted line in the figure are integrated respectively, and the integral difference is calculated. The integral difference is divided by the integral interval to obtain the BD rate. When the BD rate is greater than 30%, the performance test result of the codec algorithm to be tested is determined to be level 1; when the BD rate is greater than 10% and less than or equal to 30%, the performance test result of the codec algorithm to be tested is determined to be level 2; when the BD rate is greater than 0% and less than or equal to 10%, the performance test result of the codec algorithm to be tested is determined to be level 3; when the BD rate is greater than -10 and less than or equal to 0%, the performance test result is determined to be level 4; when the BD rate is less than or equal to -10%, the performance test result of the codec algorithm to be tested is determined to be level 5. The higher the level, the better the performance of the codec algorithm to be tested is than other codec algorithms.
[0122] In the disclosed embodiment, since the reconstructed image directly serves machine intelligence tasks, including target detection, instance segmentation, pose estimation, etc., in a unified test environment, the performance of the codec algorithm to be tested can be measured by calculating BD-mAP using evaluation indicators such as detection accuracy and bits per pixel, thereby improving the accuracy of the test results of the codec algorithm to be tested.
[0123] In some embodiments of the present disclosure, in order to improve the efficiency of determining the performance test results, the input and output formats of the data in each processing process can be unified. In the embodiments of the present disclosure, the format of the reconstructed image is a specified image format. For example, the specified image format is an image format such as Portable Network Graphics (png), Joint Photographic Experts Group (jpg), or Luminance Chrominance (yuv).
[0124] Therefore, before the electronic device encodes the test image using the coding algorithm to be tested in the above S102, it can also convert the format of the test image into a specified image format, so that the coding algorithm to be tested can encode and decode the test image in a unified format, which can reduce the impact of different image formats on performance testing.
[0125] In addition, in the embodiment of the present disclosure, after the coding algorithm to be tested encodes and decodes the test image, the format of the generated code stream file can be a specified file format, for example, the specified file format is a binary (bin) format. Moreover, the format of the performance test result obtained in S104 can be a specified parameter format, for example, the specified parameter format is a JavaScript Object Notation (json) format.
[0126] For example, Figure 4 As shown, the format of the test image is converted into png format, the code stream file generated after encoding the test image is in bin format, the reconstructed image obtained after decoding the code stream file is in png format, and the performance test result obtained after the reconstructed image is inspected by machine vision is in json format.
[0127] Through the above method, the embodiment of the present disclosure can unify the input and output formats of data in each processing process, thereby providing a completely identical test environment for the processing process of each test image, eliminating the impact of different data formats on the test results, and thus obtaining more accurate test results.
[0128] See also Figure 5 The following is an explanation of the coding and decoding algorithm performance test process provided by the embodiment of the present disclosure:
[0129] The electronic device uses a loading tool to obtain multiple images to form an image set in advance, and loads the coding algorithm to be tested into the coding algorithm library, and loads the decoding algorithm to be tested into the decoding algorithm library. Then, the model management tool is used to access the test image set according to the address of the test image set, so as to obtain the test image from the test image set, and the coding algorithm to be tested is called from the coding algorithm library to encode the test image, and the decoding algorithm to be tested is called from the decoding library to decode the encoded image to obtain a reconstructed image. Then, during the detection process, the model management tool is used to call the machine vision detection model from the model library, and the machine vision detection model is used to perform machine vision detection on the reconstructed image to obtain the detection result. Then, during the evaluation process, the detection accuracy is obtained by the evaluation module according to the standard detection result corresponding to the test image and the detection result output by the machine vision detection model, and the detection accuracy is stored in the result database. Then, the detection accuracy can be obtained from the result database as the performance test result.
[0130] See also Figure 6 , the following takes the test image set as coco2017val, the codec algorithm to be tested as mbt2018-mean, the quality parameter as 1, the machine vision detection model as Faster-RCNN X101 FPN, and the performance evaluation indicators as the number of bits per pixel, encoding time, decoding time, average recognition accuracy, large target recognition, medium target recognition, and small target recognition as an example to illustrate the overall process of the codec algorithm performance test method provided by the embodiment of the present disclosure:
[0131] S601. Access the address of coco2017val to obtain test images.
[0132] S602. Obtain the specified encoding and decoding algorithm identified by mbt2018-mean from the encoding and decoding model library.
[0133] S603: Use the codec algorithm with a quality parameter of 1 in the specified codec algorithm as the codec algorithm to be tested.
[0134] S604: Determine whether there is a reconstructed image obtained by decoding the coded image using the codec algorithm to be tested. If yes, execute S612; otherwise, execute S605.
[0135] S605 , calling the coding algorithm to be tested to encode the test image and generate a bitstream file, obtaining the number of bits per pixel of the bitstream file, and counting the consumed coding time.
[0136] S606: Call the decoding algorithm to be tested to decode the bitstream file to obtain a reconstructed image, and count the consumed decoding time.
[0137] S607: Create a unique identity document (ID), store the reconstructed image and the ID in correspondence, and store the number of bits per pixel, encoding time, and decoding time in a codec database in correspondence.
[0138] Optionally, the unique ID can be the result of concatenating the codec algorithm identifier, the version identifier, and the specified value, or performing a hash operation. The specified value can be a random number or the current time, etc. For example, the ID is: mbt2018-mean 1aaa. The embodiment of the present disclosure does not specifically limit the method for creating the ID.
[0139] The reconstructed image and the ID may be stored in a reconstructed image database in correspondence.
[0140] S608, obtaining a machine vision detection model from a model library, inputting the reconstructed image into the machine vision detection model, obtaining a detection result, and determining an average detection accuracy, large target recognition, medium target recognition, and small target recognition of the detection result.
[0141] S609: Store the average detection accuracy, large target recognition degree, medium target recognition degree and small target recognition degree in a result database accordingly.
[0142] S610. Obtain the number of bits per pixel, encoding time and decoding time from the codec database, obtain the average detection accuracy, large target recognition, medium target recognition and small target recognition from the result database, take the number of bits per pixel, encoding time, decoding time, average recognition accuracy, large target recognition, medium target recognition and small target recognition as performance test results, fill them into the report template, and generate a test report for the codec algorithm to be tested.
[0143] S611. Obtain performance test results of mbt2018-mean with a quality parameter not equal to 1, compare the performance test results of mbt2018-mean with a quality parameter not equal to 1 with the performance test results of mbt2018-mean with a quality parameter equal to 1, and display the comparison results.
[0144] For example, get the performance test results of mbt2018-mean with a quality parameter of 2.
[0145] S612, obtaining a machine vision detection model from a model library, inputting an existing reconstructed image into the machine vision detection model, obtaining a detection result, and determining an average detection accuracy, large target recognition, medium target recognition, and small target recognition of the detection result.
[0146] S613, storing the average detection accuracy, large target recognition degree, medium target recognition degree and small target recognition degree in a result database accordingly.
[0147] S614. Obtain the number of bits per pixel, encoding time and decoding time corresponding to the existing reconstructed image from the codec database, obtain the average detection accuracy, large target recognition, medium target recognition and small target recognition from the result database, use the obtained number of bits per pixel, encoding time, decoding time, average recognition accuracy, large target recognition, medium target recognition and small target recognition as performance test results, and fill them into the report template to generate a test report for the codec algorithm to be tested.
[0148] S615. Obtain performance test results of mbt2018-mean whose quality parameter is not 1, compare the performance test results of mbt2018-mean whose quality parameter is not 1 with the performance test results of mbt2018-mean whose quality parameter is 1, and display the comparison results.
[0149] Figure 6 The specific implementation method of each step can refer to the above description and will not be repeated here.
[0150] After the image is processed by coding and decoding, the image quality will be compressed to a certain extent, resulting in a certain decrease in the accuracy of the subsequent machine vision intelligent task, that is, the detection accuracy of machine vision detection. The higher the detection accuracy, the better the performance of the codec algorithm used in the coding and decoding process. Therefore, the performance test results of the codec algorithm obtained by the embodiment of the disclosure in conjunction with coding and decoding and machine vision intelligent tasks can be used as a reference for evaluating the performance of machine vision codecs in scenarios such as video surveillance and smart industry.
[0151] Based on the same inventive concept, corresponding to the above method embodiment, the embodiment of the present disclosure provides a coding and decoding algorithm performance testing device, such as Figure 7As shown, the device includes: an acquisition module 701, a coding module 702, a machine vision detection module 703 and a result output module 704;
[0152] An acquisition module 701 is used to acquire a test image;
[0153] The encoding and decoding module 702 is used to encode the test image acquired by the acquisition module 701 using the encoding algorithm to be tested, and decode the encoded image using the decoding algorithm to be tested to obtain a reconstructed image;
[0154] The machine vision detection module 703 is used to perform machine vision detection on the reconstructed image obtained by the encoding and decoding module 702 to obtain a detection result and determine the detection accuracy of the detection result;
[0155] The result output module 704 is used to use the detection accuracy obtained by the machine vision detection module 703 as the performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested.
[0156] In some embodiments of the present disclosure, the acquisition module 701 is further used to:
[0157] Before encoding the test image using the coding algorithm to be tested, obtaining a specified coding algorithm identifier and a specified version identifier selected by a user;
[0158] A codec algorithm of a version identified by a specified version identifier in a specified codec algorithm identified by a specified codec algorithm identifier is obtained as a codec algorithm to be tested, wherein the codec algorithm to be tested includes a coding algorithm to be tested and a decoding algorithm to be tested.
[0159] In some embodiments of the present disclosure, the device further comprises:
[0160] The acquisition module 701 is further used to acquire the performance test results of other versions of the specified encoding and decoding algorithms after taking the detection accuracy as the performance test results of the encoding algorithm to be tested and the decoding algorithm to be tested;
[0161] A comparison module is used to compare the performance test results of the codec algorithm to be tested with the performance test results of other versions to obtain a comparison result;
[0162] The display module is used to display the comparison results obtained by the comparison module.
[0163] In some embodiments of the present disclosure, the performance test results further include: number of bits per pixel, encoding duration, and decoding duration; the device further includes:
[0164] A determination module, configured to generate a bitstream file based on the encoded image after encoding the test image using the encoding algorithm to be tested, and determine the number of bits per pixel of the bitstream file;
[0165] A statistics module, used to count the encoding time consumed for encoding the test image;
[0166] The statistics module is also used to count the decoding time consumed for decoding the bitstream file after the encoded image is decoded using the decoding algorithm to be tested.
[0167] In some embodiments of the present disclosure, the device further comprises:
[0168] A judgment module, used for judging whether there is a reconstructed image obtained by decoding the coded image using the decoding algorithm to be tested before encoding the test image using the coding algorithm to be tested;
[0169] A determination module is used to perform machine vision detection on the existing reconstructed image to obtain a detection result if the judgment result of the judgment module is existence, and determine the detection accuracy of the obtained detection result, and use the determined detection accuracy as the performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested;
[0170] The calling module is used to call the encoding and decoding module 702 to execute the steps of encoding the test image using the encoding algorithm to be tested and decoding the encoded image using the decoding algorithm to be tested if the judgment result of the judging module is non-existent.
[0171] In some embodiments of the present disclosure, the machine vision detection module 703 is specifically used to:
[0172] Find the machine vision detection model corresponding to the machine vision detection model identifier selected by the user;
[0173] The reconstructed image is input into the machine vision detection model to obtain the detection result.
[0174] In some embodiments of the present disclosure, the format of the reconstructed image is a specified image format; the apparatus further includes:
[0175] The conversion module is used to convert the format of the test image into a specified image format before encoding the test image using the coding algorithm to be tested.
[0176] Based on the same inventive concept, the embodiment of the present disclosure further provides a test platform, including: an encoding library, a decoding library, a model library and an electronic device; wherein the encoding library is used to store a plurality of encoding algorithms, the decoding library is used to store a plurality of decoding algorithms, and the model library is used to store a plurality of machine vision detection models;
[0177] An electronic device is used to obtain a test image; and encode the test image using a coding algorithm to be tested selected from a coding library, and decode the encoded image using a decoding algorithm to be tested selected from a decoding library to obtain a reconstructed image; and use a machine vision detection model selected from a model library to perform machine vision detection on the reconstructed image to obtain a detection result, and determine the detection accuracy of the detection result; and use the detection accuracy as a performance test result for the coding algorithm to be tested and the decoding algorithm to be tested.
[0178] The present disclosure also provides an electronic device, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0179] Memory 803, used for storing computer programs;
[0180] The processor 801 is used to implement the method steps in the above method embodiment when executing the program stored in the memory 803.
[0181] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0182] The communication interface is used for communication between the above electronic device and other devices.
[0183] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0184] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0185] In another embodiment provided by the present disclosure, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any of the above-mentioned coding and decoding algorithm performance testing methods are implemented.
[0186] In another embodiment provided by the present disclosure, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the encoding and decoding algorithm performance testing methods in the above embodiments.
[0187] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0188] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0189] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0190] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the protection scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure are included in the protection scope of the present disclosure.
Claims
1. A method for testing the performance of a coding and decoding algorithm, characterized in that: The method comprises: Get a test image; Encoding the test image using the coding algorithm to be tested, and decoding the encoded image using the decoding algorithm to be tested to obtain a reconstructed image; Performing machine vision detection on the reconstructed image to obtain a detection result, and determining a detection accuracy of the detection result; Using the detection accuracy as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested; Before encoding the test image using the coding algorithm to be tested, the method further includes: obtaining a specified coding algorithm identifier and a specified version identifier selected by a user; obtaining, among the specified coding algorithms identified by the specified coding algorithm identifier, a coding algorithm of a version identified by the specified version identifier as the coding algorithm to be tested, the coding algorithm to be tested including the coding algorithm to be tested and the decoding algorithm to be tested; For the same coding and decoding algorithm, different quantization parameters are set to distinguish different versions of the same coding and decoding algorithm; Wherein, the machine vision detection includes: target detection, instance segmentation or posture estimation; the machine vision detection result includes: whether the reconstructed image includes a target object and the category of the target object in the reconstructed image; when the machine vision detection is the target detection, the detection result also includes: the position of the detection box containing the target object in the reconstructed image; when the machine vision detection is the instance segmentation, the detection result also includes: the contour position of the target object in the reconstructed image; when the machine vision detection is the posture estimation, the detection result also includes: the position of the feature point of the target object in the reconstructed image; Performing machine vision detection on the reconstructed image to obtain a detection result includes: searching for a machine vision detection model corresponding to a machine vision detection model identifier selected by a user; and inputting the reconstructed image into the machine vision detection model to obtain the detection result.
2. The method according to claim 1, characterized in that After taking the detection accuracy as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested, the method further includes: Obtain performance test results of other versions of the specified encoding and decoding algorithm; Comparing the performance test result of the codec algorithm to be tested with the performance test results of other versions to obtain a comparison result; The comparison results are shown.
3. The method according to any one of claims 1 or 2, characterized in that: The performance test result also includes: number of bits per pixel, encoding time and decoding time; after encoding the test image using the coding algorithm to be tested, the method further includes: Generate a bitstream file based on the encoded image, and determine the number of bits per pixel of the bitstream file; Counting the encoding time consumed for encoding the test image; After decoding the encoded image using the decoding algorithm to be tested, the method further includes: The decoding time consumed for decoding the code stream file is counted.
4. The method according to any one of claims 1 or 2, characterized in that: Before encoding the test image using the coding algorithm to be tested, the method further includes: Determining whether there is a reconstructed image obtained by decoding the encoded image using the decoding algorithm to be tested; If it exists, perform machine vision detection on the existing reconstructed image to obtain a detection result, and determine the detection accuracy of the obtained detection result, and use the determined detection accuracy as the performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested; If not, the steps of encoding the test image using the encoding algorithm to be tested and decoding the encoded image using the decoding algorithm to be tested are performed.
5. The method according to any one of claims 1 or 2, characterized in that: The format of the reconstructed image is a specified image format; before encoding the test image using the coding algorithm to be tested, the method further includes: The format of the test image is converted into the specified image format.
6. A coding and decoding algorithm performance testing device, characterized in that: The device comprises: An acquisition module, used for acquiring a test image; A coding and decoding module, used to encode the test image acquired by the acquisition module using the coding algorithm to be tested, and decode the encoded image using the decoding algorithm to be tested to obtain a reconstructed image; A machine vision detection module, used to perform machine vision detection on the reconstructed image obtained by the encoding and decoding module, obtain a detection result, and determine the detection accuracy of the detection result; A result output module, used to use the detection accuracy obtained by the machine vision detection module as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested; The acquisition module is further used to: before encoding the test image using the coding algorithm to be tested, obtain a specified coding and decoding algorithm identifier and a specified version identifier selected by a user; obtain, among the specified coding and decoding algorithms identified by the specified coding and decoding algorithm identifier, a coding and decoding algorithm of a version identified by the specified version identifier as the coding and decoding algorithm to be tested, wherein the coding and decoding algorithm to be tested includes the coding algorithm to be tested and the decoding algorithm to be tested; For the same coding and decoding algorithm, different quantization parameters are set to distinguish different versions of the same coding and decoding algorithm; Wherein, the machine vision detection includes: target detection, instance segmentation or posture estimation; the machine vision detection result includes: whether the reconstructed image includes a target object and the category of the target object in the reconstructed image; when the machine vision detection is the target detection, the detection result also includes: the position of the detection box containing the target object in the reconstructed image; when the machine vision detection is the instance segmentation, the detection result also includes: the contour position of the target object in the reconstructed image; when the machine vision detection is the posture estimation, the detection result also includes: the position of the feature point of the target object in the reconstructed image; The machine vision detection module is specifically used to find the machine vision detection model corresponding to the machine vision detection model identifier selected by the user; input the reconstructed image into the machine vision detection model to obtain the detection result.
7. The device according to claim 6, characterized in that The device also includes: The acquisition module is further configured to acquire performance test results of other versions of the specified encoding and decoding algorithm after taking the detection accuracy as the performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested; A comparison module, used to compare the performance test result of the codec algorithm to be tested with the performance test results of other versions to obtain a comparison result; A display module is used to display the comparison result obtained by the comparison module.
8. The device according to any one of claims 6 or 7, characterized in that The performance test results also include: number of bits per pixel, encoding time and decoding time; the device also includes: A determination module, configured to generate a bitstream file based on the encoded image after encoding the test image using the encoding algorithm to be tested, and determine the number of bits per pixel of the bitstream file; A statistics module, used for counting the encoding time consumed for encoding the test image; The statistical module is further used to count the decoding time consumed for decoding the bitstream file after decoding the encoded image using the decoding algorithm to be tested.
9. The device according to any one of claims 6 or 7, characterized in that The device also includes: A judgment module, used for judging whether there is a reconstructed image obtained by decoding the coded image using the decoding algorithm to be tested before encoding the test image using the coding algorithm to be tested; a determination module, configured to, if the determination result of the determination module is yes, perform machine vision detection on the existing reconstructed image to obtain a detection result, and determine the detection accuracy of the obtained detection result, and use the determined detection accuracy as a performance test result of the encoding algorithm to be tested and the decoding algorithm to be tested; The calling module is used for calling the encoding and decoding module to execute the steps of encoding the test image by using the encoding algorithm to be tested, and decoding the encoded image by using the decoding algorithm to be tested, if the judgment result of the judging module is non-existent.
10. The device according to any one of claims 6 or 7, characterized in that The format of the reconstructed image is a specified image format; the device also includes: The conversion module is used to convert the format of the test image into the specified image format before encoding the test image using the coding algorithm to be tested.
11. A test platform, characterized in that: include: A coding library, a decoding library, a model library and an electronic device; wherein the coding library is used to store a variety of coding algorithms, the decoding library is used to store a variety of decoding algorithms, and the model library is used to store a variety of machine vision detection models; The electronic device is used to obtain a test image; and encode the test image using the coding algorithm to be tested selected from the coding library, and decode the encoded image using the decoding algorithm to be tested selected from the decoding library to obtain a reconstructed image; and perform machine vision detection on the reconstructed image using a machine vision detection model selected from the model library to obtain a detection result, and determine the detection accuracy of the detection result; and use the detection accuracy as a performance test result of the coding algorithm to be tested and the decoding algorithm to be tested; The electronic device is further used to obtain a specified codec algorithm identifier and a specified version identifier selected by a user before encoding the test image using the coding algorithm to be tested; obtain, among the specified codec algorithms identified by the specified codec algorithm identifier, a codec algorithm of a version identified by the specified version identifier as the codec algorithm to be tested, wherein the codec algorithm to be tested includes the coding algorithm to be tested and the decoding algorithm to be tested; For the same coding and decoding algorithm, different quantization parameters are set to distinguish different versions of the same coding and decoding algorithm; Wherein, the machine vision detection includes: target detection, instance segmentation or posture estimation; the machine vision detection result includes: whether the reconstructed image includes a target object and the category of the target object in the reconstructed image; when the machine vision detection is the target detection, the detection result also includes: the position of the detection box containing the target object in the reconstructed image; when the machine vision detection is the instance segmentation, the detection result also includes: the contour position of the target object in the reconstructed image; when the machine vision detection is the posture estimation, the detection result also includes: the position of the feature point of the target object in the reconstructed image; The electronic device is further used to search for a machine vision detection model corresponding to a machine vision detection model identifier selected by a user; and input the reconstructed image into the machine vision detection model to obtain the detection result.
12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Data test system and method
CN112422956A