GarmentIQ: Automated Garment Measurement for Fashion Retail
🌐 Official website | 📖 Documentation | ⚙️ Web pipeline | 🪄 MagicBox | 📄 Paper
Free & Open Source. Precise and flexible garment measurements from images - no tape measures, no delays, just fashion - forward automation.
🎉 Update (09/11/2026): GarmentIQ now supports SAM 1, SAM 2, and SAM 3, plus natural-language (text) prompts for segmentation, a new matting module (ViTMatte and Matting Anything) for soft alpha edges, and an explicit
deviceargument (cpu,cuda,mps) on every model function! Cheers! 🥂
Content:
- What Are the Key Features of GarmentIQ?
- Overview of GarmentIQ Python Package
- Tutorials
- Advanced Usage
- Trained Models for Classification
- Issues & Feedback
- License
- Acknowledgements
What Are the Key Features of GarmentIQ?
GarmentIQ uses computer vision and models like DeiT, BiRefNet, SAM, and HRNet to classify garments, remove backgrounds, and detect key features with precision. It turns expert know-how into an intuitive measurement system - no intensive coding required. Fully modular and customizable, it adapts to your workflows while delivering fast, accurate results out of the box.
| Feature | Web Demo | Video guide |
|---|---|---|
| Tailor (the whole pipeline) | Try web demo | Watch video guide |
| Garment measurement instruction generation | Try web demo | Watch video guide |
| Garment image classification | Try web demo | Watch video guide |
| Garment image segmentation | Try web demo | Watch video guide |
| Garment landmark detection | Try web demo | Watch video guide |
| Garment landmark adjustment | Try web demo | Watch video guide |
Overview of GarmentIQ Python Package
The garmentiq package provides an automated solution for garment measurement from images, utilizing computer vision techniques for classification, segmentation, and landmark extraction.
-
tailor: This module acts as the central agent for the entire pipeline, orchestrating the different stages of garment measurement from classification to landmark derivation. It integrates the functionalities of other modules to provide a smooth end-to-end process. -
classification: This module is responsible for identifying the type of garment in an image. Its key functions include:fine_tune_pytorch_nn,load_data,load_model,predict,test_pytorch_nn,train_pytorch_nn, andtrain_test_split -
segmentation: This module focuses on isolating garment features from the background for improved measurement accuracy. Its key functions include:change_background_color,extract,load_model, andprocess_and_save_images. -
landmark: This module handles the detection, derivation, and refinement of key points on garments. Its key functions include:derive,detect, andrefine. -
matting: This module refines a hard segmentation mask into a soft alpha matte, so edges and semi-transparent detail composite naturally. Its key functions include:generate_trimap,load_model,matte, andcomposite. -
grounding: This module turns a natural-language phrase into bounding boxes, which is what gives SAM 1 and SAM 2 text-prompted segmentation. Its key functions include:load_grounding_model,load_grounding_processor, andground_text_to_boxes.
Common conventions
Every model-backed module follows the same two-step shape, so moving between them requires no relearning:
model = giq.<module>.load_model(...) # 1. load weights onto a device
result = giq.<module>.<run>(model=model, image_path=..., device=...) # 2. run on an image
where <run> is predict for classification, extract for segmentation, matte for matting,
and detect for landmarks. Across all of them:
-
deviceis opt-in and identical everywhere. Everyload_modeland every inference function takesdevice, defaulting to"cpu". Pass"cuda"or"mps"explicitly to use an accelerator; nothing is auto-detected. -
Accelerator memory is released automatically after each inference call.
-
Configurations are bundled. BiRefNet, every SAM variant and ViTMatte load their configs and processors from inside the package, so only weights need downloading.
-
Arguments are keyword-style. The examples throughout this README pass every argument by name, which is the supported way to call these functions.
-
A mismatched checkpoint warns. Weights are loaded leniently so partial checkpoints keep working, but if a checkpoint does not match the model class GarmentIQ raises a
RuntimeWarninginstead of silently returning a randomly initialised model. -
Instruction Schemas: The
instruction/folder contains 9 predefined measurement schemas in.jsonformat, which are utilized by thegarment_classes.pyfilegarment_classesdictionary to define different garment types and their predefined measurement properties. Users can also define their own custom measurement instructions by creating new dictionaries formatted similarly to the existing garment classes.
Tutorials
Each tutorial is a self-contained Colab notebook covering one part of the garmentiq Python API, from a single module up to the whole pipeline. Open one to read the explanation and run the code. For the full API reference, see our documentation.
⚠️ Note: If you encounter errors while running these notebooks in Colab, they are likely due to Python package version conflicts specific to the Colab environment. We recommend installing MagicBox on your local machine, where you can find and run these examples under
working/examples/.
Installation
Please install from PyPI using the following command.
pip install garmentiq -q
Tutorial notebooks
Advanced Usage
These notebooks go beyond everyday use: defining your own measurements, and training or fine-tuning the classification model on your own data.
⚠️ Note: If you encounter errors while running these notebooks in Colab, they are likely due to Python package version conflicts specific to the Colab environment. We recommend installing MagicBox on your local machine, where you can find and run these examples under
working/examples/.
Trained Models for Classification
We release the following models trained as part of this project. Models having _inditex_finetuned in their names means that they were finetuned on a small set of garment data from Inditex - Zara.
| Model | Test Accuracy | Test F1 Score | Fine-tune Accuracy | Fine-tune F1 Score | Link |
|---|---|---|---|---|---|
cnn_3.pt |
0.9458 | 0.9459 | / | / | See the model |
cnn_4.pt |
0.9533 | 0.9533 | / | / | See the model |
tiny_vit.pt |
0.9576 | 0.9576 | / | / | See the model |
cnn_3_inditex_finetuned.pt |
0.9074 | 0.9068 | 0.9197 | 0.9216 | See the model |
cnn_4_inditex_finetuned.pt |
0.9132 | 0.9137 | 0.9592 | 0.9585 | See the model |
tiny_vit_inditex_finetuned.pt |
0.9484 | 0.9483 | 0.9916 | 0.9917 | See the model |
Issues & Feedback
Found a bug or have a feature request? Please open an issue on our GitHub Issues page.
License
GarmentIQ's Python API code is licensed under the MIT License.
Acknowledgements
We sincerely thank Adrian Gonzalez-Sieira and Laura Rodriguez-Barreiro from INDITEX for their invaluable suggestions and continuous support throughout this research. We are also grateful to everyone at ETH Zurich and the ETH AI Center for their coordination and collaborative efforts.
We gratefully acknowledge the use and adaptation of the following open-source resources:
- https://github.com/facebookresearch/deit
- https://github.com/ZhengPeng7/BiRefNet
- https://github.com/facebookresearch/segment-anything
- https://github.com/facebookresearch/sam2
- https://github.com/facebookresearch/sam3
- https://github.com/SHI-Labs/Matting-Anything
- https://github.com/hustvl/ViTMatte
- https://github.com/svip-lab/HRNet-for-Fashion-Landmark-Estimation.PyTorch
- https://github.com/switchablenorms/DeepFashion2
- https://www.kaggle.com/datasets/paramaggarwal/fashion-product-images-dataset
- https://www.kaggle.com/datasets/lygitdata/garmentiq-classification-set-nordstrom-and-myntra
- https://www.kaggle.com/datasets/lygitdata/zara-clothes-image-data
- All Python packages listed in
requirements.txt
© 2025 - 2026 GarmentIQ
"GarmentIQ" is a registered trademark. Unauthorized use, reproduction, or distribution is strictly prohibited and may result in legal action.
Metadata
Release files for garmentiq 0.0.4.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| garmentiq-0.0.4.11.tar.gz | 1.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| garmentiq-0.0.4.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.6 MB
Release files / garmentiq-0.0.4.11.tar.gz
| Download URL | garmentiq-0.0.4.11.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
447b50834d8ee93bb3e3153fb7fd9d21dbf881dc4be3fcaf419e99abcbf10cc9
|
|
BLAKE2b-256 checksum How to use checksums |
40a1afc6786ad561cc08b78b9fd090abb40f2273b4c207b8797de13dd30ae0da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / garmentiq-0.0.4.11-py3-none-any.whl
| Download URL | garmentiq-0.0.4.11-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49886e7f0a55181117a4364857714a01f33e00235ea2b493dd7af2b7f8b0c0db
|
|
BLAKE2b-256 checksum How to use checksums |
428b86c6cc914712755bce6a9116dc339852adc2b77f2de2b33bb1974d5ffbae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency log