Skip to content

fix: making YOLO weights actually work and improve setup docs - #19

Open
Santosh69 wants to merge 3 commits into
ruxailab:mainfrom
Santosh69:fix/model-weights-path-mismatch
Open

fix: making YOLO weights actually work and improve setup docs#19
Santosh69 wants to merge 3 commits into
ruxailab:mainfrom
Santosh69:fix/model-weights-path-mismatch

Conversation

@Santosh69

@Santosh69 Santosh69 commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator

🐛 Problem

Contributors encounter FileNotFoundError when starting the server.

Impact: Critical

Server startup blocked for new contributors, preventing run the app

Sub-issue of MVP demo working on.


🔍 Root Cause

  1. Code expects best.pt, but Microsoft OmniParser releases as model.pt
  2. No setup documentation for downloading model weights
  3. Missing .gitignore patterns risk committing 40MB+ files
  4. .gitignore had *.md and *.rst blocking docs

✅ Solution

Code: Updated to use model.pt (matches OmniParser naming)

Repository Safety: Added .gitignore patterns:

weights/**/*.pt
weights/**/*.pth
weights/**/*.bin

- Update code to use model.pt (matches OmniParser release)
- Add .gitignore patterns for model weight files
- Remove *.rst from .gitignore
- Add Prerequisites section to README with download instructions
- Fix verify_model_load.py to use model.pt

Sub-issue of MVP demo preparation.
Fixes FileNotFoundError for contributors.
Copilot AI review requested due to automatic review settings January 18, 2026 11:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a FileNotFoundError that blocks server startup for new contributors by updating the YOLO model filename from best.pt to model.pt to match Microsoft OmniParser's actual release naming. The changes also improve repository safety by adding proper .gitignore patterns for model weights and restore documentation visibility by removing overly broad markdown file exclusions.

Changes:

  • Updated YOLO model path to use correct filename (model.pt instead of best.pt)
  • Added setup documentation with wget command for downloading OmniParser weights
  • Fixed .gitignore to allow markdown/RST files and prevent committing large model files

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
app/services/omniparser_client.py Updated YOLO model path to use model.pt matching OmniParser's release naming
README.md Added prerequisites section with instructions for downloading model weights
.gitignore Removed overly broad *.md and *.rst patterns; added specific patterns for model weight files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment on lines +86 to +92
```bash
# Create weights directory
mkdir -p weights/icon_detect

# Download using wget
wget https://huggingface.co/microsoft/OmniParser/resolve/main/icon_detect/model.pt \
-O weights/icon_detect/model.pt

Copilot AI Jan 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bash code block is missing a closing triple backtick (```). This causes the code block to extend into the "Manual Setup" section below, which will break the markdown formatting.

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +80 to +92
### Prerequisites: Download Model Weights

This project uses **Microsoft OmniParser** for UI element detection, which requires downloading a custom YOLO model (~40MB).

**Download the model:**

```bash
# Create weights directory
mkdir -p weights/icon_detect

# Download using wget
wget https://huggingface.co/microsoft/OmniParser/resolve/main/icon_detect/model.pt \
-O weights/icon_detect/model.pt

Copilot AI Jan 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Prerequisites: Download Model Weights" section is placed after the "Using the Development Script" section. This means users will attempt to run the start-dev.sh script before knowing they need to download the model weights first, which will result in the FileNotFoundError this PR is trying to fix. The prerequisites section should be moved before the "Using the Development Script" section to ensure users download the weights before attempting to start the service.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants