Image processing method and device, electronic equipment, storage medium and program product

By determining the edge scaling ratio and controlling image scaling based on the basic visual unit size information of the multimodal large model in image processing, the problem of high service cost of large models is solved, and the number of lexical units is reduced while maintaining the accuracy of judgment, thus improving the user experience.

CN121563759APending Publication Date: 2026-02-24SHANGHAI SHIZHUANG INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511716649.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Large model service providers require a large number of lexical units when processing image and video information, resulting in high service costs and a low user experience.

Method used

By acquiring the image to be processed and the target area scaling ratio threshold, the edge scaling ratio of the image is determined based on the size information of the basic visual units of the multimodal large model. During the scaling process, the area scaling ratio of the image is controlled until the target scaling ratio threshold is reached, so as to optimize the image size and improve the judgment accuracy of the multimodal large model.

Benefits of technology

While maintaining the accuracy of multimodal large model judgment, the number of required lexical units has been reduced, thereby lowering the service costs for large model vendors and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121563759A_ABST
    Figure CN121563759A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and apparatus, an electronic device, a storage medium and a program product. The method comprises the steps of obtaining a to-be-processed image and a target area scaling threshold; the target area scaling ratio threshold is used for limiting the scaling degree of the to-be-processed image; wherein the target image obtained after zooming is used for inputting a multi-modal large model; determining an edge scaling of the to-be-processed image based on the size information of the basic visual unit of the multi-modal large model; according to the edge scaling, updating the current area scaling of the to-be-processed image to obtain a target area scaling; and scaling the to-be-processed image in an equal proportion according to the edge scaling ratio, and re-determining a new target area scaling ratio after scaling until the new target area scaling ratio is smaller than the target area scaling ratio threshold value, thereby obtaining a target image. According to the method, the number of needed lexical elements is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more specifically, to an image processing method, apparatus, electronic device, storage medium, and program product. Background Technology

[0002] When providing large model services, large model service providers typically determine the service cost based on the number of tokens required by the user to invoke the large model. Specifically, when a user invokes a large model, they usually first input text, image, and / or video information, etc. The large model service provider then provides the corresponding service based on the input information and determines the required number of tokens, thereby determining the service cost.

[0003] Processing image and video information typically requires a large number of lexical units, which leads to higher service costs for large model service providers. Consequently, they may set relatively high billing standards, requiring users to pay relatively high prices and reducing the user experience. Summary of the Invention

[0004] The purpose of this application is to provide an image processing method, apparatus, electronic device, storage medium, and program product to improve user experience.

[0005] Firstly, embodiments of this application provide an image processing method, comprising: acquiring an image to be processed and a target area scaling ratio threshold; the target area scaling ratio threshold is used to limit the scaling degree of the image to be processed; wherein the scaled target image is used as input to a multimodal large model; determining the side scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model; updating the current area scaling ratio of the image to be processed according to the side scaling ratio to obtain a target area scaling ratio; scaling the image to be processed proportionally according to the side scaling ratio, and redetermining a new target area scaling ratio after scaling, until the new target area scaling ratio is less than the target area scaling ratio threshold, thereby obtaining the target image. This method can reduce the image size input to the multimodal large model while maintaining the accuracy of the multimodal large model's judgment, thereby helping to reduce the number of required lexical units. This reduces the service cost for large model vendors, which in turn helps to lower the price paid by users and improve the user experience.

[0006] Optionally, the side scaling ratio includes the scaling ratio of the long side or the scaling ratio of the short side of the image to be processed; and determining the side scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model includes: determining the scaling ratio of the long side of the image to be processed based on the length information of the basic visual units of the multimodal large model; determining the scaling ratio of the short side of the image to be processed based on the width information of the basic visual units of the multimodal large model; determining a first area scaling ratio of the image to be processed based on the smaller of the long side scaling ratio and the short side scaling ratio, and the current area scaling ratio of the image to be processed; the first area scaling ratio represents the result obtained after further scaling according to the smaller of the current area scaling ratio. The first area scaling ratio is the ratio of the area obtained to the original area of ​​the image to be processed; if the first area scaling ratio is not less than the target area scaling ratio threshold, then the smaller one is determined as the side scaling ratio; if the first area scaling ratio is less than the target area scaling ratio threshold, then a second area scaling ratio of the image to be processed is determined according to the larger of the long side scaling ratio and the short side scaling ratio and the current area scaling ratio of the image to be processed; the second area scaling ratio represents the ratio of the area obtained after further scaling according to the larger one based on the current area scaling ratio to the original area of ​​the image to be processed; if the second area scaling ratio is not less than the target area scaling ratio threshold, then the larger one is determined as the side scaling ratio.

[0007] In this way, a more appropriate edge scaling ratio can be determined. After scaling the image to be processed according to the edge scaling ratio, the scaled image will not be too blurry, which helps to improve the judgment accuracy of multimodal large models and helps to reduce the number of words required.

[0008] Optionally, determining the scaling ratio of the long side of the image to be processed based on the length information of the basic visual unit of the multimodal large model includes: if the length of the image to be processed is an integer multiple of the length of the basic visual unit, then determining the difference between the length of the image to be processed and the length of the basic visual unit, and determining the scaling ratio of the long side based on the difference and the length of the image to be processed; if the length of the image to be processed is not an integer multiple of the length of the basic visual unit, then rounding down to the nearest multiple of the length of the basic visual unit, and determining the scaling ratio of the long side based on the multiple and the length of the image to be processed.

[0009] In this way, based on whether the length of the image to be processed is an integer multiple of the length of the basic visual unit, the scaling ratio of the long side can be adaptively determined to help improve the utilization of the basic visual unit, thereby helping to reduce the number of lexical units required.

