Skip to content
Merged
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
20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# CRITICAL RULES

- 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.
- Code files must be under 200 lines of code.
- Write short Sphinx docstrings as a single description line and a line for each parameter.
- On first line of docstrings use \n instead of line break.
- Variable names must be `snake_case` sequence of descriptive words <=5 letters long.
- Keep labels consistent across the entire project.
- In commit messages: use `+` for code adds, `-` for code subtractions, `~` for refactors/fixes.
- Write full variable names at all times.
- Never exceed 200 lines of code in a single file.
- Use descriptive variable names instead of comments.
- No abbreviations.
- No empty docstring lines.
- No inline comments.
- No emoji.
- No global variables.
- No semantic commit messages.
17 changes: 0 additions & 17 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,6 @@

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

# CRITICAL RULES

- 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.
- 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
- Keep labels consistent across the entire project.
- In commit messages: use `+` for code adds, `-` for code subtractions, `~` for refactors/fixes.
- Write full variable names at all times. No abbreviations.
- Use descriptive variable names instead of comments.
- No inline comments.
- No emoji.
- No global variables.
- No semantic commit messages.

## Commands

```bash
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ compatibility:

![Stylized futuristic lines in the shape of an N](https://raw.githubusercontent.com/darkshapes/entity-statement/refs/heads/main/png/negate/negate_150.png)</div>

# negate <br><sub> entrypoint synthetic image classifier</sub>
# negate <br><sub> critical analysis of origin detection</sub>

A scanning, training, and research library for detecting the origin of digital images.
A scanning, training, and research library for scrutinizing illustration origin detection methods.

[<img src="https://img.shields.io/badge/feed_me-__?logo=kofi&logoColor=white&logoSize=auto&label=donate&labelColor=maroon&color=grey&link=https%3A%2F%2Fko-fi.com%2Fdarkshapes">](https://ko-fi.com/darkshapes)<br>
<br>
Expand Down
28 changes: 9 additions & 19 deletions _version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# file generated by setuptools-scm
# file generated by vcs-versioning
# don't change, don't track in version control
from __future__ import annotations

__all__ = [
"__version__",
Expand All @@ -10,25 +11,14 @@
"commit_id",
]

TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple
from typing import Union

VERSION_TUPLE = Tuple[Union[int, str], ...]
COMMIT_ID = Union[str, None]
else:
VERSION_TUPLE = object
COMMIT_ID = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
commit_id: COMMIT_ID
__commit_id__: COMMIT_ID
__version_tuple__: tuple[int | str, ...]
version_tuple: tuple[int | str, ...]
commit_id: str | None
__commit_id__: str | None

__version__ = version = '0.1.dev161+g47a99b31a.d20260304'
__version_tuple__ = version_tuple = (0, 1, 'dev161', 'g47a99b31a.d20260304')
__version__ = version = '0.1.dev179+g4790caea4.d20260407'
__version_tuple__ = version_tuple = (0, 1, 'dev179', 'g4790caea4.d20260407')

__commit_id__ = commit_id = 'g47a99b31a'
__commit_id__ = commit_id = 'g4790caea4'
43 changes: 7 additions & 36 deletions negate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from __future__ import annotations

import importlib
import logging
import warnings
from typing import Any
from negate.io.console import configure_runtime_logging
from negate.io.console import get_cli_logger
from negate.io.console import set_root_folder

__all__ = [
"Blurb",
Expand All @@ -15,8 +16,8 @@
"build_train_call",
"chart_decompositions",
"compute_weighted_certainty",
"configure_runtime_logging",
"end_processing",
"get_cli_logger",
"infer_origin",
"load_metadata",
"load_spec",
Expand All @@ -25,6 +26,7 @@
"run_training_statistics",
"save_features",
"save_train_result",
"set_root_folder",
"train_model",
"training_loop",
]
Expand All @@ -37,6 +39,7 @@
"chart_decompositions": ("negate.metrics.track", "chart_decompositions"),
"compute_weighted_certainty": ("negate.metrics.heuristics", "compute_weighted_certainty"),
"end_processing": ("negate.io.save", "end_processing"),
"get_cli_logger": ("negate.io.logging", "get_cli_logger"),
"infer_origin": ("negate.inference", "infer_origin"),
"load_metadata": ("negate.io.spec", "load_metadata"),
"load_spec": ("negate.io.spec", "load_spec"),
Expand All @@ -45,43 +48,11 @@
"run_training_statistics": ("negate.metrics.track", "run_training_statistics"),
"save_features": ("negate.io.save", "save_features"),
"save_train_result": ("negate.io.save", "save_train_result"),
"set_root_folder": ("negate.io.logging", "set_root_folder"),
"train_model": ("negate.train", "train_model"),
"training_loop": ("negate.train", "training_loop"),
}

_LOGGING_CONFIGURED = False


def configure_runtime_logging() -> None:
"""Apply quiet logging defaults for third-party ML stacks."""

global _LOGGING_CONFIGURED
if _LOGGING_CONFIGURED:
return

warnings.filterwarnings("ignore", category=UserWarning)
warnings.filterwarnings("ignore", category=DeprecationWarning)

try:
from datasets import logging as ds_logging, disable_progress_bars as ds_disable_progress_bars
from diffusers.utils import logging as df_logging
from huggingface_hub import logging as hf_logging
from huggingface_hub.utils.tqdm import disable_progress_bars as hf_disable_progress_bars
from timm.utils.log import setup_default_logging
from transformers import logging as tf_logging
except Exception:
# Keep startup resilient when optional deps are absent.
_LOGGING_CONFIGURED = True
return

setup_default_logging(logging.ERROR)
for logger in [df_logging, ds_logging, hf_logging, tf_logging]:
logger.set_verbosity_error()

ds_disable_progress_bars()
hf_disable_progress_bars()
_LOGGING_CONFIGURED = True


def __getattr__(name: str) -> Any:
source = _ATTR_SOURCES.get(name)
Expand Down
Loading
Loading