camp2 lmdeploy llava运行时输入高分辨率图片会返回空字符串
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
從 camp2/lmdeploy/README.md 的第 6.1 節開始,使用一張 1920×1080 的影像重現 LLaVA 範例。將空回應與提供的影像縮放 workaround 進行比較,然後更新範例或其處理方式,使高解析度輸入回傳文字;驗證文件中的範例會產生非空回應。
由索引模型根據 Issue 內容生成。
描述
camp2 lmdeploy llava运行时输入高分辨率图片会返回空字符串
当输入一张分辨率为 1920*1080 分辨率的图片时不会返回文字
打印response时显示text为空
解决方法为手动降低分辨率
import gradio as gr
from lmdeploy import pipeline
# pipe = pipeline('liuhaotian/llava-v1.6-vicuna-7b') 非开发机运行此命令
pipe = pipeline('/share/new_models/liuhaotian/llava-v1.6-vicuna-7b')
def model(image, text):
if image is None:
return [(text, "请上传一张图片。")]
else:
width, height = image.size
print(f"width = {width}, height = {height}")
# 调整图片最长宽/高为256
if max(width, height) > 256:
ratio = max(width, height) / 256
n_width = int(width / ratio)
n_height = int(height / ratio)
print(f"new width = {n_width}, new height = {n_height}")
image = image.resize((n_width, n_height))
response = pipe((text, image)).text
print(f"response: {response}")
return [(text, response)]
demo = gr.Interface(fn=model, inputs=[gr.Image(type="pil"), gr.Textbox()], outputs=gr.Chatbot())
demo.launch()
更改后效果可以正常返回text
- 主要語言
- Python
- 星號
- 2k
- 分支
- 1.4k
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
InternLM/Tutorial 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 85/100
-
難度 1/5 1 小時以內 新手友好度 65/100
-
使用100%A100运行报错未關閉
難度 4/5 3-5 天 新手友好度 30/100
-
test未關閉
難度 5/5 一週以上 新手友好度 1/100
-
難度 5/5 一週以上 新手友好度 20/100
查看 InternLM/Tutorial 的全部 Issue
相似的 Issue
-
accepted
難度 2/5 1-3 小時 新手友好度 66/100
future-agi/future-agi#5908 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
eclipse-score/coverage_tool#101 ·
維護者通常 2 天內回覆
-
Placeholder export disables HTML image input for picture description可能已有人在做 @cloudiful 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
docling-project/docling-serve#817 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 92/100
Techiebutler/freeframe#687 ·
維護者通常 1 天內回覆
-
Parse truncated verbose GC logs up to the first XML error可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉bug verbose GC
難度 2/5 1-3 小時 新手友好度 74/100
IBM/javacore-analyser#677 ·
維護者通常 1 天內回覆