File size: 2,002 Bytes
ece7754 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# π Quick Start Guide
## One-Command Setup
### Method 1: Using our setup script
```bash
# 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
```bash
# 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
```bash
# 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
```bash
# 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! π |