Repository navigation
imgshape v3.0.0
πΌοΈ imgshape β Smart Dataset Intelligence Toolkit (v3.0.0 β’ Aurora)
imgshape is a modular Python toolkit for image analysis, dataset inspection, augmentation & preprocessing recommendations, visualization, and pipeline export β now evolved into a Streamlit-powered dataset assistant for modern ML/DL workflows.
β¨ What's New in v3.0.0 β Aurora Major Release
A complete redesign: from a static CLI toolkit β to an intelligent dataset analysis framework.
π§ Highlights
- Full Streamlit App (
app.py) with 6 powerful tabs:- π Shape β instant image shape detection
- π Analyze β entropy, color channels, dataset insights
- π§ Recommend β preprocessing & augmentation planning
- π¨ Augment Visualizer β real-time augmentation previews
- π Reports β export Markdown / HTML dataset reports
- π Pipeline Export β generate ready-to-run code snippets
π§© Modular Architecture
- New
RecommendationPipelinesystem for building, saving, and exporting end-to-end pipelines. - Plugin framework (
/src/imgshape/plugins) with support for:AnalyzerPluginRecommenderPluginExporterPlugin
- Unified lazy import system for ultra-fast startup.
π‘ Smart Recommendations
RecommendEngineprovides preprocessing & augmentation strategies based on:- Entropy, resolution, and dataset diversity
- User preferences (e.g.
preserve_aspect,low_res) - Optional YAML profiles (
/profiles/)
π Dataset Analyzer Improvements
- Counts only unique readable images (no overcount)
- Aggregates shapes, channels, entropy, and unreadable stats
- Sample summaries for representative examples
π Reports
- Markdown, HTML, and PDF (optional via
weasyprint+reportlab) - Embedded metadata, augmentations, and preprocessing recommendations
π§° CLI Modernization
imgshape --webβ directly launches Streamlit UI- Extended with new actions:
--pipeline-export,--pipeline-apply,--snapshot-save,--snapshot-diff
- Plugin controls:
--plugin-list,--plugin-add,--plugin-remove
βοΈ Installation
pip install imgshapeRequires Python 3.8+
Core dependencies:Pillow,numpy,matplotlib,scikit-image,streamlit
Optional extras:
| Extra | Description |
|---|---|
imgshape[torch] |
PyTorch / torchvision support |
imgshape[pdf] |
PDF report generation via WeasyPrint |
imgshape[viz] |
Advanced plots with Seaborn & Plotly |
imgshape[ui] |
Streamlit UI + profile parsing |
imgshape[full] |
Full suite with all optional features |
π» CLI Usage
# Shape detection
imgshape --path ./sample.jpg --shape
# Single image analysis
imgshape --path ./sample.jpg --analyze
# Preprocessing + augmentations
imgshape --path ./sample.jpg --recommend --augment
# Dataset compatibility check
imgshape --dir ./images --check mobilenet_v2
# Dataset visualization
imgshape --viz ./images
# Dataset report (md + html)
imgshape --path ./images --report --augment --report-format md,html --out report
# Torch integration (transform/DataLoader)
imgshape --path ./images --torchloader --augment --out transform_snippet.py
# Launch the Streamlit web UI
imgshape --webπ₯οΈ Streamlit Interface (v3)
Run the visual interface directly:
streamlit run app.pyTabs Overview
| Tab | Function |
|---|---|
| π Shape | Detects image dimensions & color channels |
| π Analyze | Dataset entropy, shapes, and channel distributions |
| π§ Recommend | Suggests preprocessing & augmentations |
| π¨ Augment Visualizer | Interactive augmentation intensity slider |
| π Reports | Generates Markdown & HTML dataset summaries |
| π Pipeline Export | Exports pipelines as code (PyTorch/YAML/JSON) |
π§ Python API Example
from imgshape.shape import get_shape
from imgshape.analyze import analyze_type
from imgshape.recommender import recommend_preprocessing
from imgshape.pipeline import RecommendationPipeline
print(get_shape("sample.jpg"))
print(analyze_type("sample.jpg"))
print(recommend_preprocessing("sample.jpg"))
# Build a pipeline from a recommendation
rec = recommend_preprocessing("sample.jpg")
pipeline = RecommendationPipeline.from_recommender_output(rec)
print(pipeline.as_dict())π§© Plugins
Extend imgshape with your own plugins:
# src/imgshape/plugins/custom_brightness.py
from imgshape.plugins import RecommenderPlugin
class CustomBrightnessPlugin(RecommenderPlugin):
NAME = "CustomBrightness"
def recommend(self, analysis):
return [{"name": "adjust_brightness", "spec": {"factor": 1.2}}]Then register it via CLI:
imgshape --plugin-add ./src/imgshape/plugins/custom_brightness.pyπ Reports (Markdown, HTML, PDF)
# Markdown & HTML reports
imgshape --report --path ./datasets/cats --report-format md,html
# Generate PDF (requires extras)
pip install imgshape[pdf]
imgshape --report --path ./datasets/dogs --report-format pdfπ§ͺ Testing
Run all tests locally:
pytest -qOr install dev tools:
pip install imgshape[dev]
black --check src tests
flake8 src testsπ§± Developer & Build Guide
# Clean build artifacts
rm -rf dist build *.egg-info
# Build
python -m build
# Check metadata
twine check dist/*
# Upload (TestPyPI)
twine upload --repository testpypi dist/*
# Install locally
pip install dist/imgshape-3.0.0-py3-none-any.whlπ Resources
- Documentation: https://stifler7.github.io/imgshape
- GitHub Repository: https://github.com/STiFLeR7/imgshape
- Issues: https://github.com/STiFLeR7/imgshape/issues
- License: MIT
π« Credits
Developed with β€οΈ by Stifler
Researched / Developer
Empowering AI at the Edge.
π§ Roadmap (v3.1.x)
- ONNX / TensorRT export for edge inference
- Auto-EDA visualization (class imbalance, histograms)
- Enhanced Streamlit dashboard with live metrics
- HuggingFace Spaces demo & CI/CD workflow
---
### π§© Summary of Key Updates
- Updated version β `v3.0.0 (Aurora)`
- Removed Gradio references (Streamlit is now primary)
- Added new **Pipeline**, **Plugins**, and **Recommender Engine** details
- Expanded CLI + Streamlit examples
- Ready for **PyPI rendering** and **GitHub preview**