[0010] Optionally, determining the short-side scaling ratio of the image to be processed based on the width information of the basic visual unit of the multimodal large model includes: if the width of the image to be processed is an integer multiple of the width of the basic visual unit, then determining the difference between the width of the image to be processed and the width of the basic visual unit, and determining the short-side scaling ratio based on the difference and the width of the image to be processed; if the width of the image to be processed is not an integer multiple of the width of the basic visual unit, then rounding down to the nearest multiple of the width of the basic visual unit, and determining the short-side scaling ratio based on the multiple and the width of the image to be processed.

[0011] In this way, based on whether the width of the image to be processed is an integer multiple of the width of the basic visual unit, the scaling ratio of the short side can be adaptively determined to help improve the utilization of the basic visual unit, thereby helping to reduce the number of lexical units required.

[0012] Optionally, determining the first area scaling ratio of the image to be processed based on the smaller of the scaling ratio of the long side and the scaling ratio of the short side, and the current area scaling ratio of the image to be processed, includes: determining the area change ratio obtained after scaling the image to be processed according to the smaller ratio; and determining the first area scaling ratio based on the area change ratio and the current area scaling ratio of the image to be processed. Thus, determining the first area scaling ratio based on the change in area scaling ratio helps improve the accuracy of the first area scaling ratio, and to a certain extent, helps improve the accuracy of the multimodal large model determination.

[0013] Optionally, determining the second area scaling ratio of the image to be processed based on the larger of the scaling ratio of the long side and the scaling ratio of the short side, and the current area scaling ratio of the image to be processed, includes: determining the area change ratio obtained after scaling the image to be processed according to the larger ratio; and determining the second area scaling ratio based on the area change ratio and the current area scaling ratio of the image to be processed. Thus, determining the second area scaling ratio based on the change in area scaling ratio helps improve the accuracy of the second area scaling ratio, and to some extent also helps improve the accuracy of multimodal large model determination.

[0014] Optionally, after acquiring the image to be processed, the method further includes: determining an image region in the image to be processed that will be used as input to the multimodal large model; determining the aspect ratio of the image region based on its length and width information; cropping the image to be processed based on the aspect ratio and a plurality of preset aspect ratio expectations; and determining the side scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model, which includes: determining the side scaling ratio of the cropped image region based on the size information of the basic visual units of the multimodal large model. In this way, cropping the image to be processed according to the aspect ratio expectation closest to its aspect ratio can improve the utilization rate of the basic visual units, thereby helping to reduce the number of required lexical units.

[0015] Optionally, cropping the image to be processed based on the aspect ratio and a plurality of preset aspect ratio expectations includes: determining the difference between the aspect ratio and each of the aspect ratio expectations; and cropping the image to be processed based on the aspect ratio expectation value corresponding to the smallest difference. This allows for the determination of the aspect ratio expectation value closest to the aspect ratio of the image region. Therefore, when the image cropped based on this aspect ratio expectation value is input into the multimodal large model, it may have only a small or no impact on the accuracy of the multimodal large model's judgments, but it helps to reduce the number of required lexical units.

[0016] Secondly, embodiments of this application provide an image processing apparatus, comprising: an acquisition module, configured to acquire an image to be processed and a target area scaling ratio threshold; the target area scaling ratio threshold is used to limit the scaling degree of the image to be processed; wherein the scaled target image is used as input to a multimodal large model; a determination module, configured to determine the side scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model; an update module, configured to update the current area scaling ratio of the image to be processed according to the side scaling ratio to obtain a target area scaling ratio; and a scaling module, configured to scale the image to be processed proportionally according to the side scaling ratio, and redetermine a new target area scaling ratio after scaling, until the new target area scaling ratio is less than the target area scaling ratio threshold, thereby obtaining the target image.

[0017] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the method provided in the first aspect above are performed.

[0018] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method provided in the first aspect above.

[0019] Fifthly, embodiments of this application provide a computer program product including a computer program or instructions that, when executed by a processor, perform the method described in the first aspect.

[0020] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of this application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A schematic diagram of an image to be processed provided in an embodiment of this application; Figure 2 A schematic diagram of a first-scaled image provided in an embodiment of this application; Figure 3 A schematic diagram of a second-scaled image provided in an embodiment of this application; Figure 4 A method for providing embodiments of this application Figure 3 A schematic diagram of the image being overlaid; Figure 5 This is a schematic diagram illustrating the process of overlaying an image, as provided in an embodiment of this application. Figure 6 A flowchart illustrating an image processing method provided in an embodiment of this application; Figure 7 This application provides a cutting example diagram; Figure 8 A structural block diagram of an image processing apparatus provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of an electronic device for performing an image processing method, provided as an embodiment of this application. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0024] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0025] It should be noted that, unless otherwise specified, the embodiments or technical features in the embodiments of this application may be combined.

[0026] In related technologies, large model service providers have higher service costs, which may lead them to set relatively high billing standards. This results in users having to pay relatively high prices, thus reducing the user experience.

[0027] Specifically, large models can include, for example, large language models and multimodal large models. Compared to large language models, multimodal large models often include image and / or video information in their input information, and processing these two types of input information usually requires more lexical units, which results in a relatively lower user experience.

[0028] To reduce the number of required terms, the resolution of image information can be reduced. However, if the resolution is too low, the image will become blurry, affecting the accuracy of the multimodal large model. For example, in object detection tasks, if the resolution of the input image is too low, the target object may become too blurry due to scaling, thus affecting the accuracy of the multimodal large model. Similarly, for video information, it can be processed into multiple images by extracting frames. However, if the frame extraction rate is too low, keyframes may be lost, affecting the accuracy of the multimodal large model.

[0029] It is evident that while reducing image resolution and video frame extraction can reduce the number of required lexical units and improve user experience to some extent, the risk of misjudgment in multimodal large models is relatively high.

[0030] To improve upon the above situation, this application provides an image processing method, apparatus, electronic device, storage medium, and program product. Furthermore, based on the size information of the basic visual units of a multimodal large model, this application determines the edge scaling ratio of the image to be processed and accordingly determines the target area scaling ratio. Then, it judges the target area scaling ratio using a target area scaling ratio threshold, ensuring that the image to be processed is not scaled too small, thus affecting the multimodal large model's recognition performance. This helps reduce the risk of misjudgment by the multimodal large model. Therefore, this application can reduce the number of required lexical units while maintaining the accuracy of the multimodal large model's judgment, thereby reducing the service costs for large model vendors, which in turn helps lower the price paid by users and improves the user experience.

