π Quick Start Guide
One-Command Setup
Method 1: Using our setup script
# Download the setup script
curl -O https://huggingface.co/zhiqing0205/u2net-mvtec-loco-segmentation/raw/main/setup_project.py
# Run setup (downloads everything automatically)
python setup_project.py
# Use the project
cd u2net-mvtec-loco
python mvtec_loco_fg_segmentation.py
Method 2: Using HuggingFace CLI
# Install HuggingFace CLI
pip install huggingface_hub
# Download complete project (equivalent to git clone)
huggingface-cli download zhiqing0205/u2net-mvtec-loco-segmentation \
--local-dir ./u2net-project --repo-type model
# Use the project
cd u2net-project
python mvtec_loco_fg_segmentation.py
Method 3: Using Python
# One-liner to download everything
python -c "
from huggingface_hub import snapshot_download
snapshot_download('zhiqing0205/u2net-mvtec-loco-segmentation', local_dir='./u2net-project')
print('Done! cd u2net-project && python mvtec_loco_fg_segmentation.py')
"
What Gets Downloaded
β
Complete source code
β
Pre-trained model weights (u2net.pth - 169MB)
β
Documentation (English + Chinese)
β
Example scripts and utilities
β
Ready to run immediately
File Structure After Download
u2net-mvtec-loco/
βββ mvtec_loco_fg_segmentation.py # Main script
βββ saved_models/
β βββ u2net/
β βββ u2net.pth # Pre-trained model (169MB)
βββ model/ # Model architecture
βββ data_loader.py # Data utilities
βββ README.md # English docs
βββ README_CN.md # Chinese docs
βββ ...
Immediate Usage
# Process entire MVTec LOCO dataset
python mvtec_loco_fg_segmentation.py
# Process specific categories
python mvtec_loco_fg_segmentation.py --categories breakfast_box
# Custom threshold
python mvtec_loco_fg_segmentation.py --threshold 0.3
That's it! π