PartInventory is a full-stack annotation and dataset creation system designed to navigate the transition from semantic masks to high-quality, instance-level part annotations. Specifically, this dataset provides refined instance-level annotations for PartImageNet, building upon the semantic segmentation masks from SPIN.
The resulting dataset is available on Hugging Face: π€ PartInventory Dataset.
Disclaimer: This project is a technical demonstration and portfolio piece. It is not intended for academic publication as original research. All credit for the underlying datasets and methodologies belongs to the respective authors of PartImageNet and SPIN.
The platform integrates CVAT-based task management with a custom crowdsourcing pipeline on MTurk, enabling efficient identification of single vs. multiple part instances and high-fidelity instance splits.
The system supports all stages of benchmark creationβfrom preparing COCO-style data, distributing tasks to workers, collecting classifications, exporting CVAT instance masks, and generating analyticsβensuring scalable, consistent, and reproducible part-level datasets.
- Interactive UI: A modern, responsive web application built with React, Vite, and Chakra UI.
- Visual Feedback: Real-time visualization of segmentation masks overlaid on original images.
- Quality Control: Integrated "Gold Standard" qualification tests and agreement checks to ensure high-quality worker data.
- MTurk Integration: Seamless submission logic compatible with Amazon Mechanical Turk's external question API.
- FastAPI Powered: High-performance Python backend handling task distribution, image serving, and data validation.
- Cloud Native: Fully integrated with AWS S3 for scalable storage of images, masks, and task metadata.
- Dynamic Mask Generation: On-the-fly generation of visualization masks from RLE (Run-Length Encoding) data using
pycocotools.
- CVAT Integration: Tools to synchronize data with Computer Vision Annotation Tool (CVAT), including automated task creation and annotation export.
- COCO Format Support: Full support for the COCO dataset format, including conversion, merging, and splitting utilities.
- Analytics Engine: Comprehensive statistical analysis scripts (
dataset_statistics.py) to generate distribution metrics, confusion matrices, and instance counts similar to academic dataset papers (CVPR/ECCV).
- Framework: React 18 (TypeScript)
- Build Tool: Vite
- UI Library: Chakra UI
- State Management: React Hooks
- Framework: FastAPI (Python 3.9+)
- Data Processing: NumPy, Pandas, PyCOCOTools, Matplotlib
- Cloud Services: AWS Boto3 (S3, MTurk)
- Server: Uvicorn
- Annotation Format: COCO JSON
- Version Control: Git (with Pre-commit hooks for quality & security)
- Deployment: Heroku / Docker ready (
Procfileincluded)
PartInventory/
βββ src/
β βββ Classification/
β β βββ backend/ # FastAPI server & data processing
β β β βββ main.py # API Entry point
β β β βββ data/ # Analytics scripts & local data
β β β βββ MturkUtility.ipynb # MTurk management notebooks
β β βββ frontend/ # React annotation interface
β β βββ src/ # UI Components & Logic
β β βββ vite.config.ts
β βββ CVAT/ # CVAT integration tools
β βββ create_archive_dataset.py # COCO export utilities
β βββ merged/ # Dataset merging logic
βββ dataset_statistics.py # Statistical analysis generator
βββ generate_cvpr_figures.py # Visualization for papers
βββ utils/ # Helper scripts- Node.js (v16+)
- Python (v3.9+)
- AWS Credentials (if accessing S3/MTurk features)
Navigate to the backend directory and install dependencies:
cd src/Classification/backend
pip install -r requirements.txtRun the development server:
uvicorn main:app --reloadThe API will be available at http://localhost:8000.
Navigate to the frontend directory and install dependencies:
cd src/Classification/frontend
npm installStart the development server:
npm run devThe UI will be available at http://localhost:5173.
- Ingestion: Images and initial segmentations are managed in CVAT.
- Export: Use
src/CVAT/create_archive_dataset.pyto export annotations in COCO format.python src/CVAT/create_archive_dataset.py --annotations-only coco_exports/MyCategory.json
- Crowdsourcing: The backend serves these parts to the Frontend UI for instance counting (One vs. Many).
- Analysis: Run
dataset_statistics.pyto generate a comprehensive report on the dataset distribution.python dataset_statistics.py
The project includes sophisticated tools for analyzing dataset health:
dataset_statistics.py: Generates LaTeX-ready tables of dataset statistics (Images, Annotations, Categories).generate_cvpr_figures.py: Creates publication-quality charts showing category distributions and instance counts.
This repository uses pre-commit hooks to ensure code quality and security:
- Gitleaks: Scans for accidental commit of AWS keys or secrets.
- Trailing Whitespace / End-of-file: Ensures consistent formatting.
- Large File Check: Prevents committing massive binary files.
To install hooks locally:
pre-commit installThis project is licensed under the MIT License - see the LICENSE file for details.
If you use this dataset, please cite the original PartImageNet paper and the SPIN paper:
@article{he2021partimagenet,
title={PartImageNet: A Large, High-Quality Dataset of Parts},
author={He, Ju and Yang, Shuo and Yang, Shaokang and Kortylewski, Adam and Yuan, Xiaoding and Chen, Jie-Neng and Liu, Shuai and Yang, Cheng and Yuille, Alan},
journal={arXiv preprint arXiv:2112.00933},
year={2021}
}
% Please add the SPIN paper citation here