[0031] It should be noted that the defects in the solutions in the above-mentioned related technologies were discovered by the inventors after long-term practice and careful research. Therefore, the discovery process of the above-mentioned problems and the solutions proposed by the embodiments of the present invention in the following text should all be contributions made by the inventors to the present invention during the process of the present invention.

[0032] Furthermore, the above image processing method can be executed on terminal devices such as mobile phones and laptops, or on server devices such as servers and cloud platforms, and this application does not limit it in this regard.

[0033] For ease of understanding, this application first explains the process of determining the required number of lexical units. Specifically, it includes two determination methods: a low-precision mode and a high-precision mode.

[0034] For low-precision mode, regardless of image size, it is scaled down to a fixed-size image patch, and the number of words required for a fixed-size image patch is 85. That is, regardless of image size, the number of words required is 85. Here, the fixed size may vary depending on the multimodal large model, and may be, for example, 512*512, 256*256, etc.

[0035] For high-precision mode, the specific number of tokens required depends on the image size. For example, the longer side of the image can be scaled to 2024. If the shorter side of the scaled image is longer than 768, further scaling is performed until the shorter side is equal to 768. Here, scaling is done proportionally. Then, the scaled image is covered using the aforementioned image patches to determine the minimum number of patches needed to completely cover the scaled image. Processing one image patch requires 170 tokens, which determines the minimum number of tokens required for each patch. Adding this to the fixed 85 tokens, the total number of tokens needed is obtained.

[0036] For easier understanding, please refer to Figures 1-4 This illustrates the scaling process for high-precision modes and the overlay process for image patches in related technologies. For example... Figure 1 As shown, the image to be processed is 2048*4096 pixels in size. It can be scaled up first (e.g., ...). Figure 2 As shown in the image, scaling the longer side to 2048 while maintaining the aspect ratio results in a scaled size of 1024*2048. Since the shorter side is now greater than 768, a second scaling step can be performed (as shown in the image). Figure 3 As shown), that is, continue scaling proportionally to obtain an image of size 768*1536. Then, it can be covered with 512*512 image blocks (such as...). Figure 4 As shown, each dashed box represents a 512*512 image block, and the solid line area represents the image before it is covered (i.e., the second scaled image). At this point, it can be determined that at least 6 image blocks are needed to completely cover the scaled image, so the total number of words can be calculated as: 170*6+85=1105.

[0037] For example, if the image to be processed is 1280*600 pixels, and both the long and short sides meet the size requirements of high-precision mode, then there is no need to scale the image. In this case, a 512*512 image block can be used to cover it (e.g., ...). Figure 5 As shown, each dashed box represents a 512*512 image block, and the solid line area represents the image before coverage. It can be determined that at least 6 image blocks are needed to completely cover the scaled image. Therefore, the total number of tokens can be calculated as: 170*6 + 85 = 1105.

[0038] This also shows that although the size of the original images input to a large multimodal model may differ, the total number of tokens required may ultimately be the same. Furthermore, for... Figure 4 as well as Figure 5 In both coverage scenarios shown, image patches 4-6 are not fully utilized, and Figure 5 The coverage shown is even more wasteful. Both result in low utilization of image patches.

[0039] Based on this, please continue to refer to Figure 6 The diagram illustrates a flowchart of an image processing method provided in an embodiment of this application. Figure 6 As shown, the image processing method includes steps 601 to 604.

[0040] Step 601: Obtain the image to be processed and the target area scaling ratio threshold; the target area scaling ratio threshold is used to limit the scaling degree of the image to be processed; wherein, the target image obtained after scaling is used as input to the multimodal large model; Furthermore, the aforementioned target area scaling threshold can be considered as a threshold representing the ratio of the target image's area to the original area of ​​the image to be processed. This can include values ​​greater than 0 and less than 1, such as 0.7, 0.6, or 0.16. Here, the target area scaling threshold can be set considering factors such as model task type and accuracy requirements. It can be pre-configured or user-adjustable.

[0041] Among them, the target area scaling ratio threshold can limit the scaling degree of the image to be processed, so as not to scale the image to be processed too small. This ensures that the target image obtained after scaling the image to be processed will not be too blurry, thereby reducing the risk of misjudgment of the target image by the multimodal large model.

[0042] Step 602: Based on the size information of the basic visual units of the multimodal large model, determine the edge scaling ratio of the image to be processed; The above-mentioned scaling ratio can be regarded as the ratio of the side length of the scaled image to the side length of the original image.

[0043] The basic visual units described above can be considered as the basic units used to cover the target image. Their size is relatively fixed, for example, they can be image patches of the fixed size mentioned above. The size of the basic visual units is directly related to the token calculation rules of the multimodal large model. Taking GPT-4 as an example, in high-precision mode, the number of tokens is calculated based on the coverage of the basic visual units (such as 512x512 image patches): each fully covered image patch requires 170 tokens, while a fixed 85 tokens are consumed as basic overhead. Therefore, optimizing the utilization rate of basic visual units can directly reduce the number of tokens, thereby saving costs.

[0044] Step 603: Update the current area scaling ratio of the image to be processed according to the edge scaling ratio to obtain the target area scaling ratio; The aforementioned current area scaling ratio can be considered as the ratio of the current area of ​​the image to be processed to its original area. Here, when the image to be processed is first scaled, its current area scaling ratio is 1.

[0045] The target area scaling ratio mentioned above can be regarded as the ratio of the area of ​​the image to be processed after further scaling according to the edge scaling ratio based on the current area scaling ratio to the original area of ​​the image to be processed.

