Data Filtering
June 4, 2025 · View on GitHub
The code uses OmniParser to generate bounding boxes for images, followed by a filtering step to clean noisy data.
Setup
-
Install Environment
Follow the environment-setup instructions provided in the OmniParser repository. -
Install Additional Dependency
Install theimagesizePython package if it is not already included:
pip install imagesize
- Download OmniParser Checkpoint
Download the checkpoint, and place it
OmniParser-v2.0folder.
Usage
Step 1 - Generate Bounding Boxes
Run the run.py script to generate bounding boxes for all images using OmniParser:
python run.py
Step 2 - Filter Noisy Data
Run the filter.py script to clean the dataset by checking whether each data bounding box overlaps only with the OmniParser output:
python filter.py
Folder Structure
├── run.py # Script to generate bounding boxes using OmniParser
├── filter.py # Script to clean noisy datasets
├── inp.json # Raw input data
├── OmniParser-v2.0/ # OmniParser checkpoints
├── hw_cache.json # Cached height and width info for all images
├── images/ # Directory containing all images
├── log/ # Outputs from OmniParser
├── clean.json # Cleaned output data
├── README.md # This file
└── ... # Other files or directories
Notice
In inp.json, all bounding box coordinates are stored using normalized values in the range [0, 1000].