Metadata-Version: 2.4
Name: imgshape
Version: 4.2.0
Summary: imgshape v4.2.0 (Bento Intelligence) — Dataset intelligence layer: deterministic fingerprinting, semantic drift, and bento-box UI.
Home-page: https://github.com/STiFLeR7/imgshape
Author: Stifler
Author-email: Stifler <hillaniljppatel@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/STiFLeR7/imgshape
Project-URL: Source, https://github.com/STiFLeR7/imgshape
Project-URL: Issues, https://github.com/STiFLeR7/imgshape/issues
Project-URL: Documentation, https://stifler7.github.io/imgshape/
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow>=9.0.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: matplotlib>=3.4.0
Requires-Dist: scikit-image>=0.19.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.28.0
Provides-Extra: torch
Requires-Dist: torch>=1.12.0; (platform_system != "Windows" or python_version >= "3.8") and extra == "torch"
Requires-Dist: torchvision>=0.13.0; extra == "torch"
Provides-Extra: pdf
Requires-Dist: weasyprint>=53.0; extra == "pdf"
Requires-Dist: reportlab>=3.6.0; extra == "pdf"
Requires-Dist: pyyaml>=6.0; extra == "pdf"
Provides-Extra: viz
Requires-Dist: plotly>=5.20.0; extra == "viz"
Requires-Dist: seaborn>=0.12.0; extra == "viz"
Provides-Extra: web
Requires-Dist: fastapi>=0.104.0; extra == "web"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "web"
Requires-Dist: jinja2>=3.1.0; extra == "web"
Provides-Extra: plugins
Requires-Dist: importlib-metadata>=6.0; extra == "plugins"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=3.9; extra == "dev"
Requires-Dist: pre-commit>=2.20; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"
Provides-Extra: full
Requires-Dist: torch>=1.12.0; extra == "full"
Requires-Dist: torchvision>=0.13.0; extra == "full"
Requires-Dist: weasyprint>=53.0; extra == "full"
Requires-Dist: reportlab>=3.6.0; extra == "full"
Requires-Dist: pyyaml>=6.0; extra == "full"
Requires-Dist: plotly>=5.20.0; extra == "full"
Requires-Dist: seaborn>=0.12.0; extra == "full"
Requires-Dist: fastapi>=0.104.0; extra == "full"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "full"
Requires-Dist: jinja2>=3.1.0; extra == "full"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

﻿<div align="center">

# 🖼️ imgshape

### The Data-Centric AI Toolkit for Vision Engineers