[0046] Here, during the proportional scaling process, since the area scaling ratio is the square of the side scaling ratio, when updating the current area scaling ratio of the image to be processed, the square of the side scaling ratio can be multiplied by the current area scaling ratio to obtain the target area scaling ratio.

[0047] Step 604: Scale the image to be processed proportionally according to the edge scaling ratio, and redetermine a new target area scaling ratio after scaling until the new target area scaling ratio is less than the target area scaling ratio threshold to obtain the target image.

[0048] In other words, after scaling the image to be processed proportionally according to the edge scaling ratio, the edge scaling ratio of the scaled image can be re-determined based on the size information of the basic visual units mentioned above. Then, the current area scaling ratio of the scaled image is updated again according to the re-determined edge scaling ratio to obtain a new target area scaling ratio. Finally, when the new target area scaling ratio is less than the target area scaling ratio threshold, scaling stops, and the currently scaled image is determined as the target image.

[0049] For example, based on the size information of the basic visual units of the multimodal large model, the side scaling ratio M1 of the image to be processed A1 is determined. Then, the current area scaling ratio N1 of the image to be processed A1 is updated according to the side scaling ratio M1 to obtain the target area scaling ratio X1. Then, the image to be processed A1 is scaled according to the side scaling ratio M1 to obtain the scaled image A2. Then, the side scaling ratio M2 of the image A2 can be re-determined, and the current area scaling ratio N2 (i.e., X1) of the image A2 is updated according to the side scaling ratio M2 to obtain the target area scaling ratio X2. In this way, the updated target area scaling ratio is compared with the target area scaling ratio threshold until a certain X is less than the target area scaling ratio threshold, at which point the current image can be identified as the target image. For example, if X2 is less than the target area scaling ratio threshold, then image A2 can be identified as the target image. Here, it should be noted that the process of re-determining the new side scaling ratio and the new target area scaling ratio can be similar to the process in steps 602 to 603 above. For example, the image to be processed can simply be replaced with the scaled image for processing.

[0050] It is evident that during multiple scaling operations on the image to be processed, scaling can be stopped promptly when further scaling would cause the target area scaling ratio to fall below the target area scaling ratio threshold. This prevents the target image from being scaled too small and thus becoming overly blurry, thereby reducing the risk of misjudgment in multimodal large models. Furthermore, scaling the image to be processed proportionally to the edge scaling ratio can reduce the risk of image distortion, which also helps to reduce the risk of misjudgment in multimodal large models.

[0051] Furthermore, as the image to be processed is continuously scaled up, its size gradually decreases, resulting in a gradual reduction in the number of basic visual units used. Consequently, as the number of basic visual units decreases, the number of lexical units required also decreases. For example, as mentioned above... Figure 5 If the target area scaling threshold is 0.7, a target image with a resolution of 1280*600 can be obtained. In this case, three 512*512 image blocks can be used to cover the target image. If the target area scaling threshold is 0.6, a target image with a resolution of 1024*480 can be obtained. In this case, two 512*512 image blocks can be used to cover the target image. If the target area scaling threshold is 0.16, a target image with a resolution of 512*240 can be obtained. In this case, one 512*512 image block can be used to cover the target image.

[0052] Therefore, this implementation can reduce the image size of the input multimodal large model while maintaining the accuracy of the judgment. This helps to reduce the number of lexical units required, thereby reducing the service cost for large model manufacturers. This helps to reduce the price that users need to pay and improve the user experience.

[0053] In some optional implementations, the side scaling ratio includes either the scaling ratio of the long side or the scaling ratio of the short side of the image to be processed. Thus, in determining the side scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model, the following sub-steps can be specifically executed: Sub-step 6021: Based on the length information of the basic visual units of the multimodal large model, determine the scaling ratio of the long side of the image to be processed; The above-mentioned scaling ratio of the long side can be regarded as the ratio of the length of the long side of the image after scaling to the length of the long side of the original image.

[0054] In some optional implementations, if the length of the image to be processed is an integer multiple of the length of the basic visual unit, then the difference between the length of the image to be processed and the length of the basic visual unit is determined, and the scaling ratio of the long side is determined based on the difference and the length of the image to be processed. In some applications, for example, the length of the image to be processed can be moduloed by the length of the basic visual unit. If the remainder is 0, it can be determined that the length of the image to be processed is an integer multiple of the length of the basic visual unit. In this case, the length of the image to be processed can be subtracted from the length of the basic visual unit (for example, subtracting a fixed size of 512 from the length of the image to be processed), and then the difference can be divided by the length of the image to be processed, and the quotient can be determined as the scaling ratio of the longer side.

[0055] If the length of the image to be processed is not an integer multiple of the length of the basic visual unit, it is rounded down to the nearest multiple of the length of the basic visual unit, and the scaling ratio of the long side is determined based on the multiple and the length of the image to be processed.

[0056] In some applications, if the remainder after dividing the length of the image to be processed by the length of the basic visual unit is not zero, it can be determined that the length of the image to be processed is not an integer multiple of the length of the basic visual unit. In this case, the remainder can be rounded down to the nearest multiple of the fixed size of the basic visual unit. Based on this multiple and the fixed size of the basic visual unit, the length of the scaled long side can be determined. The quotient of the scaled long side length with the length of the image to be processed can then be used to determine the scaling ratio of the long side. For example, if the length of the image to be processed is 5.5 times the fixed size of the basic visual unit, it can be rounded down to 5. Then, 5 can be multiplied by the fixed size 512 to obtain the scaled long side length. The quotient of this product (the long side length) with the length of the image to be processed can then be used to obtain the scaling ratio of the side length.

[0057] Here, considering that when using basic visual units to cover a scaled image, if the length of the image to be processed is an integer multiple of the length of the basic visual unit, at least a portion of the image within a single basic visual unit will not be used to cover the image. Therefore, based on whether the length of the image to be processed is an integer multiple of the length of the basic visual unit, the scaling ratio of the longer side can be adaptively determined to improve the utilization rate of the basic visual units, thereby helping to reduce the number of required lexical units.

