{"id":103196,"date":"2026-09-10T02:09:04","date_gmt":"2026-09-09T18:09:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/103196.html"},"modified":"2026-09-10T02:09:04","modified_gmt":"2026-09-09T18:09:04","slug":"%e5%a4%9a%e6%a8%a1%e6%80%81%e8%a7%86%e8%a7%89%e5%a4%a7%e6%a8%a1%e5%9e%8b%e5%ba%95%e5%b1%82%e6%9c%ba%e7%90%86%ef%bc%9a%e4%bb%8e-vit-patch-%e6%8a%95%e5%bd%b1%e5%88%b0-llava-%e5%8a%a8%e6%80%81%e9%ab%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/103196.html","title":{"rendered":"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218"},"content":{"rendered":"<h2>\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406&#xff1a;\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387&#xff08;AnyRes&#xff09;\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909180903-6aa1a0bf75252.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u591a\u6a21\u6001\u5927\u8bed\u8a00\u6a21\u578b&#xff08;Vision-Language Models &#8211; VLM&#xff0c;\u5982 GPT-4o\u3001Claude-3.5-Sonnet\u3001LLaVA \u7cfb\u5217&#xff09;\u5168\u9762\u6e17\u900f\u5de5\u4e1a\u8d28\u68c0\u3001\u533b\u7597\u5f71\u50cf\u5224\u8bfb\u3001\u5bc6\u96c6\u6587\u6863 OCR \u4e0e\u590d\u6742\u56fe\u8868\u5206\u6790\u7684\u4eca\u5929&#xff0c;\u8bb8\u591a\u5f00\u53d1\u56e2\u961f\u5728\u5c1d\u8bd5\u672c\u5730\u5fae\u8c03\u6216\u63a8\u7406\u591a\u6a21\u6001\u5927\u6a21\u578b\u65f6&#xff0c;\u666e\u904d\u906d\u9047\u4e86\u4ee4\u4eba\u6cae\u4e27\u7684**\u201c\u5fae\u5c0f\u7ec6\u8282\u5931\u660e\u4e0e\u5206\u8fa8\u7387\u4e24\u96be\u56f0\u5883\u201d**&#xff1a;<\/p>\n<ul>\n<li>\u201c\u4e00\u5200\u5207\u5f3a\u884c\u7f29\u653e\u201d\u7684\u7ec6\u8282\u706d\u5931\u707e\u96be&#xff1a;\u65e9\u671f\u7684\u591a\u6a21\u6001\u6a21\u578b&#xff08;\u5982\u521d\u4ee3 LLaVA-1.5 \/ MiniGPT-4&#xff09;\u4e3a\u4e86\u9002\u914d\u89c6\u89c9\u7f16\u7801\u5668&#xff08;ViT&#xff09;\u56fa\u5b9a\u7684\u8f93\u5165\u5c3a\u5bf8&#xff0c;\u5fc5\u987b\u5c06\u6240\u6709\u7528\u6237\u4e0a\u4f20\u7684\u56fe\u7247\u5f3a\u884c\u901a\u8fc7\u53cc\u7ebf\u6027\u63d2\u503c\u7f29\u653e\u5230\u56fa\u5b9a\u5927\u5c0f&#xff08;\u4f8b\u5982 $336 \\\\times 336$ \u6216 $448 \\\\times 448$&#xff09;\u3002\u5f53\u9762\u5bf9\u4e00\u5f20\u5305\u542b\u6570\u767e\u884c\u5bc6\u96c6\u6587\u5b57\u7684\u8d22\u62a5 PDF \u622a\u56fe\u6216 $4\\\\text{K}$ \u5de5\u4e1a\u7535\u8def\u677f\u56fe\u7247\u65f6&#xff0c;\u7f29\u653e\u540e\u7684\u6587\u5b57\u548c\u5fae\u5c0f\u5143\u5668\u4ef6\u88ab\u4e25\u91cd\u6a21\u7cca\u5316\u4e3a\u4e0d\u53ef\u8fa8\u8ba4\u7684\u9a6c\u8d5b\u514b&#xff0c;\u6a21\u578b\u53ea\u80fd\u9760\u201c\u5e7b\u89c9\u201d\u80e1\u4e71\u731c\u6d4b&#xff1b;<\/li>\n<li>\u201c\u65e0\u8111\u5806\u780c\u539f\u59cb\u50cf\u7d20\u201d\u5f15\u53d1\u7684\u663e\u5b58\u4e0e\u8ba1\u7b97\u96ea\u5d29&#xff1a;\u5982\u679c\u76f4\u63a5\u5c06\u4e00\u5f20 $4096 \\\\times 4096$ \u7684\u8d85\u9ad8\u6e05\u539f\u56fe\u4e0d\u7ecf\u5904\u7406\u6309 $14 \\\\times 14$ Patch \u5207\u7247\u9001\u5165 ViT&#xff0c;\u4f1a\u77ac\u95f4\u751f\u6210\u9ad8\u8fbe 85,000&#043; \u4e2a\u89c6\u89c9 Token&#xff01;\u8fd9\u4e0d\u4ec5\u4f1a\u77ac\u95f4\u51fb\u7a7f\u4efb\u4f55\u4e3b\u6d41 LLM \u7684\u4e0a\u4e0b\u6587\u7a97\u53e3&#xff0c;\u66f4\u4f1a\u5bfc\u81f4\u6ce8\u610f\u529b\u77e9\u9635\u7684\u8ba1\u7b97\u8017\u65f6\u66b4\u589e\u6570\u5343\u500d&#xff0c;\u63a8\u7406\u5ef6\u8fdf\u5f7b\u5e95\u762b\u75ea&#xff01;<\/li>\n<\/ul>\n<p>\u73b0\u4ee3\u524d\u6cbf\u591a\u6a21\u6001\u5927\u6a21\u578b\u7a76\u7adf\u662f\u5982\u4f55\u5728\u201c\u770b\u6e05\u5fae\u5c0f\u6587\u5b57\u7ec6\u8282\u201d\u4e0e\u201c\u63a7\u5236\u89c6\u89c9 Token \u7b97\u529b\u5f00\u9500\u201d\u4e4b\u95f4\u53d6\u5f97\u7cbe\u5999\u5e73\u8861\u7684&#xff1f; \u4ee5 LLaVA-NeXT \u4e3a\u4ee3\u8868\u7684\u52a8\u6001\u9ad8\u5206\u8fa8\u7387&#xff08;AnyRes: Any-Resolution&#xff09;\u673a\u5236\u4e0e\u7a7a\u95f4\u6c60\u5316\u538b\u7f29&#xff08;Spatial Pooling&#xff09;\u5e95\u5c42\u7684\u7269\u7406\u6620\u5c04\u77e9\u9635\u662f\u5982\u4f55\u6784\u5efa\u7684&#xff1f;<\/p>\n<p>\u672c\u6587\u6df1\u5165\u5256\u6790\u89c6\u89c9\u7f16\u7801\u5668 ViT Patch \u6295\u5f71\u3001LLaVA AnyRes \u52a8\u6001\u7f51\u683c\u5207\u7247\u6570\u5b66\u673a\u7406&#xff0c;\u5e76\u7ed9\u51fa\u751f\u4ea7\u7ea7 PyTorch \u591a\u6a21\u6001\u52a8\u6001\u5206\u8fa8\u7387\u7279\u5f81\u5bf9\u9f50\u7f51\u7edc\u5b9e\u6218\u4ee3\u7801\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u4f20\u7edf\u56fa\u5b9a\u7f29\u653e VLM vs \u73b0\u4ee3\u52a8\u6001\u9ad8\u5206\u8fa8\u7387&#xff08;AnyRes&#xff09;\u5168\u666f\u5bf9\u6bd4\u77e9\u9635<\/h3>\n<table>\n<tr>\u591a\u6a21\u6001\u67b6\u6784\u7ef4\u5ea6\u4f20\u7edf\u56fa\u5b9a\u5c3a\u5bf8 VLM (Fixed Resolution)\u73b0\u4ee3\u52a8\u6001\u9ad8\u5206\u8fa8\u7387 VLM (LLaVA AnyRes \u8303\u5f0f)\u6838\u5fc3\u751f\u4ea7\u80fd\u529b\u4ee3\u5dee<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u8f93\u5165\u56fe\u50cf\u9002\u914d\u673a\u5236<\/td>\n<td align=\"left\">\u65e0\u8111\u5f3a\u5236\u7b49\u6bd4\/\u53d8\u5f62\u7f29\u653e\u81f3\u56fa\u5b9a\u5c0f\u56fe (\u5982 336&#215;336)<\/td>\n<td align=\"left\">&#x1f3c6; \u4f9d\u636e\u539f\u56fe\u771f\u5b9e\u5bbd\u9ad8\u6bd4&#xff0c;\u81ea\u9002\u5e94\u5207\u5206\u4e3a\u52a8\u6001\u7f51\u683c\u5207\u7247<\/td>\n<td align=\"left\">\u5b8c\u7f8e\u4fdd\u7559 100% \u539f\u59cb\u957f\u5bbd\u6bd4\u4e0e\u7269\u7406\u50cf\u7d20\u7ec6\u8282<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5bc6\u96c6\u6587\u6863 OCR \u51c6\u786e\u7387<\/td>\n<td align=\"left\">\u6781\u5176\u4f4e\u4e0b&#xff08;\u5c0f\u5b57\u6a21\u7cca\u6210\u5757&#xff0c;\u8bc6\u522b\u9519\u8bef\u7387 $&gt; 40%$&#xff09;<\/td>\n<td align=\"left\">&#x1f3c6; \u7a81\u7834 95%&#043;&#xff08;\u53ef\u6e05\u6670\u8fa8\u8bc6 4K \u590d\u6742\u56fe\u8868\u4e0e\u5fae\u5c0f\u89d2\u6807&#xff09;<\/td>\n<td align=\"left\">\u771f\u6b63\u5177\u5907\u5546\u4e1a\u7ea7\u6587\u6863\u62bd\u53d6\u4e0e\u590d\u6742\u56fe\u8868\u89e3\u6790\u80fd\u529b<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u89c6\u89c9 Token \u6d88\u8017\u63a7\u5236<\/td>\n<td align=\"left\">\u56fa\u5b9a\u751f\u6210 576 \u4e2a Token (\u65e0\u6cd5\u968f\u590d\u6742\u5ea6\u4f38\u7f29)<\/td>\n<td align=\"left\">\u52a8\u6001\u751f\u6210: \u5168\u5c40\u7f29\u7565\u56fe Token &#043; $N$ \u4e2a\u9ad8\u6e05\u5c40\u90e8\u5207\u7247 Token<\/td>\n<td align=\"left\">\u7b80\u5355\u5c0f\u56fe\u6d88\u8017\u6781\u5c11&#xff0c;\u590d\u6742\u9ad8\u6e05\u5927\u56fe\u6309\u9700\u5206\u914d\u7b97\u529b<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u957f\u7a0b\u89c6\u91ce\u5168\u5c40\u611f\u77e5<\/td>\n<td align=\"left\">\u4e22\u5931\u5c40\u90e8\u7ec6\u8282<\/td>\n<td align=\"left\">&#x1f3c6; \u53cc\u6d41\u878d\u5408 (Dual-Stream): \u5168\u5c40\u8bed\u4e49\u5b8f\u89c2\u56fe &#043; \u5c40\u90e8\u9ad8\u6e05\u5fae\u89c2\u5207\u7247<\/td>\n<td align=\"left\">\u517c\u5177\u5b8f\u89c2\u573a\u666f\u7406\u89e3\u4e0e\u5fae\u89c2\u50cf\u7d20\u7ea7\u5b9a\u4f4d\u80fd\u529b<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u8de8\u6a21\u6001\u7279\u5f81\u5bf9\u9f50\u5c42<\/td>\n<td align=\"left\">\u7b80\u5355\u5355\u5c42\u7ebf\u6027\u6295\u5f71&#xff08;Linear Projection&#xff09;<\/td>\n<td align=\"left\">\u4e24\u5c42\u6df1\u5ea6 MLP Adapter &#043; \u7a7a\u95f4\u4e0b\u91c7\u6837\u6c60\u5316 (Spatial Pooling)<\/td>\n<td align=\"left\">\u5c06\u89c6\u89c9\u7279\u5f81\u5411 LLM \u6587\u672c\u8bed\u4e49\u7a7a\u95f4\u7684\u6295\u5f71\u7cbe\u5ea6\u62c9\u6ee1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e8c\u3001LLaVA AnyRes \u52a8\u6001\u7f51\u683c\u5207\u7247\u4e0e\u5168\u5c40\u53cc\u6d41\u7279\u5f81\u878d\u5408\u62d3\u6251<\/h3>\n<p>[\u539f\u59cb\u8d85\u9ad8\u6e05\u8f93\u5165\u539f\u56fe: 1344 x 672 \u50cf\u7d20 (\u5bbd\u9ad8\u6bd4 2:1)]<br \/>\n                               |<br \/>\n            &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n            |                                     |<br \/>\n            v (\u901a\u8def 1: \u63d0\u53d6\u5168\u5c40\u5b8f\u89c2\u8bed\u4e49)          v (\u901a\u8def 2: \u52a8\u6001\u7f51\u683c\u5207\u7247\u63d0\u53d6\u5fae\u89c2\u7ec6\u8282)<br \/>\n[\u4e0b\u91c7\u6837\u4e3a 336&#215;336 \u5168\u5c40\u7f29\u7565\u56fe]                 [\u4f9d\u636e\u5bbd\u9ad8\u6bd4\u5212\u5206\u4e3a 2 \u4e2a 336&#215;336 \u9ad8\u6e05\u5207\u7247]<br \/>\n            |                                     |<br \/>\n            v                                     v<br \/>\n[ViT \u7f16\u7801: \u4ea7\u51fa\u5168\u5c40\u7279\u5f81 $F_{\\\\text{global}}$]   [ViT \u72ec\u7acb\u7f16\u7801: \u4ea7\u51fa\u5207\u7247\u7279\u5f81 $F_{\\\\text{crop1}}, F_{\\\\text{crop2}}$]<br \/>\n            |                                     |<br \/>\n            &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n                               |<br \/>\n                               v (\u5728\u7279\u5f81\u7ef4\u5ea6\u6309\u7a7a\u95f4\u7f51\u683c\u62d3\u6251\u8fdb\u884c\u62fc\u63a5\u62fc\u63a5&#xff0c;\u6ce8\u5165\u6362\u884c\u7b26 Token)<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| &#x1f31f; \u7a7a\u95f4\u6c60\u5316\u538b\u7f29\u4e0e MLP Adapter \u6a21\u6001\u5bf9\u9f50\u6295\u5f71 (Spatial Pooling &amp; MLP Projector):   |<br \/>\n| 1. \u5bf9\u6bcf\u4e2a 2&#215;2 \u89c6\u89c9 Token \u7f51\u683c\u6267\u884c\u5377\u79ef\/\u6c60\u5316\u4e0b\u91c7\u6837 (Token \u6570\u91cf\u538b\u7f29 75%!)         |<br \/>\n| 2. \u901a\u8fc7 2 \u5c42 MLP \u6fc0\u6d3b\u6295\u5f71\u5c42: $\\\\mathbf{H}_V &#061; \\\\text{GELU}(W_1 \\\\mathbf{F}_V) W_2$|<br \/>\n|    \u5c06\u89c6\u89c9\u9690\u85cf\u7ef4\u5ea6 (1024) \u6295\u5f71\u6620\u5c04\u5230 LLM \u6587\u672c\u5d4c\u5165\u7a7a\u95f4\u7ef4\u5ea6 (4096)               |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n                               |<br \/>\n                               v<br \/>\n[\u88c5\u914d\u4e3a\u89c6\u89c9 Token \u5e8f\u5217&#xff0c;\u4e0e\u7528\u6237\u6587\u672c Prompt &#096;&lt;image&gt;\\\\n\u8bf7\u5206\u6790\u56fe\u4e2d\u8d22\u62a5\u6570\u636e&#096; \u6df7\u5408\u9001\u5165 LLM \u89e3\u7801!]<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u52a8\u6001\u7f51\u683c\u5019\u9009\u641c\u7d22&#xff08;Grid Selection&#xff09;\u6570\u5b66\u7b97\u6cd5<\/h3>\n<p>\u5f53\u4efb\u610f\u5c3a\u5bf8 $W \\\\times H$ \u7684\u539f\u59cb\u56fe\u7247\u8f93\u5165\u65f6&#xff0c;\u7cfb\u7edf\u9884\u8bbe\u4e86\u4e00\u7ec4\u6807\u51c6\u7684\u5019\u9009\u7f51\u683c\u914d\u7f6e $\\\\mathcal{G}$&#xff08;\u5982 ${ (1,1), (1,2), (2,1), (2,2), (1,3), (3,1) }$&#xff0c;\u6bcf\u4e2a\u683c\u5b50\u7269\u7406\u5c3a\u5bf8\u4e3a $S \\\\times S &#061; 336 \\\\times 336$&#xff09;\u3002<\/p>\n<h4>1. \u5bfb\u627e\u6709\u6548\u5206\u8fa8\u7387\u635f\u5931\u6700\u5c0f\u7684\u6700\u4f73\u7f51\u683c<\/h4>\n<p>\u7cfb\u7edf\u904d\u5386\u6240\u6709\u5019\u9009\u7f51\u683c $(m, n) \\\\in \\\\mathcal{G}$&#xff0c;\u8ba1\u7b97\u5c06\u539f\u56fe\u7f29\u653e\u5230 $mS \\\\times nS$ \u65f6\u7684\u7f29\u653e\u5c3a\u5ea6&#xff08;Scale Factor&#xff09;\u4e0e\u6709\u6548\u50cf\u7d20\u5229\u7528\u7387&#xff1a;<\/p>\n<p>$$(m^, n^) &#061; \\\\arg\\\\min_{(m, n) \\\\in \\\\mathcal{G}} \\\\left| \\\\frac{W}{H} &#8211; \\\\frac{m}{n} \\\\right| \\\\quad \\\\text{\u4e14} \\\\quad \\\\text{Area}(m, n) \\\\approx \\\\text{Area}(W, H)$$<\/p>\n<ul>\n<li>\u7269\u7406\u610f\u4e49&#xff1a;\u7b97\u6cd5\u81ea\u52a8\u9009\u62e9\u6700\u8d34\u5408\u539f\u56fe\u7269\u7406\u6bd4\u4f8b\u3001\u4e14\u56fe\u50cf\u53d8\u5f62\u5931\u771f\u6700\u5c0f\u7684\u5207\u7247\u7f51\u683c&#xff0c;\u5f7b\u5e95\u6d88\u9664\u4e86\u4f20\u7edf\u53d8\u5f62\u7f29\u653e\u9020\u6210\u7684\u7269\u4f53\u62c9\u4f38\u4e0e\u7578\u53d8&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<h3>\u56db\u3001\u751f\u4ea7\u7ea7 PyTorch \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\u89c6\u89c9\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218\u4ee3\u7801<\/h3>\n<p>\u4e0b\u9762\u7684\u4ee3\u7801\u5c55\u793a\u4e86\u5728 PyTorch \u4e2d\u5982\u4f55\u6784\u5efa \u52a8\u6001\u56fe\u50cf\u5207\u7247\u5668&#xff08;AnyRes Slicer&#xff09;\u3001ViT \u7279\u5f81\u63d0\u53d6\u6a21\u62df\u5668\u3001\u7a7a\u95f4\u6c60\u5316\u538b\u7f29\u5668\u4e0e MLP \u6a21\u6001\u6295\u5f71\u5c42\u3002<\/p>\n<p>&#034;&#034;&#034;<br \/>\nllava_anyres_vision_projector.py<br \/>\nLLaVA AnyRes \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\u7f51\u683c\u5207\u7247\u4e0e\u7a7a\u95f4\u6c60\u5316\u6a21\u6001\u5bf9\u9f50\u7f51\u7edc\u5b9e\u6218<br \/>\n&#034;&#034;&#034;<\/p>\n<p>import math<br \/>\nimport torch<br \/>\nimport torch.nn as nn<br \/>\nimport torch.nn.functional as F<br \/>\nfrom typing import List, Tuple<\/p>\n<p>class AnyResImageSlicer:<br \/>\n    &#034;&#034;&#034;\u52a8\u6001\u9ad8\u5206\u8fa8\u7387\u56fe\u50cf\u5207\u7247\u5668&#xff1a;\u5c06\u4efb\u610f\u5c3a\u5bf8\u56fe\u7247\u5207\u5206\u4e3a\u6700\u4f73\u7f51\u683c &#043; \u5168\u5c40\u7f29\u7565\u56fe&#034;&#034;&#034;<\/p>\n<p>    def __init__(self, patch_size: int &#061; 336):<br \/>\n        self.patch_size &#061; patch_size<br \/>\n        # \u9884\u8bbe\u5019\u9009\u7f51\u683c\u62d3\u6251 (\u9ad8\u5ea6\u5207\u7247\u6570, \u5bbd\u5ea6\u5207\u7247\u6570)<br \/>\n        self.candidate_grids &#061; [(1, 1), (1, 2), (2, 1), (2, 2), (1, 3), (3, 1)]<\/p>\n<p>    def select_best_grid(self, original_width: int, original_height: int) -&gt; Tuple[int, int]:<br \/>\n        &#034;&#034;&#034;\u9009\u62e9\u4e0e\u539f\u56fe\u5bbd\u9ad8\u6bd4\u6700\u5339\u914d\u7684\u5019\u9009\u7f51\u683c&#034;&#034;&#034;<br \/>\n        orig_aspect_ratio &#061; original_width \/ original_height<br \/>\n        best_grid &#061; (1, 1)<br \/>\n        min_diff &#061; float(&#034;inf&#034;)<\/p>\n<p>        for grid_h, grid_w in self.candidate_grids:<br \/>\n            grid_aspect_ratio &#061; grid_w \/ grid_h<br \/>\n            diff &#061; abs(orig_aspect_ratio &#8211; grid_aspect_ratio)<br \/>\n            if diff &lt; min_diff:<br \/>\n                min_diff &#061; diff<br \/>\n                best_grid &#061; (grid_h, grid_w)<\/p>\n<p>        return best_grid<\/p>\n<p>    def slice_image_tensor(self, image_tensor: torch.Tensor) -&gt; Tuple[torch.Tensor, List[torch.Tensor], Tuple[int, int]]:<br \/>\n        &#034;&#034;&#034;<br \/>\n        \u8f93\u5165: [3, H, W] \u539f\u59cb\u56fe\u7247\u5f20\u91cf<br \/>\n        \u8fd4\u56de: (\u5168\u5c40\u7f29\u7565\u56fe [3, 336, 336], \u5c40\u90e8\u9ad8\u6e05\u5207\u7247\u5217\u8868, \u9009\u4e2d\u7684\u7f51\u683c\u5c3a\u5bf8)<br \/>\n        &#034;&#034;&#034;<br \/>\n        _, h, w &#061; image_tensor.shape<br \/>\n        grid_h, grid_w &#061; self.select_best_grid(w, h)<\/p>\n<p>        # 1. \u901a\u8def 1: \u751f\u6210\u5168\u5c40\u7f29\u7565\u56fe<br \/>\n        global_thumb &#061; F.interpolate(<br \/>\n            image_tensor.unsqueeze(0), size&#061;(self.patch_size, self.patch_size), mode&#061;&#034;bilinear&#034;, align_corners&#061;False<br \/>\n        ).squeeze(0)<\/p>\n<p>        # 2. \u901a\u8def 2: \u5c06\u539f\u56fe\u7f29\u653e\u5230\u76ee\u6807\u7f51\u683c\u603b\u5c3a\u5bf8\u5e76\u5207\u7247<br \/>\n        target_h &#061; grid_h * self.patch_size<br \/>\n        target_w &#061; grid_w * self.patch_size<br \/>\n        resized_full &#061; F.interpolate(<br \/>\n            image_tensor.unsqueeze(0), size&#061;(target_h, target_w), mode&#061;&#034;bilinear&#034;, align_corners&#061;False<br \/>\n        ).squeeze(0)<\/p>\n<p>        patches &#061; []<br \/>\n        for i in range(grid_h):<br \/>\n            for j in range(grid_w):<br \/>\n                patch &#061; resized_full[<br \/>\n                    :,<br \/>\n                    i * self.patch_size : (i &#043; 1) * self.patch_size,<br \/>\n                    j * self.patch_size : (j &#043; 1) * self.patch_size,<br \/>\n                ]<br \/>\n                patches.append(patch)<\/p>\n<p>        return global_thumb, patches, (grid_h, grid_w)<\/p>\n<p>class MultiModalVisionProjector(nn.Module):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u591a\u6a21\u6001\u8de8\u6a21\u6001\u5bf9\u9f50\u7f51\u7edc&#xff1a;<br \/>\n    \u5305\u542b\u7a7a\u95f4\u6c60\u5316&#xff08;Spatial Pooling \u538b\u7f29 Token&#xff09;\u4e0e 2 \u5c42 MLP \u6295\u5f71\u5c42<br \/>\n    &#034;&#034;&#034;<\/p>\n<p>    def __init__(self, vision_dim: int &#061; 1024, llm_dim: int &#061; 4096):<br \/>\n        super().__init__()<br \/>\n        # 2&#215;2 \u7a7a\u95f4\u6c60\u5316\u4e0b\u91c7\u6837 (\u5c06\u76f8\u90bb 4 \u4e2a\u89c6\u89c9 Token \u878d\u5408\u6210 1 \u4e2a&#xff0c;\u964d\u4f4e 75% \u5f00\u9500!)<br \/>\n        self.pooling &#061; nn.AvgPool2d(kernel_size&#061;2, stride&#061;2)<br \/>\n        # MLP \u6295\u5f71\u5c42<br \/>\n        self.mlp_adapter &#061; nn.Sequential(<br \/>\n            nn.Linear(vision_dim, llm_dim),<br \/>\n            nn.GELU(),<br \/>\n            nn.Linear(llm_dim, llm_dim)<br \/>\n        )<\/p>\n<p>    def forward(self, vision_features: torch.Tensor, grid_shape: Tuple[int, int]) -&gt; torch.Tensor:<br \/>\n        &#034;&#034;&#034;<br \/>\n        vision_features: [NumPatches, SeqLenPerPatch, VisionDim]<br \/>\n        \u8fd4\u56de: \u5bf9\u9f50\u5230 LLM \u8bed\u4e49\u7a7a\u95f4\u4e14\u7ecf\u8fc7\u538b\u7f29\u7684\u89c6\u89c9 Token: [TotalVisionTokens, LLM_Dim]<br \/>\n        &#034;&#034;&#034;<br \/>\n        # \u5047\u8bbe\u5355\u5207\u7247\u5728 ViT \u8f93\u51fa\u4e3a 24&#215;24 &#061; 576 \u4e2a Token (\u5bf9\u5e94 336&#215;336 \u56fe\u7247)<br \/>\n        num_patches, seq_len, v_dim &#061; vision_features.shape<br \/>\n        side_len &#061; int(math.sqrt(seq_len))<\/p>\n<p>        # \u8f6c\u6362\u4e3a\u7a7a\u95f4 2D \u7279\u5f81\u56fe: [NumPatches, VisionDim, 24, 24]<br \/>\n        feat_2d &#061; vision_features.permute(0, 2, 1).view(num_patches, v_dim, side_len, side_len)<\/p>\n<p>        # &#x1f31f; \u7a7a\u95f4\u6c60\u5316\u538b\u7f29: 24&#215;24 \u2794 12&#215;12 (\u5355\u4e2a\u5207\u7247 Token \u6570\u4ece 576 \u538b\u7f29\u81f3 144!)<br \/>\n        pooled_2d &#061; self.pooling(feat_2d)<br \/>\n        _, _, p_h, p_w &#061; pooled_2d.shape<\/p>\n<p>        # \u5c55\u5e73\u56de\u5e8f\u5217: [NumPatches, 144, VisionDim]<br \/>\n        pooled_seq &#061; pooled_2d.view(num_patches, v_dim, p_h * p_w).permute(0, 2, 1)<\/p>\n<p>        # &#x1f31f; \u901a\u8fc7 MLP Adapter \u6295\u5f71\u6620\u5c04\u5230 LLM \u5d4c\u5165\u7a7a\u95f4 (1024 \u2794 4096)<br \/>\n        llm_aligned_tokens &#061; self.mlp_adapter(pooled_seq)<\/p>\n<p>        # \u5408\u5e76\u6240\u6709\u5207\u7247\u4e0e\u5168\u5c40\u7279\u5f81\u4e3a\u4e00\u4e2a\u6241\u5e73\u7684 Token \u6d41<br \/>\n        final_tokens &#061; llm_aligned_tokens.reshape(-1, llm_aligned_tokens.shape[-1])<br \/>\n        return final_tokens<\/p>\n<p>if __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    torch.manual_seed(2026)<br \/>\n    print(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;)<br \/>\n    print(&#034;&#x1f52c; \u918d\u9190\u5b9e\u9a8c\u5ba4&#xff1a;\u591a\u6a21\u6001\u5927\u6a21\u578b AnyRes \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\u4e0e\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218&#034;)<br \/>\n    print(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;\\\\n&#034;)<\/p>\n<p>    slicer &#061; AnyResImageSlicer(patch_size&#061;336)<br \/>\n    projector &#061; MultiModalVisionProjector(vision_dim&#061;1024, llm_dim&#061;4096)<\/p>\n<p>    # 1. \u6a21\u62df\u8f93\u5165\u4e00\u5f20 1344 x 672 (\u5bbd\u9ad8\u6bd4 2:1) \u7684\u8d85\u9ad8\u6e05\u957f\u56fe<br \/>\n    mock_raw_image &#061; torch.randn(3, 672, 1344)<br \/>\n    print(f&#034;1. [\u539f\u59cb\u56fe\u50cf\u8f93\u5165]: \u5c3a\u5bf8\u4e3a {mock_raw_image.shape[-1]} x {mock_raw_image.shape[-2]} \u50cf\u7d20 (\u9ad8\u5206\u8fa8\u7387)&#034;)<\/p>\n<p>    # 2. \u52a8\u6001\u5207\u7247<br \/>\n    thumb, patches, selected_grid &#061; slicer.slice_image_tensor(mock_raw_image)<br \/>\n    print(f&#034;2. [AnyRes \u81ea\u52a8\u5207\u7247]:&#034;)<br \/>\n    print(f&#034;   &#8211; \u6700\u4f73\u5339\u914d\u7f51\u683c: {selected_grid[0]} \u884c x {selected_grid[1]} \u5217 (\u5171 {len(patches)} \u4e2a\u9ad8\u6e05\u5207\u7247)&#034;)<br \/>\n    print(f&#034;   &#8211; \u5168\u5c40\u7f29\u7565\u56fe\u5c3a\u5bf8: {thumb.shape}&#034;)<br \/>\n    print(f&#034;   &#8211; \u6bcf\u4e2a\u9ad8\u6e05\u5207\u7247\u5c3a\u5bf8: {patches[0].shape}&#034;)<\/p>\n<p>    # 3. \u6a21\u62df ViT \u7279\u5f81\u63d0\u53d6 (\u5168\u5c40\u56fe &#043; 2 \u4e2a\u5207\u7247 &#061; 3 \u4e2a Patch)<br \/>\n    total_crops &#061; [thumb] &#043; patches  # \u5f62\u72b6: 3 \u4e2a [3, 336, 336]<br \/>\n    # \u6a21\u62df ViT \u4e3a\u6bcf\u4e2a\u5207\u7247\u8f93\u51fa 24&#215;24 &#061; 576 \u4e2a 1024 \u7ef4\u7279\u5f81<br \/>\n    mock_vit_output &#061; torch.randn(len(total_crops), 576, 1024)<\/p>\n<p>    # 4. \u7a7a\u95f4\u6c60\u5316\u538b\u7f29\u4e0e\u6a21\u6001\u5bf9\u9f50\u6295\u5f71<br \/>\n    aligned_llm_tokens &#061; projector(mock_vit_output, selected_grid)<\/p>\n<p>    print(f&#034;\\\\n3. [\u8de8\u6a21\u6001\u7279\u5f81\u5bf9\u9f50\u4e0e\u7a7a\u95f4\u538b\u7f29\u7ed3\u679c]:&#034;)<br \/>\n    print(f&#034;   &#8211; \u539f\u59cb\u672a\u7ecf\u538b\u7f29\u7684\u89c6\u89c9 Token \u6570: {len(total_crops) * 576} \u4e2a&#034;)<br \/>\n    print(f&#034;   &#8211; \u7a7a\u95f4\u6c60\u5316\u540e\u9001\u5165 LLM \u7684\u89c6\u89c9 Token \u6570: {aligned_llm_tokens.shape[0]} \u4e2a (\u538b\u7f29\u7387 75%!)&#034;)<br \/>\n    print(f&#034;   &#8211; \u6700\u7ec8\u89c6\u89c9 Token \u5d4c\u5165\u7ef4\u5ea6: {aligned_llm_tokens.shape[1]} (\u5b8c\u7f8e\u5bf9\u9f50 LLM \u7684 4096 \u7ef4\u8bcd\u8868\u7a7a\u95f4)&#034;)<\/p>\n<p>    print(&#034;\\\\n&#x1f4a1; \u9a8c\u8bc1\u7ed3\u8bba&#xff1a;AnyRes \u6210\u529f\u517c\u987e\u4e86\u9ad8\u5206\u8fa8\u7387\u7ec6\u8282\u6355\u83b7\u4e0e\u89c6\u89c9 Token \u6570\u91cf\u7684\u5927\u5e45\u7cbe\u7b80&#xff01;&#034;)<br \/>\n    print(&#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;)<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u591a\u6a21\u6001\u7cfb\u7edf\u751f\u4ea7\u7ea7\u843d\u5730\u907f\u5751\u4e0e\u8c03\u4f18\u7ea2\u7ebf<\/h3>\n<p>\u5728\u751f\u4ea7\u4e2d\u90e8\u7f72\u4e0e\u5fae\u8c03\u9ad8\u5206\u8fa8\u7387\u591a\u6a21\u6001\u5927\u6a21\u578b\u65f6&#xff0c;\u5fc5\u987b\u4e25\u683c\u628a\u63a7\u4ee5\u4e0b\u56db\u9879\u5de5\u7a0b\u7ea2\u7ebf&#xff1a;<\/p>\n<li>\u5207\u7247\u4e4b\u95f4\u5fc5\u987b\u663e\u5f0f\u6ce8\u5165\u201c\u56fe\u50cf\u6362\u884c\u7b26 Token&#xff08;Image Newline Token&#xff09;\u201d&#xff1a;\u5f53\u5c06 2D \u7f51\u683c\u5207\u7247\u5c55\u5e73\u6210 1D Token \u5e8f\u5217\u9001\u5165 LLM \u65f6&#xff0c;\u5fc5\u987b\u5728\u6bcf\u4e00\u884c\u7684\u672b\u5c3e\u663e\u5f0f\u63d2\u5165\u4e00\u4e2a\u53ef\u5b66\u4e60\u7684\u7279\u6b8a\u6362\u884c\u6807\u8bb0&#xff08;\u5982 &lt;image_newline&gt;&#xff09;&#xff0c;\u5426\u5219 LLM \u4f1a\u4e27\u5931\u5bf9\u7a7a\u95f4 2D \u51e0\u4f55\u90bb\u63a5\u5173\u7cfb\u7684\u611f\u77e5&#xff0c;\u5bfc\u81f4\u56fe\u8868\u5750\u6807\u5b9a\u4f4d\u5b8c\u5168\u6df7\u4e71&#xff1b;<\/li>\n<li>\u9650\u5236\u6700\u5927\u5207\u7247\u7f51\u683c\u6570&#xff08;\u63a8\u8350\u4e0a\u9650\u4e3a $2 \\\\times 2$ \u6216 $3 \\\\times 3$&#xff09;&#xff1a;\u5bf9\u4e8e\u6781\u7aef\u8d85\u957f\u56fe&#xff08;\u5982 $10000 \\\\times 500$ \u7684\u957f\u957f\u7f51\u9875\u622a\u56fe&#xff09;&#xff0c;\u82e5\u751f\u6210 30 \u4e2a\u5207\u7247&#xff0c;\u5373\u4f7f\u6c60\u5316\u4e5f\u4f1a\u751f\u6210\u6570\u5343\u4e2a Token\u3002\u5fc5\u987b\u8bbe\u5b9a\u6700\u5927\u5207\u7247\u4e0a\u9650&#xff08;Max Patches $\\\\le 6$&#xff09;&#xff0c;\u8d85\u51fa\u90e8\u5206\u81ea\u52a8\u8fdb\u884c\u7b49\u6bd4\u5e73\u6ed1\u9884\u4e0b\u91c7\u6837&#xff1b;<\/li>\n<li>\u5fae\u8c03\u521d\u671f\u5fc5\u987b\u51bb\u7ed3 ViT \u89c6\u89c9\u7f16\u7801\u5668&#xff1a;\u5728\u8de8\u6a21\u6001\u5bf9\u9f50\u5fae\u8c03&#xff08;Stage 1&#xff09;\u9636\u6bb5&#xff0c;\u7edd\u5bf9\u7981\u6b62\u5f00\u542f ViT \u5168\u53c2\u6570\u5fae\u8c03&#xff01;\u4ec5\u5fae\u8c03 MLP Projector \u6743\u91cd&#xff0c;\u5f85\u5bf9\u9f50\u635f\u5931\u5145\u5206\u6536\u655b\u540e&#xff0c;\u518d\u5728\u6307\u4ee4\u5fae\u8c03&#xff08;Stage 2&#xff09;\u9636\u6bb5\u4ee5\u6781\u5c0f\u5b66\u4e60\u7387&#xff08;\u5982 $2\\\\text{e-}6$&#xff09;\u8fdb\u884c\u7aef\u5230\u7aef\u8054\u5408\u5fae\u8c03&#xff0c;\u9632\u6b62\u7834\u574f ViT \u9884\u8bad\u7ec3\u7684\u5e95\u5c42\u89c6\u89c9\u8868\u5f81\u3002<\/li>\n<p>\u901a\u8fc7\u6784\u5efa\u57fa\u4e8e AnyRes \u52a8\u6001\u7f51\u683c\u5207\u7247\u7684\u5fae\u89c2\u7ec6\u8282\u611f\u77e5\u901a\u8def\u4e0e\u7a7a\u95f4\u6c60\u5316\u538b\u7f29\u7684\u8de8\u6a21\u6001\u6295\u5f71\u5c42&#xff0c;\u591a\u6a21\u6001\u5927\u6a21\u578b\u67b6\u6784\u80fd\u591f\u5f7b\u5e95\u6323\u8131\u4f20\u7edf\u56fa\u5b9a\u5206\u8fa8\u7387\u7684\u7269\u7406\u67b7\u9501&#xff0c;\u5728\u5de5\u4e1a\u7ea7\u590d\u6742\u89c6\u89c9\u8ba4\u77e5\u4e0e\u9ad8\u7cbe\u5ea6\u5bc6\u96c6\u6587\u6863\u89e3\u6790\u4e2d\u5c55\u73b0\u51fa\u4ee4\u4eba\u60ca\u53f9\u7684\u6d1e\u5bdf\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406&#xff1a;\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387&#xff08;AnyRes&#xff09;\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218\u5728\u591a\u6a21\u6001\u5927\u8bed\u8a00\u6a21\u578b&#xff08;Vision-Language Models &#8211; VLM&#xff0c;\u5982 GPT-4o\u3001Claude-3.5-Sonnet\u3001LLaVA \u7cfb\u5217&#xff09;\u5168\u9762\u6e17\u900f\u5de5\u4e1a\u8d28\u68c0\u3001\u533b\u7597\u5f71\u50cf\u5224\u8bfb\u3001\u5bc6\u96c6\u6587\u6863 OCR \u4e0e\u590d\u6742\u56fe\u8868\u5206\u6790\u7684\u4eca\u5929&#xff0c;\u8bb8\u591a\u5f00\u53d1\u56e2\u961f\u5728\u5c1d\u8bd5\u672c\u5730\u5fae\u8c03\u6216\u63a8\u7406\u591a\u6a21\u6001\u5927\u6a21\u578b\u65f6&amp;#<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50],"topic":[],"class_list":["post-103196","post","type-post","status-publish","format-standard","hentry","category-server","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/103196.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406&#xff1a;\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387&#xff08;AnyRes&#xff09;\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218\u5728\u591a\u6a21\u6001\u5927\u8bed\u8a00\u6a21\u578b&#xff08;Vision-Language Models - VLM&#xff0c;\u5982 GPT-4o\u3001Claude-3.5-Sonnet\u3001LLaVA \u7cfb\u5217&#xff09;\u5168\u9762\u6e17\u900f\u5de5\u4e1a\u8d28\u68c0\u3001\u533b\u7597\u5f71\u50cf\u5224\u8bfb\u3001\u5bc6\u96c6\u6587\u6863 OCR \u4e0e\u590d\u6742\u56fe\u8868\u5206\u6790\u7684\u4eca\u5929&#xff0c;\u8bb8\u591a\u5f00\u53d1\u56e2\u961f\u5728\u5c1d\u8bd5\u672c\u5730\u5fae\u8c03\u6216\u63a8\u7406\u591a\u6a21\u6001\u5927\u6a21\u578b\u65f6&amp;#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/103196.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-09T18:09:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909180903-6aa1a0bf75252.webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/103196.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/103196.html\",\"name\":\"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-09T18:09:04+00:00\",\"dateModified\":\"2026-09-09T18:09:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/103196.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/103196.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/103196.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/103196.html","og_locale":"zh_CN","og_type":"article","og_title":"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406&#xff1a;\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387&#xff08;AnyRes&#xff09;\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218\u5728\u591a\u6a21\u6001\u5927\u8bed\u8a00\u6a21\u578b&#xff08;Vision-Language Models - VLM&#xff0c;\u5982 GPT-4o\u3001Claude-3.5-Sonnet\u3001LLaVA \u7cfb\u5217&#xff09;\u5168\u9762\u6e17\u900f\u5de5\u4e1a\u8d28\u68c0\u3001\u533b\u7597\u5f71\u50cf\u5224\u8bfb\u3001\u5bc6\u96c6\u6587\u6863 OCR \u4e0e\u590d\u6742\u56fe\u8868\u5206\u6790\u7684\u4eca\u5929&#xff0c;\u8bb8\u591a\u5f00\u53d1\u56e2\u961f\u5728\u5c1d\u8bd5\u672c\u5730\u5fae\u8c03\u6216\u63a8\u7406\u591a\u6a21\u6001\u5927\u6a21\u578b\u65f6&amp;#","og_url":"https:\/\/www.wsisp.com\/helps\/103196.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-09T18:09:04+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909180903-6aa1a0bf75252.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/103196.html","url":"https:\/\/www.wsisp.com\/helps\/103196.html","name":"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-09T18:09:04+00:00","dateModified":"2026-09-09T18:09:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/103196.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/103196.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/103196.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u591a\u6a21\u6001\u89c6\u89c9\u5927\u6a21\u578b\u5e95\u5c42\u673a\u7406\uff1a\u4ece ViT Patch \u6295\u5f71\u5230 LLaVA \u52a8\u6001\u9ad8\u5206\u8fa8\u7387\uff08AnyRes\uff09\u7279\u5f81\u5bf9\u9f50\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/103196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=103196"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/103196\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=103196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=103196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=103196"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=103196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}