[![Version 4.2.0](https://img.shields.io/badge/version-4.2.0-orange.svg?style=for-the-badge)](https://github.com/STiFLeR7/imgshape/releases/tag/v4.2.0)
[![PyPI Version](https://img.shields.io/pypi/v/imgshape?color=blue&style=for-the-badge)](https://pypi.org/project/imgshape/)
[![Python 3.8+](https://img.shields.io/badge/Python-3.8+-blue?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/imgshape/)
[![Downloads](https://img.shields.io/badge/Downloads-6.1K-green?style=for-the-badge)](https://pepy.tech/project/imgshape)

<br/>

> **"Automatically analyze any image dataset and get *model-ready preprocessing recommendations* in one command."**

<br/>

[**🚀 Live Demo (Web)**](https://imgshape.vercel.app/) • [**📖 Documentation**](https://github.com/STiFLeR7/imgshape/blob/master/README.md) • [**💬 Report Bug / Discuss**](https://github.com/STiFLeR7/imgshape/discussions)

</div>

---

## ✨ What's New in v4.2 "Bento Intelligence"

*   **🍱 Bento Grid UI:** A complete UX overhaul using a modular 12-column grid for high-density dataset insights.
*   **🌊 Semantic Drift 2.0:** detect dataset shifts using DINOv2 vision transformer embeddings.
*   **🚀 Atlas Bento Engine:** 40% faster fingerprinting via vectorized IO and multi-stage caching.
*   **🧩 Domain Profiles:** One-click configurations for Medical, Satellite, and OCR datasets.

---

## ⚡ 30-Second Start

Don't guess your dataset's health. **Audit it immediately** with the `Atlas` engine.

```python
pip install imgshape

from imgshape import Atlas

# 1. Initialize the Atlas Orchestrator
atlas = Atlas()

# 2. Extract deterministic fingerprint
result = atlas.extract_fingerprint("./my_dataset")

# 3. View the verdict
print(result.summary())
```

**System Output:**

```json
{
  "fingerprint_id": "fp_8a7d9f2",
  "total_images": 4502,
  "corrupt_files": 12,
  "metrics": {
    "avg_resolution": "1024x768",
    "diversity_score": 0.89,
    "channel_consistency": "FAIL"
  },
  "issues": ["Found 14 grayscale images in RGB dataset"]
}
```

---

## 🔍 The Visual Dashboard (Atlas UI)

Experience `imgshape`'s capabilities visually. The dashboard provides a real-time interface for **dataset fingerprinting**, **augmentation previews**, and **pipeline configuration** using the new **Bento Grid** layout.

![imgshape Dashboard](assets/dashboard_preview.png)

> *Dashboard v4.2.0 showing Bento Grid layout and semantic drift detection.*

---

## 🚀 Why imgshape?

Most vision models fail because of **garbage data**—corrupt files, mixed channels (RGBA vs RGB), or weird aspect ratios. `imgshape` catches these *before* you train using a deterministic rule engine.

| Module | Technical Function |
| :--- | :--- |
| **🔍 Instant Audit** | Multi-threaded + **GPU-accelerated** scan for entropy, blur, and variance using `PyTorch`. |
| **🧠 Decision Engine** | Heuristic-based suggestion engine with **Provenance IDs** and **Reproducibility Hashes**. |
| **📊 Semantic Drift** | NEW: **DINOv2-powered** drift analysis between dataset versions. |
| **🍱 Bento Grid UI** | NEW: High-density **Modular Dashboard** for interactive exploration. |
| **🛠️ Pipeline Export** | Generates serialization-safe code for **PyTorch**, **TensorFlow**, and **Albumentations**. |

---

## 📦 Installation Matrix

Choose your deployment flavor.

| Command | Use Case | Size |
| :--- | :--- | :--- |
| `pip install imgshape` | **Core / CI/CD** | ~12MB |
| `pip install "imgshape[full]"` | **Research / Power User** | ~45MB |
| `pip install "imgshape[ui]"` | **Interactive / Dashboard** | ~30MB |

---

## 💡 Practical Use Cases

### 1. The "Sanity Check" (CI/CD Integration)

Block bad data from entering your training bucket. Ideal for GitHub Actions or Jenkins.

```bash
# Returns exit code 1 if corrupt files or schema violations are found
imgshape --check ./new_batch_v2 --strict-schema
```

### 2. The "Pipeline Builder"

Don't guess augmentation parameters. Let the entropy statistics decide.

```bash
# analyze -> recommend -> export PyTorch snippet
imgshape --path ./train_data --analyze --recommend --out transforms.py
```

### 3. The "Visual Explorer"

Verify `RandomCrop` or `ColorJitter` intensity manually before training.

```bash
# Launches local studio with auto-reload
imgshape --web --reload
```

---

## 🏗️ Architecture & Internal Mechanics

`imgshape` (Aurora Engine) operates on a **Fingerprint-Analyze-Decide** loop, acting as a middleware between raw storage and compute.

```mermaid
graph TD
    subgraph "Data Layer"
    A[Raw Images]
    end

    subgraph "imgshape Core (Atlas Bento)"
    B[Fingerprint Extractor] -->|Hash & Meta| C{Decision Engine}
    C -->|Rules v4.2| D[Recommendation]
    end

    subgraph "Integration Layer"
    D --> E[PyTorch/TF Code]
    D --> F[JSON Artifacts]
    D --> G[HTML/PDF Reports]
    end

    A --> B
```

### Core Components

* **Atlas Bento Orchestrator:** The central intent-driven API that manages the lifecycle of an analysis session.
* **Fingerprint Extractor:** A stateless module that computes immutable signatures for datasets (distributions, channel counts, hashes).
* **Decision Engine:** A rule-based system that maps dataset signatures + User Intent (e.g., "Speed" vs "Accuracy") to concrete preprocessing steps.

---

## 🤝 Community & Support

* **Issues**: Found a bug? [Open an issue](https://github.com/STiFLeR7/imgshape/issues).
* **Discussions**: Feature requests? [Join the discussion](https://github.com/STiFLeR7/imgshape/discussions).

<div align="center">

*Built by [Stifler](https://github.com/STiFLeR7) for the AI Engineering community.*

**[Star on GitHub](https://github.com/STiFLeR7/imgshape) ⭐** — it helps more people find clean data.

</div>
