Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradio_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


import base64, os
from util.utils import check_ocr_box, get_yolo_model, get_caption_model_processor, get_som_labeled_img
from omniparser.utils import check_ocr_box, get_yolo_model, get_caption_model_processor, get_som_labeled_img
import torch
from PIL import Image

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion util/omniparser.py → omniparser/omniparser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from util.utils import get_som_labeled_img, get_caption_model_processor, get_yolo_model, check_ocr_box
from omniparser.utils import get_som_labeled_img, get_caption_model_processor, get_yolo_model, check_ocr_box
import torch
from PIL import Image
import io
Expand Down
2 changes: 1 addition & 1 deletion util/utils.py → omniparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from torchvision.transforms import ToPILImage
import supervision as sv
import torchvision.transforms as T
from util.box_annotator import BoxAnnotator
from omniparser.box_annotator import BoxAnnotator


def get_caption_model_processor(model_name, model_name_or_path="Salesforce/blip2-opt-2.7b", device=None):
Expand Down
2 changes: 1 addition & 1 deletion omnitool/omniparserserver/omniparserserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import uvicorn
root_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root_dir)
from util.omniparser import Omniparser
from omniparser.omniparser import Omniparser

def parse_arguments():
parser = argparse.ArgumentParser(description='Omniparser API')
Expand Down
42 changes: 42 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This project is licensed under the Creative Commons Attribution 4.0 International License.
# See https://creativecommons.org/licenses/by/4.0/ for details.

from setuptools import setup, find_namespace_packages
import pathlib

here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "README.md").read_text(encoding="utf-8")

setup(
name = "omniparser",
version = "0.1.0",
author = "Microsoft Research AIF Frontiers",
description = 'OmniParser, comprehensive method for parsing user interface screenshots into structured and easy-to-understand elements',
long_description = long_description,
long_description_content_type = "text/markdown",
include_package_data = True,
packages = find_namespace_packages(where='omniparser'),
package_dir = {"omniparser": "omniparser"},
install_requires = [
"torch",
"easyocr",
"torchvision",
"supervision==0.18.0",
"transformers",
"ultralytics==8.3.70",
"numpy==1.26.4",
"opencv-python",
"opencv-python-headless",
"gradio",
"dill",
"accelerate",
"timm",
"einops==0.8.0",
"paddlepaddle",
"paddleocr",
],
classifiers=[
"License :: CC-BY-4.0"
],
license_files = ['LICENSE']
)