import requests | |
import base64 | |
image_path = "1e30e924b899a901b26c6db54bafcc7d0308f59d.jpeg" | |
f = open(image_path, "rb") | |
img = base64.b64encode(f.read()).decode('utf-8') | |
f.close() | |
txt = """这个植物患有什么病虫害?""" | |
internvl_url = "http://192.168.185.20:8111/internvl" | |
inputs = {"text": txt, "image": img} | |
resp = requests.post(internvl_url, json=inputs).json() | |
print("internvl results", resp) |