Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- Scan the existing codebase and reuse existing functions wherever possible.
- Keep all imports within functions unless they must be mocked in a test.
- If an import is small, performative, and significantly reduces needs for new code, use the library.
- Generally code should stay under 100 lines.
- A code file should never exceed 200 lines.
- Write short Sphinx docstrings as a single line description, a single line for each parameter, and no empty lines.
- On first line of docstrings use \n instead of line break.
- Variable names must be `snake_case` sequence of descriptive words <=5 letters long
Expand Down
43 changes: 43 additions & 0 deletions negate/extract/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-License-Identifier: MPL-2.0 AND LicenseRef-Commons-Clause-License-Condition-1.0
# <!-- // /* d a r k s h a p e s */ -->

"""Extract package for feature extraction modules.

This package provides unified feature extraction with interchangeable analyzers.
Users can select which modules to run and in what order.

Modules:
- UnifiedExtractor: Main interface for selecting and running extractors
- ExtractorPipeline: Configurable pipeline for ordered extraction
- ArtworkExtract: 158 handcrafted features for artwork detection
- LearnedExtract: 768 ConvNeXt features for learned representation
- VAEExtract: VAE latent features with drift analysis
- VITExtract: Vision Transformer feature extraction
- Residual: Residual image feature computations

Usage:
>>> from negate.extract import UnifiedExtractor, create_extractor
>>> from negate.io.spec import Spec
>>> spec = Spec()
>>> extractor = UnifiedExtractor(spec, enable=["artwork", "learned", "vae"])
>>> features = extractor(image)
>>> # or use factory function
>>> extractor = create_extractor(spec, ["artwork", "learned", "vit"])
"""

from negate.extract.feature_artwork import ArtworkExtract
from negate.extract.feature_learned import LearnedExtract
from negate.extract.feature_vae import VAEExtract
from negate.extract.feature_vit import VITExtract
from negate.extract.unified import UnifiedExtractor, ExtractorPipeline, create_extractor, create_pipeline

__all__ = [
"ArtworkExtract",
"LearnedExtract",
"VAEExtract",
"VITExtract",
"UnifiedExtractor",
"ExtractorPipeline",
"create_extractor",
"create_pipeline",
]
Loading