diff --git a/omnitool/omniparserserver/omniparserserver.py b/omnitool/omniparserserver/omniparserserver.py index 434d399..49fb306 100644 --- a/omnitool/omniparserserver/omniparserserver.py +++ b/omnitool/omniparserserver/omniparserserver.py @@ -1,5 +1,5 @@ ''' -python -m omniparserserver --som_model_path ../../weights/icon_detect_v1_5/model_v1_5.pt --caption_model_name florence2 --caption_model_path ../../weights/icon_caption_florence --device cuda --BOX_TRESHOLD 0.05 +python -m omniparserserver --som_model_path ../../weights/icon_detect/model.pt --caption_model_name florence2 --caption_model_path ../../weights/icon_caption_florence --device cuda --BOX_TRESHOLD 0.05 ''' import sys @@ -15,7 +15,7 @@ from util.omniparser import Omniparser def parse_arguments(): parser = argparse.ArgumentParser(description='Omniparser API') - parser.add_argument('--som_model_path', type=str, default='../../weights/icon_detect_v1_5/model_v1_5.pt', help='Path to the som model') + parser.add_argument('--som_model_path', type=str, default='../../weights/icon_detect/model.pt', help='Path to the som model') parser.add_argument('--caption_model_name', type=str, default='florence2', help='Name of the caption model') parser.add_argument('--caption_model_path', type=str, default='../../weights/icon_caption_florence', help='Path to the caption model') parser.add_argument('--device', type=str, default='cpu', help='Device to run the model') diff --git a/omnitool/readme.md b/omnitool/readme.md index 7e9d640..82c215c 100644 --- a/omnitool/readme.md +++ b/omnitool/readme.md @@ -56,8 +56,12 @@ There are three components: g. Continue from here if you already had the conda environment. - h. Ensure you have the weights downloaded in weights folder. If not download them with: - `for folder in icon_caption_florence icon_detect icon_detect_v1_5; do huggingface-cli download microsoft/OmniParser --local-dir weights/ --repo-type model --include "$folder/*"; done` + h. Ensure you have the V2 weights downloaded in weights folder (**ensure caption weights folder is called icon_caption_florence**). If not download them with: + ``` + rm -rf weights/icon_detect weights/icon_caption weights/icon_caption_florence + for f in icon_detect/{train_args.yaml,model.pt,model.yaml} icon_caption/{config.json,generation_config.json,model.safetensors}; do huggingface-cli download microsoft/OmniParser-v2.0 "$f" --local-dir weights; done + mv weights/icon_caption weights/icon_caption_florence + ``` h. Navigate to the server directory with `cd OmniParser/omnitool/omniparserserver`