File size: 414 Bytes
36ba3ef
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import requests


def get_image_description(image_path='Adam/game_image/tmp.png', local_mllm_port=7000):
    text = 'Please describe this Minecraft image'
    url = 'http://localhost:' + str(local_mllm_port) + '/send_image_text'
    files = {'image': open(image_path, 'rb')}
    data = {'text': text}

    response = requests.post(url, data=data, files=files)

    files['image'].close()

    return response.text