[0058] Sub-step 6022: Based on the width information of the basic visual units of the multimodal large model, determine the scaling ratio of the short side of the image to be processed; In some optional implementations, if the width of the image to be processed is an integer multiple of the width of the basic visual unit, then the difference between the width of the image to be processed and the width of the basic visual unit is determined, and the short side scaling ratio is determined based on the difference and the width of the image to be processed; if the width of the image to be processed is not an integer multiple of the width of the basic visual unit, then it is rounded down to the nearest multiple of the width of the basic visual unit, and the short side scaling ratio is determined based on the multiple and the width of the image to be processed.

[0059] In some application scenarios, the process of determining the scaling ratio of the short side and the resulting technical effects can be similar to the process of determining the scaling ratio of the long side and the resulting technical effects, which will not be elaborated here.

[0060] Sub-step 6023: Determine a first area scaling ratio of the image to be processed based on the smaller of the long side scaling ratio and the short side scaling ratio, and the current area scaling ratio of the image to be processed; the first area scaling ratio represents the ratio of the area obtained by further scaling according to the smaller of the current area scaling ratio to the original area of ​​the image to be processed. In some alternative implementations, for example, the area change ratio obtained after scaling the image to be processed according to the smaller one can be determined first; then, the first area scaling ratio can be determined based on the area change ratio and the current area scaling ratio of the image to be processed.

[0061] In some applications, the area scaling ratio is the square of the side scaling ratio. Therefore, after scaling the image to be processed based on the smaller of the two scaling ratios, the square of the smaller ratio can be determined as the change in area scaling ratio. Then, this change in area scaling ratio can be multiplied by the current area scaling ratio of the image to be processed to obtain the first area scaling ratio.

[0062] In this way, determining the first area scaling ratio based on the change in area scaling ratio helps to improve the accuracy of the first area scaling ratio, and to a certain extent helps to improve the accuracy of the judgment of multimodal large models.

[0063] Sub-step 6024: If the first area scaling ratio is not less than the target area scaling ratio threshold, then the smaller one is determined as the edge scaling ratio; Here, considering that the smaller of the scaling ratio of the long side and the scaling ratio of the short side can make the image smaller, thus helping to reduce the number of words required, we can first scale the image to be processed according to the smaller ratio. If the ratio of the scaled image area to the original area of ​​the image to be processed (i.e., the first area scaling ratio) is not less than the target area scaling ratio threshold, it can be considered that scaling according to the smaller ratio will not make the image to be processed too small, that is, it will not make the target image too blurry. Therefore, the smaller ratio can be determined as the side scaling ratio.

[0064] Sub-step 6025: If the first area scaling ratio is less than the target area scaling ratio threshold, then a second area scaling ratio of the image to be processed is determined based on the larger of the long side scaling ratio and the short side scaling ratio, and the current area scaling ratio of the image to be processed; the second area scaling ratio represents the ratio of the area obtained after further scaling according to the larger of the current area scaling ratio to the original area of ​​the image to be processed. In other words, if scaling to the smaller value results in the image being scaled too small, making the target image too blurry, then scaling to the larger value is preferable.

[0065] Similarly, in some alternative implementations, the area change ratio obtained after scaling the image to be processed according to the larger one can be determined first; then, the second area scaling ratio can be determined according to the area change ratio and the current area scaling ratio of the image to be processed.

[0066] In some applications, after scaling the image to be processed based on the larger of the scaling factors, the square of the larger factor can be used to determine the change in area scaling ratio. Then, this change in area scaling ratio can be multiplied by the current area scaling ratio of the image to be processed to obtain the second area scaling ratio.

[0067] In this way, determining the second area scaling ratio based on the change in area scaling ratio helps to improve the accuracy of the second area scaling ratio, and to some extent also helps to improve the accuracy of the judgment of multimodal large models.

[0068] Sub-step 6026: If the second area scaling ratio is not less than the target area scaling ratio threshold, then the larger one is determined as the edge scaling ratio.

[0069] Here, the image to be processed is scaled based on the larger of the two scaling factors. If the ratio of the scaled image area to the original area of ​​the image to be processed (i.e., the second area scaling factor) is not less than the target area scaling factor threshold, it can be considered that scaling based on the larger factor will not cause the image to be scaled too small, that is, it will not make the target image too blurry. Therefore, the larger factor can be determined as the scaling factor.

[0070] In addition, if the second area scaling ratio is less than the target area scaling ratio threshold, it can be considered that scaling according to the larger one will also cause the image to be processed to be scaled too small, resulting in the target image being too blurry. Therefore, the image to be processed can be directly determined as the target image.

[0071] In this implementation, through the above sub-steps 6021 to 6026, a more appropriate edge scaling ratio can be determined so that after scaling the image to be processed according to the edge scaling ratio, the scaled image will not be too blurry, thereby helping to improve the judgment accuracy of multimodal large models and helping to reduce the number of required lexical units.

[0072] Furthermore, the process of obtaining the target image described above can be implemented through code, for example. If the size of the basic visual unit is 512*512, a possible pseudocode example would be: Plain Text Algorithm CalScalingLength Input: ll represents the length of the long side, ll_f represents the scaling ratio of the long side, sl represents the length of the short side, sl_f represents the scaling ratio of the short side, f represents the scaling ratio of the side, af represents the current area scaling ratio, and af_t represents the area scaling ratio threshold. Onput: ll, sl af ← 1 While af>af_t Do: If ll % 512 == 0: ll_f ← (ll-512) / ll Else: ll_f ← (ll / / 512)*512 / ll If sl % 512 == 0: sl_f ← (sl-512) / sl Else: sl_f ← (sl / / 512)*512 / sl minimum_f ← min(sl_f, ll_f) maximum_f ← max(sl_f, ll_f) If af * (minimum_f**2) <af_t: If af * (maximum_f**2) <af_t: Break Else: f ← maximum_f Else: f ← ​​minimum_f ll ← ll * f sl ← sl * f af ← af * (f**2) End While Return ll, sl It should be noted that the entire process of the above code example can be divided into: During the initialization phase, the current area scaling ratio is set to 1, corresponding to the original area of ​​the image to be processed.

