{"id":20520,"date":"2025-02-08T16:12:16","date_gmt":"2025-02-08T08:12:16","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=20520"},"modified":"2025-02-08T22:28:19","modified_gmt":"2025-02-08T14:28:19","slug":"cogvlm2","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/de\/cogvlm2\/","title":{"rendered":"CogVLM2\uff1a\u5f00\u6e90\u591a\u6a21\u6001\u6a21\u578b\uff0c\u652f\u6301\u89c6\u9891\u7406\u89e3\u4e0e\u591a\u8f6e\u5bf9\u8bdd"},"content":{"rendered":"<p>CogVLM2 \u662f\u7531\u6e05\u534e\u5927\u5b66\u6570\u636e\u6316\u6398\u7814\u7a76\u7ec4\uff08THUDM\uff09\u5f00\u53d1\u7684\u5f00\u6e90\u591a\u6a21\u6001\u6a21\u578b\uff0c\u57fa\u4e8e Llama3-8B \u67b6\u6784\uff0c\u65e8\u5728\u63d0\u4f9b\u4e0e GPT-4V \u76f8\u5f53\u751a\u81f3\u66f4\u4f18\u7684\u6027\u80fd\u3002\u8be5\u6a21\u578b\u652f\u6301\u56fe\u50cf\u7406\u89e3\u3001\u591a\u8f6e\u5bf9\u8bdd\u4ee5\u53ca\u89c6\u9891\u7406\u89e3\uff0c\u80fd\u591f\u5904\u7406\u957f\u8fbe 8K \u7684\u5185\u5bb9\uff0c\u5e76\u652f\u6301\u9ad8\u8fbe 1344&#215;1344 \u7684\u56fe\u50cf\u5206\u8fa8\u7387\u3002CogVLM2 \u7cfb\u5217\u5305\u62ec\u591a\u4e2a\u5b50\u6a21\u578b\uff0c\u5206\u522b\u9488\u5bf9\u4e0d\u540c\u4efb\u52a1\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u5982\u6587\u672c\u95ee\u7b54\u3001\u6587\u6863\u95ee\u7b54\u548c\u89c6\u9891\u95ee\u7b54\u7b49\u3002\u8be5\u6a21\u578b\u4e0d\u4ec5\u652f\u6301\u4e2d\u82f1\u6587\u53cc\u8bed\uff0c\u8fd8\u63d0\u4f9b\u4e86\u591a\u79cd\u5728\u7ebf\u4f53\u9a8c\u548c\u90e8\u7f72\u65b9\u5f0f\uff0c\u65b9\u4fbf\u7528\u6237\u8fdb\u884c\u6d4b\u8bd5\u548c\u5e94\u7528\u3002<br \/>\n\u76f8\u5173\u4fe1\u606f\uff1a<a href=\"https:\/\/www.kdjingpai.com\/damoxingnenglijieba\/\">\u5927\u6a21\u578b\u80fd\u7406\u89e3\u591a\u957f\u7684\u89c6\u9891\uff1f\u667a\u8c31 GLM-4V-Plus\uff1a2\u5c0f\u65f6<\/a><br \/>\n<img decoding=\"async\" title=\"CogVLM2\uff1a\u5f00\u6e90\u591a\u6a21\u6001\u6a21\u578b\uff0c\u652f\u6301\u89c6\u9891\u7406\u89e3\u4e0e\u591a\u8f6e\u5bf9\u8bdd-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/02\/52860d8b9929862.png\" alt=\"CogVLM2\uff1a\u5f00\u6e90\u591a\u6a21\u6001\u6a21\u578b\uff0c\u652f\u6301\u89c6\u9891\u7406\u89e3\u4e0e\u591a\u8f6e\u5bf9\u8bdd-1\" \/><\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>\u56fe\u50cf\u7406\u89e3<\/strong>\uff1a\u652f\u6301\u9ad8\u5206\u8fa8\u7387\u56fe\u50cf\u7684\u7406\u89e3\u4e0e\u5904\u7406\u3002<\/li>\n<li><strong>\u591a\u8f6e\u5bf9\u8bdd<\/strong>\uff1a\u80fd\u591f\u8fdb\u884c\u591a\u8f6e\u5bf9\u8bdd\uff0c\u9002\u7528\u4e8e\u590d\u6742\u7684\u4ea4\u4e92\u573a\u666f\u3002<\/li>\n<li><strong>\u89c6\u9891\u7406\u89e3<\/strong>\uff1a\u901a\u8fc7\u63d0\u53d6\u5173\u952e\u5e27\uff0c\u652f\u6301\u6700\u957f 1 \u5206\u949f\u7684\u89c6\u9891\u5185\u5bb9\u7406\u89e3\u3002<\/li>\n<li><strong>\u591a\u8bed\u8a00\u652f\u6301<\/strong>\uff1a\u652f\u6301\u4e2d\u82f1\u6587\u53cc\u8bed\uff0c\u9002\u5e94\u4e0d\u540c\u8bed\u8a00\u73af\u5883\u3002<\/li>\n<li><strong>\u5f00\u653e\u6e90\u7801<\/strong>\uff1a\u63d0\u4f9b\u5b8c\u6574\u7684\u6e90\u7801\u548c\u6a21\u578b\u6743\u91cd\uff0c\u65b9\u4fbf\u7528\u6237\u8fdb\u884c\u4e8c\u6b21\u5f00\u53d1\u3002<\/li>\n<li><strong>\u5728\u7ebf\u4f53\u9a8c<\/strong>\uff1a\u63d0\u4f9b\u5728\u7ebf\u6f14\u793a\u5e73\u53f0\uff0c\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u4f53\u9a8c\u6a21\u578b\u529f\u80fd\u3002<\/li>\n<li><strong>\u591a\u79cd\u90e8\u7f72\u65b9\u5f0f<\/strong>\uff1a\u652f\u6301 Huggingface\u3001ModelScope \u7b49\u591a\u79cd\u5e73\u53f0\u7684\u90e8\u7f72\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u4e0e\u90e8\u7f72<\/h3>\n<ol>\n<li><strong>\u514b\u9686\u4ed3\u5e93<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   git clone https:\/\/github.com\/THUDM\/CogVLM2.git\r\ncd CogVLM2\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   pip install -r requirements.txt\r\n<\/code><\/pre>\n<ol start=\"3\">\n<li><strong>\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd<\/strong>\uff1a \u6839\u636e\u9700\u8981\u4e0b\u8f7d\u76f8\u5e94\u7684\u6a21\u578b\u6743\u91cd\uff0c\u5e76\u653e\u7f6e\u5728\u6307\u5b9a\u76ee\u5f55\u3002<\/li>\n<\/ol>\n<h3>\u4f7f\u7528\u793a\u4f8b<\/h3>\n<h4>\u56fe\u50cf\u7406\u89e3<\/h4>\n<ol>\n<li><strong>\u52a0\u8f7d\u6a21\u578b<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   from cogvlm2 import CogVLM2\r\nmodel = CogVLM2.load('path_to_model_weights')\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li><strong>\u5904\u7406\u56fe\u50cf<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   image = load_image('path_to_image')\r\nresult = model.predict(image)\r\nprint(result)\r\n<\/code><\/pre>\n<h4>\u591a\u8f6e\u5bf9\u8bdd<\/h4>\n<ol>\n<li><strong>\u521d\u59cb\u5316\u5bf9\u8bdd<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   conversation = model.start_conversation()\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li><strong>\u8fdb\u884c\u5bf9\u8bdd<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   response = conversation.ask('\u4f60\u7684\u95ee\u9898')\r\nprint(response)\r\n<\/code><\/pre>\n<h4>\u89c6\u9891\u7406\u89e3<\/h4>\n<ol>\n<li><strong>\u52a0\u8f7d\u89c6\u9891<\/strong>\uff1a<\/li>\n<\/ol>\n<pre><code>   video = load_video('path_to_video')\r\nresult = model.predict(video)\r\nprint(result)\r\n<\/code><\/pre>\n<h3>\u5728\u7ebf\u4f53\u9a8c<\/h3>\n<p>\u7528\u6237\u53ef\u4ee5\u8bbf\u95ee CogVLM2 \u5728\u7ebf\u6f14\u793a\u5e73\u53f0 \u8fdb\u884c\u6a21\u578b\u529f\u80fd\u7684\u5728\u7ebf\u4f53\u9a8c\uff0c\u65e0\u9700\u672c\u5730\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CogVLM2 \u662f\u7531\u6e05\u534e\u5927\u5b66\u6570\u636e\u6316\u6398\u7814\u7a76\u7ec4\uff08THUDM\uff09\u5f00\u53d1\u7684\u5f00\u6e90\u591a\u6a21\u6001\u6a21\u578b\uff0c\u57fa\u4e8e Llama3-8B \u67b6\u6784\uff0c\u65e8\u5728\u63d0\u4f9b\u4e0e GPT-4V \u76f8\u5f53\u751a\u81f3\u66f4\u4f18\u7684\u6027\u80fd\u3002\u8be5\u6a21\u578b\u652f\u6301\u56fe\u50cf\u7406\u89e3\u3001\u591a\u8f6e\u5bf9\u8bdd\u4ee5\u53ca\u89c6\u9891\u7406\u89e3\uff0c\u80fd\u591f\u5904\u7406\u957f\u8fbe 8K \u7684\u5185\u5bb9\uff0c\u5e76\u652f\u6301\u9ad8\u8fbe 1&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61793,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[230,378],"class_list":["post-20520","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikaiyuanxiangmu","tag-shijuemubiaojiance"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/20520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/comments?post=20520"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/20520\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media\/61793"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media?parent=20520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/categories?post=20520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/tags?post=20520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}