OmniParser
OmniParser copied to clipboard
本地部署教程
https://youtu.be/IJsDfoZg2QM
请参考 https://github.com/microsoft/OmniParser/pull/52 中的Dockerfile,该文件已实现。使用方法如下:
% sudo nvidia-docker build -t omniparser .
% sudo docker run -d -p 7861:7861 --gpus all --name omniparser-container omniparser
% python client.py "http://0.0.0.0:7861" ~/Desktop/screenshot.png
Loaded as API: http://44.198.58.162:7861/ ✔
2024-10-29 18:55:51.336 | INFO | __main__:predict:61 - Prediction completed successfully
2024-10-29 18:55:51.337 | INFO | __main__:predict:70 - label_coordinates={'0': [0.12276943773031235, 0.002296212362125516, 0.045681655406951904, 0.028702640905976295],
...
2024-10-29 18:55:51.339 | INFO | __main__:predict:71 - parsed_content_list=['Text Box ID 0: 5 v G', 'Text Box ID 1: Book1', 'Text Box ID 2: Home',
...
2024-10-29 18:55:51.341 | INFO | __main__:predict:77 - Parsed content saved to: result_data_20241029_185545.json
2024-10-29 18:55:51.343 | INFO | __main__:predict:83 - Output image saved to: output_image_20241029_185545.png
% open output_image.png
% head result_data_20241029_185545.json
{
"label_coordinates": {
"0": [
0.12276943773031235,
0.002296212362125516,
0.045681655406951904,
0.028702640905976295
],
"1": [
0.48429691791534424,
% tail result_data_20241029_185545.json
"Icon Box ID 72: Decrease",
"Icon Box ID 73: Download",
"Icon Box ID 74: a menu or list.",
"Icon Box ID 75: navigating to the previous item or screen.",
"Icon Box ID 76: the \"E\" function.",
"Icon Box ID 77: Justified",
"Icon Box ID 78: Text formatting options.",
"Icon Box ID 79: a search function."
]
}%