[0073] During the loop processing phase, the loop continues as long as the current area scaling ratio is greater than the target area scaling ratio threshold. Furthermore, in each loop iteration, the following operations are performed: (1) Calculation steps for the scaling ratio of the long side and the scaling ratio of the short side.

[0074] For the long side of the image, if the length of the long side is an integer multiple of the length of the basic visual unit, the scaling ratio of the long side is calculated as the ratio of (length of the long side - length of the basic visual unit) to the length of the long side. The purpose is to make the long side of the scaled image more efficiently covered by the basic visual unit. If the length of the long side is not an integer multiple of the length of the basic visual unit, the nearest integer multiple of the length of the basic visual unit is determined by rounding down, and the ratio of (multiple * length of the basic visual unit) to the length of the long side is used as the scaling ratio of the long side.

[0075] The same calculation logic is applied to the shorter side of the image to obtain the scaling ratio of the shorter side.

[0076] (2) Steps for selecting the scaling ratio.

[0077] First, the system compares the obtained long side scaling ratio with the short side scaling ratio to identify the smaller and larger values.

[0078] Then, it evaluates whether the estimated area after scaling with the smaller value (i.e., the product of the current area scaling ratio and the square of the smaller value) is not lower than the target area scaling ratio threshold. If the condition is met, the smaller value is selected as the edge scaling ratio for this iteration. If not, it further evaluates whether the estimated area after scaling with the larger value (i.e., the product of the current area scaling ratio and the square of the larger value) is not lower than the target area scaling ratio threshold. If the larger value meets the requirement, the larger value is selected as the edge scaling ratio. If neither of them meets the threshold requirement, the loop process is terminated.

[0079] (3) Image update steps.

[0080] Based on the selected side scaling ratio, the dimensions of the long and short sides of the image are adjusted proportionally, while the current area scaling ratio is updated to the product of the original value and the square of the side scaling ratio.

[0081] When the loop phase terminates, the final image size is output.

[0082] It should be noted that the conditional statements, loop statements, etc. involved in the above code are all well-known in the field. After learning about the above implementation method disclosed in this application, those skilled in the art can understand and implement it on their own without any creative effort.

[0083] In some application scenarios, the image to be processed may contain invalid information that is useless or has a relatively small effect on the decision-making process of a multimodal large model. However, this invalid information still occupies a portion of the image area, which necessitates the use of corresponding lexical units for this portion of the image. Therefore, in these application scenarios, this portion of the image area can be cropped to further reduce the number of lexical units required.

[0084] Therefore, in some alternative implementations, the following cropping step can be performed after acquiring the image to be processed: Step 1: Determine the image region in the image to be processed that will be used as input for the multimodal large model; In some applications, the image region can be determined based on user selection. Specifically, after acquiring the image to be processed, the user can be prompted to select an image region from the image to be used as input for a multimodal large model. In other applications, the image region can be determined based on automatic detection algorithms (such as semantic segmentation and object detection). For example, the text area, foreground area, etc., in the image to be processed can be identified as the image region to be used as input for a multimodal large model.

[0085] Step 2: Determine the aspect ratio of the image region based on its length and width information; Step 3: Based on the aspect ratio and multiple preset aspect ratio expectations, crop the image to be processed to remove invalid information. The aforementioned desired aspect ratios can include, for example, 1:1, 2:1, 3:1, and 4:1. These desired aspect ratios (1:1, 2:1, 3:1, 4:1) are set to maximize the utilization of basic visual units (BVRs). Taking a 512x512 BVR as an example, when the image aspect ratio is close to these ratios, scaling can ensure the image completely covers an integer number of BVRs, reducing the waste of BVRs caused by partial coverage. For instance, an image with an aspect ratio of 2:1, scaled to 1024x512, requires only 2 BVRs for complete coverage, achieving 100% utilization; while an image with an aspect ratio of 4:3, even with optimal scaling, requires at least 4 BVRs for complete coverage, resulting in only 75% utilization. Therefore, cropping and adjusting the aspect ratio to these desired values ​​minimizes the number of blocks required for coverage, directly optimizing the utilization of BVRs.

[0086] In some application scenarios, for example, the difference between the aspect ratio and each expected aspect ratio value can be determined first. Then, the image to be processed can be cropped according to the expected aspect ratio value corresponding to the smallest difference to remove invalid information. In this way, the expected aspect ratio value closest to the aspect ratio of the image region can be determined. Therefore, when the image obtained after cropping according to the expected aspect ratio value is input into the multimodal large model, it can have only a small impact or no impact on the judgment accuracy of the multimodal large model, but it helps to reduce the number of tokens required.

[0087] In other application scenarios, for example, the relative error between the aspect ratio and each expected aspect ratio value can be determined first. Then, the image to be processed can be cropped based on the expected aspect ratio value corresponding to the smallest relative error to remove invalid information. The relative error can be the difference between the aspect ratio and the expected aspect ratio value, divided by the difference and the expected aspect ratio value. This considers the magnitude of the expected aspect ratio value itself, which can improve the accuracy of the cropped image region to some extent. Therefore, it can have only a small or no impact on the accuracy of multimodal large model judgments, but helps to reduce the number of required lexical units.

[0088] Therefore, when determining the edge scaling ratio of the image to be processed based on the size information of the basic visual unit of the multimodal large model, the edge scaling ratio of the cropped image region can be specifically determined based on the size information of the basic visual unit of the multimodal large model.

[0089] To better understand the above cutting process, please refer to [link / reference needed]. Figure 7 (Each dashed box represents a 512*512 image patch, and the solid area represents the image before coverage.) It can be seen that when the maximum input image size for a multimodal large model is 2048*768, its aspect ratio is 8:3, requiring eight 512*512 basic visual units. However, if it is cropped according to the expected aspect ratio of 4:1, the invalid information area that would otherwise need to be covered by image patches 5-8 can be removed, thus achieving 100% utilization of the basic visual units.

[0090] It is evident that cropping the image to be processed according to the aspect ratio closest to its expected value can improve the utilization rate of basic visual units, thereby helping to reduce the number of lexical units required.

[0091] Those skilled in the art will understand that, in the methods described in the specific embodiments, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0092] It should be noted that video information can be considered as dynamic media information composed of multiple frames of images that are sequentially linked in time. Therefore, in some application scenarios, for example, the image processing methods described in any of the previous implementations can be performed on each frame of the video to obtain its corresponding target image, and then the multiple target images can be combined into a target video input multimodal large model. Alternatively, a frame extraction rate threshold can be set to limit the frame extraction rate and reduce the risk of keyframe loss. Then, the image processing methods described in any of the previous implementations can be performed on the extracted image frames to obtain their corresponding target images, and then the multiple target images can be combined into a target video input multimodal large model. In this way, the number of required lexical units can be reduced while maintaining the accuracy of the multimodal large model. Therefore, the service costs for large model vendors can be reduced, which helps to lower the price paid by users and improve the user experience.

[0093] Please see Figure 8 This diagram illustrates a structural block diagram of an image processing apparatus according to an embodiment of this application. The image processing apparatus may be a module, program segment, or code on an electronic device. It should be understood that this apparatus is similar to the one described above. Figure 6 The method implementation corresponds to this and can be executed. Figure 6 The various steps involved in the method implementation examples.

[0094] Optionally, the image processing apparatus includes an acquisition module 801, a determination module 802, an update module 803, and a scaling module 804. The acquisition module 801 acquires the image to be processed and a target area scaling ratio threshold; the target area scaling ratio threshold limits the scaling degree of the image to be processed; the scaled target image is used as input to a multimodal large model. The determination module 802 determines the edge scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model. The update module 803 updates the current area scaling ratio of the image to be processed according to the edge scaling ratio to obtain a target area scaling ratio. The scaling module 804 scales the image to be processed proportionally according to the edge scaling ratio, and redetermines a new target area scaling ratio after scaling, until the new target area scaling ratio is less than the target area scaling ratio threshold, thus obtaining the target image.

[0095] Optionally, the scaling ratio includes the scaling ratio of the long side or the scaling ratio of the short side of the image to be processed; and the determining module 802 is further configured to: determine the scaling ratio of the long side of the image to be processed based on the length information of the basic visual unit of the multimodal large model; determine the scaling ratio of the short side of the image to be processed based on the width information of the basic visual unit of the multimodal large model; determine a first area scaling ratio of the image to be processed based on the smaller of the scaling ratio of the long side and the scaling ratio of the short side, and the current area scaling ratio of the image to be processed; the first area scaling ratio represents the area obtained after further scaling according to the smaller of the current area scaling ratio relative to the image to be processed. The scaling factor is determined as follows: if the first area scaling factor is not less than the target area scaling factor threshold, the smaller one is determined as the side scaling factor; if the first area scaling factor is less than the target area scaling factor threshold, a second area scaling factor of the image to be processed is determined based on the larger of the long side scaling factor and the short side scaling factor, and the current area scaling factor of the image to be processed; the second area scaling factor represents the ratio of the area obtained by further scaling according to the larger one based on the current area scaling factor to the original area of ​​the image to be processed; if the second area scaling factor is not less than the target area scaling factor threshold, the larger one is determined as the side scaling factor.

[0096] Optionally, the determining module 802 is further configured to: if the length of the image to be processed is an integer multiple of the length of the basic visual unit, determine the difference between the length of the image to be processed and the length of the basic visual unit, and determine the long side scaling ratio based on the difference and the length of the image to be processed; if the length of the image to be processed is not an integer multiple of the length of the basic visual unit, round down to the nearest multiple of the length of the basic visual unit, and determine the long side scaling ratio based on the multiple and the length of the image to be processed.

[0097] Optionally, the determining module 802 is further configured to: if the width of the image to be processed is an integer multiple of the width of the basic visual unit, determine the difference between the width of the image to be processed and the width of the basic visual unit, and determine the short side scaling ratio based on the difference and the width of the image to be processed; if the width of the image to be processed is not an integer multiple of the width of the basic visual unit, round down to the nearest multiple of the width of the basic visual unit, and determine the short side scaling ratio based on the multiple and the width of the image to be processed.

[0098] Optionally, the determining module 802 is further configured to: determine the area change ratio obtained after scaling the image to be processed according to the smaller of the two; and determine the first area scaling ratio based on the area change ratio and the current area scaling ratio of the image to be processed.

[0099] Optionally, the determining module 802 is further configured to: determine the area change ratio obtained after scaling the image to be processed according to the larger one; and determine the second area scaling ratio based on the area change ratio and the current area scaling ratio of the image to be processed.

[0100] Optionally, the device further includes a cropping module, which is configured to: after acquiring the image to be processed, determine an image region in the image to be processed that is used to input the multimodal large model; determine the aspect ratio of the image region based on the length information and width information of the image region; crop the image to be processed based on the aspect ratio and a plurality of preset aspect ratio expectations; and the determining module 802 is further configured to: determine the side scaling ratio of the cropped image region based on the size information of the basic visual unit of the multimodal large model.

[0101] Optionally, the cropping module is further configured to: determine the difference between the aspect ratio and each of the expected aspect ratio values; and crop the image to be processed according to the expected aspect ratio value corresponding to the minimum difference.

[0102] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system or device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0103] Please see Figure 9 , Figure 9This is a schematic diagram of an electronic device for executing an image processing method, provided in an embodiment of this application. The electronic device may include: at least one processor 901, such as a CPU; at least one communication interface 902; at least one memory 903; and at least one communication bus 904. The communication bus 904 is used to enable direct communication between these components. In this embodiment, the communication interface 902 is used for signaling or data communication with other node devices. The memory 903 may be a high-speed RAM or a non-volatile memory, such as at least one disk storage device. Optionally, the memory 903 may also be at least one storage device located remotely from the aforementioned processor. The memory 903 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 901, the electronic device can execute the methods provided in the above-described method embodiments.

[0104] Understandable. Figure 9 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown. Figure 9 The components shown can be implemented using hardware, software, or a combination thereof.

[0105] This application provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it can perform the methods provided in the above-described method embodiments.

[0106] This application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the methods provided in the above-described method embodiments.

[0107] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

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

[0109] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0110] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. An image processing method, characterized in that, include: Obtain the scaling ratio threshold for the image to be processed and the target area; The target area scaling threshold is used to limit the scaling degree of the image to be processed; wherein, the scaled target image is used as input to the multimodal large model; Based on the size information of the basic visual units of the multimodal large model, the edge scaling ratio of the image to be processed is determined; Based on the edge scaling ratio, update the current area scaling ratio of the image to be processed to obtain the target area scaling ratio; The image to be processed is scaled proportionally according to the edge scaling ratio, and a new target area scaling ratio is determined after scaling until the new target area scaling ratio is less than the target area scaling ratio threshold, thus obtaining the target image.

2. The method according to claim 1, characterized in that, The scaling ratio includes the scaling ratio of the long side or the scaling ratio of the short side of the image to be processed. as well as Determining the edge scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model includes: Based on the length information of the basic visual units of the multimodal large model, the scaling ratio of the long side of the image to be processed is determined. Based on the width information of the basic visual units of the multimodal large model, the scaling ratio of the short side of the image to be processed is determined. A first area scaling ratio of the image to be processed is determined based on the smaller of the long side scaling ratio and the short side scaling ratio, and the current area scaling ratio of the image to be processed. The first area scaling ratio represents the ratio of the area obtained by further scaling according to the smaller of the current area scaling ratio to the original area of ​​the image to be processed. If the first area scaling ratio is not less than the target area scaling ratio threshold, then the smaller one is determined as the edge scaling ratio; If the first area scaling ratio is less than the target area scaling ratio threshold, then the second area scaling ratio of the image to be processed is determined based on the larger of the long side scaling ratio and the short side scaling ratio, and the current area scaling ratio of the image to be processed; the second area scaling ratio represents the ratio of the area obtained by further scaling according to the larger of the current area scaling ratio to the original area of ​​the image to be processed. If the second area scaling ratio is not less than the target area scaling ratio threshold, then the larger one is determined as the edge scaling ratio.

3. The method according to claim 2, characterized in that, Determining the scaling ratio of the long side of the image to be processed based on the length information of the basic visual units of the multimodal large model includes: If the length of the image to be processed is an integer multiple of the length of the basic visual unit, then the difference between the length of the image to be processed and the length of the basic visual unit is determined, and the scaling ratio of the long side is determined based on the difference and the length of the image to be processed. If the length of the image to be processed is not an integer multiple of the length of the basic visual unit, it is rounded down to the nearest multiple of the length of the basic visual unit, and the scaling ratio of the long side is determined based on the multiple and the length of the image to be processed.

4. The method according to claim 2, characterized in that, Determining the short-side scaling ratio of the image to be processed based on the width information of the basic visual units of the multimodal large model includes: If the width of the image to be processed is an integer multiple of the width of the basic visual unit, then the difference between the width of the image to be processed and the width of the basic visual unit is determined, and the short side scaling ratio is determined based on the difference and the width of the image to be processed. If the width of the image to be processed is not an integer multiple of the width of the basic visual unit, it is rounded down to the nearest multiple of the width of the basic visual unit, and the scaling ratio of the short side is determined based on the multiple and the width of the image to be processed.

5. The method according to claim 2, characterized in that, Determining the first area scaling ratio of the image to be processed based on the smaller of the long side scaling ratio and the short side scaling ratio, and the current area scaling ratio of the image to be processed, includes: Determine the area change ratio obtained after scaling the image to be processed according to the smaller of the values; The first area scaling ratio is determined based on the area change ratio and the current area scaling ratio of the image to be processed.

6. The method according to claim 2, characterized in that, Determining the second area scaling ratio of the image to be processed based on the larger of the long side scaling ratio and the short side scaling ratio, and the current area scaling ratio of the image to be processed, includes: Determine the area change ratio obtained after scaling the image to be processed according to the larger of the values; The second area scaling ratio is determined based on the area change ratio and the current area scaling ratio of the image to be processed.

7. The method according to claims 1-6, characterized in that, After acquiring the image to be processed, the method further includes: Identify the image region in the image to be processed that will be used as input for the multimodal large model; The aspect ratio of the image region is determined based on its length and width information. The image to be processed is cropped according to the aspect ratio and a plurality of preset aspect ratio expectations; and Determining the edge scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model includes: Based on the size information of the basic visual units of the multimodal large model, the edge scaling ratio of the cropped image region is determined.

8. The method according to claim 7, characterized in that, The step of cropping the image to be processed according to the aspect ratio and a plurality of preset aspect ratio expectations includes: Determine the difference between the aspect ratio and each of the expected aspect ratio values; The image to be processed is cropped based on the expected aspect ratio value corresponding to the minimum difference.

9. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the image to be processed and the target area scaling ratio threshold; The target area scaling threshold is used to limit the scaling degree of the image to be processed; wherein, the scaled target image is used as input to the multimodal large model; The determination module is used to determine the edge scaling ratio of the image to be processed based on the size information of the basic visual units of the multimodal large model; The update module is used to update the current area scaling ratio of the image to be processed according to the edge scaling ratio, so as to obtain the target area scaling ratio. The scaling module is used to scale the image to be processed proportionally according to the edge scaling ratio, and redetermine a new target area scaling ratio after scaling, until the new target area scaling ratio is less than the target area scaling ratio threshold, so as to obtain the target image.

10. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the method as described in any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1-8.

12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they perform the method as described in any one of claims 1-8.