curaitor 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. curaitor-0.1.0a1/CHANGELOG.md +60 -0
  2. curaitor-0.1.0a1/LICENSE +77 -0
  3. curaitor-0.1.0a1/MANIFEST.in +8 -0
  4. curaitor-0.1.0a1/PKG-INFO +397 -0
  5. curaitor-0.1.0a1/README.md +320 -0
  6. curaitor-0.1.0a1/curaitor/__init__.py +89 -0
  7. curaitor-0.1.0a1/curaitor/api.py +568 -0
  8. curaitor-0.1.0a1/curaitor/app/__init__.py +47 -0
  9. curaitor-0.1.0a1/curaitor/app/analysis.py +734 -0
  10. curaitor-0.1.0a1/curaitor/app/annotaide_tab.py +244 -0
  11. curaitor-0.1.0a1/curaitor/app/datasets.py +480 -0
  12. curaitor-0.1.0a1/curaitor/app/lifecycle.py +117 -0
  13. curaitor-0.1.0a1/curaitor/app/mcp_server.py +161 -0
  14. curaitor-0.1.0a1/curaitor/app/records.py +283 -0
  15. curaitor-0.1.0a1/curaitor/app/sources/config.yaml +28 -0
  16. curaitor-0.1.0a1/curaitor/app/sources/folder.yaml +29 -0
  17. curaitor-0.1.0a1/curaitor/app/sources/huggingface.yaml +26 -0
  18. curaitor-0.1.0a1/curaitor/app/sources/image_folder.yaml +28 -0
  19. curaitor-0.1.0a1/curaitor/app/static/app.css +210 -0
  20. curaitor-0.1.0a1/curaitor/app/static/app.js +2146 -0
  21. curaitor-0.1.0a1/curaitor/app/static/index.html +130 -0
  22. curaitor-0.1.0a1/curaitor/app/static/map3d.js +271 -0
  23. curaitor-0.1.0a1/curaitor/app/static/vendor/OrbitControls.js +1523 -0
  24. curaitor-0.1.0a1/curaitor/app/static/vendor/three.LICENSE +21 -0
  25. curaitor-0.1.0a1/curaitor/app/static/vendor/three.module.min.js +6 -0
  26. curaitor-0.1.0a1/curaitor/app/views.py +299 -0
  27. curaitor-0.1.0a1/curaitor/app/web.py +762 -0
  28. curaitor-0.1.0a1/curaitor/app/workspace.py +950 -0
  29. curaitor-0.1.0a1/curaitor/app/workspaces/compare/analysis_compare.yaml +37 -0
  30. curaitor-0.1.0a1/curaitor/app/workspaces/compare/candidate.yaml +26 -0
  31. curaitor-0.1.0a1/curaitor/app/workspaces/compare/embedding.yaml +24 -0
  32. curaitor-0.1.0a1/curaitor/app/workspaces/compare/reference.yaml +26 -0
  33. curaitor-0.1.0a1/curaitor/app/workspaces/compare.yaml +19 -0
  34. curaitor-0.1.0a1/curaitor/app/workspaces/image-outliers/analysis_outliers.yaml +34 -0
  35. curaitor-0.1.0a1/curaitor/app/workspaces/image-outliers/embedding.yaml +24 -0
  36. curaitor-0.1.0a1/curaitor/app/workspaces/image-outliers/source.yaml +31 -0
  37. curaitor-0.1.0a1/curaitor/app/workspaces/image-outliers.yaml +18 -0
  38. curaitor-0.1.0a1/curaitor/app/workspaces/images/analysis_overview.yaml +45 -0
  39. curaitor-0.1.0a1/curaitor/app/workspaces/images/analysis_unique.yaml +53 -0
  40. curaitor-0.1.0a1/curaitor/app/workspaces/images/embedding.yaml +24 -0
  41. curaitor-0.1.0a1/curaitor/app/workspaces/images/source.yaml +29 -0
  42. curaitor-0.1.0a1/curaitor/app/workspaces/images.yaml +20 -0
  43. curaitor-0.1.0a1/curaitor/app/workspaces/label-issues/analysis_labels.yaml +36 -0
  44. curaitor-0.1.0a1/curaitor/app/workspaces/label-issues/embedding.yaml +24 -0
  45. curaitor-0.1.0a1/curaitor/app/workspaces/label-issues/source.yaml +28 -0
  46. curaitor-0.1.0a1/curaitor/app/workspaces/label-issues/source@sonair.yaml +28 -0
  47. curaitor-0.1.0a1/curaitor/app/workspaces/label-issues.yaml +20 -0
  48. curaitor-0.1.0a1/curaitor/audio_adapter.py +177 -0
  49. curaitor-0.1.0a1/curaitor/cleanlab_backend.py +96 -0
  50. curaitor-0.1.0a1/curaitor/cli.py +216 -0
  51. curaitor-0.1.0a1/curaitor/evidently_backend.py +164 -0
  52. curaitor-0.1.0a1/curaitor/fiftyone_service.py +80 -0
  53. curaitor-0.1.0a1/curaitor/image_adapter.py +181 -0
  54. curaitor-0.1.0a1/curaitor/networkx_backend.py +62 -0
  55. curaitor-0.1.0a1/curaitor/ops.py +924 -0
  56. curaitor-0.1.0a1/curaitor/plots.py +176 -0
  57. curaitor-0.1.0a1/curaitor/pot_backend.py +182 -0
  58. curaitor-0.1.0a1/curaitor/py.typed +0 -0
  59. curaitor-0.1.0a1/curaitor/pyod_backend.py +136 -0
  60. curaitor-0.1.0a1/curaitor/scipy_backend.py +104 -0
  61. curaitor-0.1.0a1/curaitor/sklearn_backend.py +380 -0
  62. curaitor-0.1.0a1/curaitor/torchmetrics_backend.py +123 -0
  63. curaitor-0.1.0a1/curaitor/umap_backend.py +78 -0
  64. curaitor-0.1.0a1/curaitor.egg-info/PKG-INFO +397 -0
  65. curaitor-0.1.0a1/curaitor.egg-info/SOURCES.txt +96 -0
  66. curaitor-0.1.0a1/curaitor.egg-info/dependency_links.txt +1 -0
  67. curaitor-0.1.0a1/curaitor.egg-info/entry_points.txt +12 -0
  68. curaitor-0.1.0a1/curaitor.egg-info/requires.txt +62 -0
  69. curaitor-0.1.0a1/curaitor.egg-info/top_level.txt +1 -0
  70. curaitor-0.1.0a1/examples/check_labels.yaml +17 -0
  71. curaitor-0.1.0a1/examples/compare_datasets.yaml +14 -0
  72. curaitor-0.1.0a1/examples/find_outliers.yaml +17 -0
  73. curaitor-0.1.0a1/graphs/image_outliers.yaml +37 -0
  74. curaitor-0.1.0a1/pyproject.toml +206 -0
  75. curaitor-0.1.0a1/setup.cfg +8 -0
  76. curaitor-0.1.0a1/setup.py +42 -0
  77. curaitor-0.1.0a1/tests/test_api.py +391 -0
  78. curaitor-0.1.0a1/tests/test_audio_adapter.py +159 -0
  79. curaitor-0.1.0a1/tests/test_cleanlab_backend.py +81 -0
  80. curaitor-0.1.0a1/tests/test_cli.py +227 -0
  81. curaitor-0.1.0a1/tests/test_env_example.py +125 -0
  82. curaitor-0.1.0a1/tests/test_evidently_backend.py +165 -0
  83. curaitor-0.1.0a1/tests/test_fiftyone_service.py +157 -0
  84. curaitor-0.1.0a1/tests/test_image_adapter.py +148 -0
  85. curaitor-0.1.0a1/tests/test_networkx_backend.py +49 -0
  86. curaitor-0.1.0a1/tests/test_no_private_names.py +41 -0
  87. curaitor-0.1.0a1/tests/test_ops.py +743 -0
  88. curaitor-0.1.0a1/tests/test_packaging.py +133 -0
  89. curaitor-0.1.0a1/tests/test_plots.py +82 -0
  90. curaitor-0.1.0a1/tests/test_pot_backend.py +126 -0
  91. curaitor-0.1.0a1/tests/test_pyod_backend.py +101 -0
  92. curaitor-0.1.0a1/tests/test_scipy_backend.py +81 -0
  93. curaitor-0.1.0a1/tests/test_sklearn_backend.py +232 -0
  94. curaitor-0.1.0a1/tests/test_torchmetrics_backend.py +133 -0
  95. curaitor-0.1.0a1/tests/test_umap_backend.py +67 -0
  96. curaitor-0.1.0a1/tests/test_version.py +14 -0
  97. curaitor-0.1.0a1/tests/test_wheel_ships_configs.py +50 -0
@@ -0,0 +1,60 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the versioning is
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0a1] — 2026-11-27
10
+
11
+ The first release.
12
+
13
+ ### Added
14
+ - **Dataset curation and analysis behind one configuration**: outlier detection, distribution distances,
15
+ synthetic-versus-real comparison, label cleaning and dimensionality reduction, each a wrapper over the library that
16
+ does the work (scikit-learn and scipy in the base install; pyod, POT, torchmetrics, cleanlab, evidently and
17
+ umap-learn as extras).
18
+ - **Feature adapters** for images (`[image]`) and audio (`[audio]`).
19
+ - **The command line** (`curaitor list-methods | find-outliers | compare | check-labels | project`) and the same
20
+ analyses as record ops.
21
+ - **The analysis app** (`[web]`: `curaitor workspace <type>`, `curaitor open <workspace.yaml>`): datasets, records and
22
+ analysis graphs in a web page, with background jobs, a mounted graph editor and `curaitor-mcp`.
23
+ - **Every pane can be moved**: drag a pane's title (*records*, *map*, *record*) onto another pane, and it goes to that
24
+ pane's left, right, top or bottom — or along a whole edge of the page. The browser keeps where the panes are. A
25
+ focused border moves with the arrow keys.
26
+ - **The records list's columns turned on and off**: *columns ▾* in the list's header, or a right-click on a column
27
+ header, opens a checklist of every column but `name`. A column turned off is only not drawn — the filter, the sort
28
+ and the map still read it. The workspace keeps the columns that are off (`hidden_columns`, posted to
29
+ `api/columns`).
30
+ - **The most similar pictures hidden**: a double-click on the record view's *most similar* heading hides them for
31
+ every record opened after it, and again shows them; the browser keeps the choice over a reload.
32
+ - **One picture per group of copies**: `FindSimilarRecords` marks every record of a group but the one kept as
33
+ `redundant`, the op `DropFlagged` drops the records a yes/no entry flags, and the `images` type has a second
34
+ analysis, `unique`, that runs the overview over the pictures left.
35
+ - **`duplicate_rule`**, a setting of `FindSimilarRecords`, one of six: `representative` (every record of a group is
36
+ within the threshold of the group's kept record), `distinct` (that, and no two kept records are within it),
37
+ `all_pairs` (every two records of a group are within it), `chains` (a group is every record a chain of copies
38
+ links), and networkx's own `networkx_dominating` and `networkx_independent`. `docs/duplicates.md` has what each
39
+ keeps on real data and what it costs at 1,000 to 50,000 records.
40
+ - **Every copy kept, a folder per group**: `docs/duplicates.md` has the config that writes the groups of
41
+ `FindSimilarRecords` as folders (recordstream's `GroupedFilesSink`) — or, for a dataset with labels, as a groups
42
+ file that moves nothing (`GroupsFileSink`) — for a training run that takes one picture per group and another one
43
+ each epoch.
44
+ - **`curaitor.networkx_backend`** (`networkx`, a core dependency): the kept records of the two networkx rules.
45
+ - **A record's pictures**: every entry of a record holding a picture is kept beside the `image_key` one, a thumbnail
46
+ and a preview each. The record view shows them with a chip each — a click hides or shows one, **all** shows every
47
+ one, a chip's ★ makes it the default (the list's thumbnails, the most similar pictures). The workspace keeps the
48
+ choice (`image_key`, the new `shown_pictures`); `POST /api/pictures` sets it, and
49
+ `GET /api/images/<analysis>/<id>/<size>?picture=<entry>` serves one picture.
50
+ - **A drag between two panes leaves each at least 160 px**, and a double click on the border shares the room evenly
51
+ between the two panes beside it.
52
+ - **The licence is the PolyForm Noncommercial License 1.0.0** (`LICENSE`, `pyproject.toml`): free for personal,
53
+ academic and other noncommercial use; commercial use needs a separate licence from the author.
54
+ - **A `duplicate_group` is a cluster by default**: every record of it is at least `duplicate_similarity` alike to its
55
+ kept record, over every pair of records.
56
+ - **The methods list imports no library**: `list_methods`, `available_methods` and `curaitor list-methods` ask
57
+ whether each backend's package is installed without importing it, and answer in milliseconds. A package that is
58
+ installed but fails to import is listed as available; using it raises the package's own error.
59
+ - **A cached row lists its `pictures`** (the entry names), and each picture is kept as `<id>.<n>.thumb.png` /
60
+ `<id>.<n>.preview.png`; `GET /api/records/<id>` answers `pictures` as a list of `{name, thumb, preview}`.
@@ -0,0 +1,77 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
12
+
13
+ ## Distribution License
14
+
15
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
16
+
17
+ ## Notices
18
+
19
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
20
+
21
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
22
+
23
+ ## Changes and New Works License
24
+
25
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
26
+
27
+ ## Patent License
28
+
29
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
30
+
31
+ ## Noncommercial Purposes
32
+
33
+ Any noncommercial purpose is a permitted purpose.
34
+
35
+ ## Personal Uses
36
+
37
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
38
+
39
+ ## Noncommercial Organizations
40
+
41
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
42
+
43
+ ## Fair Use
44
+
45
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
46
+
47
+ ## No Other Rights
48
+
49
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
50
+
51
+ ## Patent Defense
52
+
53
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
54
+
55
+ ## Violations
56
+
57
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
58
+
59
+ ## No Liability
60
+
61
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
62
+
63
+ ## Definitions
64
+
65
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
66
+
67
+ **You** refers to the individual or entity agreeing to these terms.
68
+
69
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
70
+
71
+ **Your licenses** are all the licenses granted to you for the software under these terms.
72
+
73
+ **Use** means anything you do with the software requiring one of your licenses.
74
+
75
+ ---
76
+
77
+ Required Notice: Copyright (c) 2026 Gert Behiels
@@ -0,0 +1,8 @@
1
+ # What the sdist ships BEYOND what setuptools already infers.
2
+ #
3
+ # `readme = "README.md"` and `license-files = ["LICENSE"]` in pyproject already pull those two in, and
4
+ # `packages.find` + `[tool.setuptools.package-data]` pull the package. A CHANGELOG is referenced by nothing, so
5
+ # without this line it is absent from the sdist.
6
+ #
7
+ # Pinned by tests/test_packaging.py::test_the_changelog_is_shipped_in_the_sdist
8
+ include CHANGELOG.md
@@ -0,0 +1,397 @@
1
+ Metadata-Version: 2.4
2
+ Name: curaitor
3
+ Version: 0.1.0a1
4
+ Summary: (loggair / confluid / liquifai) adapter for dataset curation & analysis: outlier detection, distance metrics, synthetic-vs-real comparison, label cleaning, dimensionality reduction.
5
+ Author: Gert Behiels
6
+ License-Expression: PolyForm-Noncommercial-1.0.0
7
+ Project-URL: Homepage, https://github.com/Gearlux/curaitor
8
+ Project-URL: Repository, https://github.com/Gearlux/curaitor.git
9
+ Project-URL: Issues, https://github.com/Gearlux/curaitor/issues
10
+ Project-URL: Changelog, https://github.com/Gearlux/curaitor/blob/main/CHANGELOG.md
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Web Environment
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.12
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: liquifai>=0.4.0
26
+ Requires-Dist: loggair>=0.3.0
27
+ Requires-Dist: confluid>=0.5.0
28
+ Requires-Dist: recordstream>=0.1.0a4
29
+ Requires-Dist: numpy>=1.26
30
+ Requires-Dist: scipy>=1.11
31
+ Requires-Dist: scikit-learn>=1.3
32
+ Requires-Dist: networkx>=3.0
33
+ Requires-Dist: orjson
34
+ Requires-Dist: annotated-types
35
+ Provides-Extra: dev
36
+ Requires-Dist: playwright>=1.40.0; extra == "dev"
37
+ Requires-Dist: black<25.0.0,>=24.0.0; extra == "dev"
38
+ Requires-Dist: isort<6.0.0,>=5.13.0; extra == "dev"
39
+ Requires-Dist: flake8<8.0.0,>=6.0.0; extra == "dev"
40
+ Requires-Dist: mypy<2.0.0,>=1.0.0; extra == "dev"
41
+ Requires-Dist: pytest<9.0.0,>=7.0.0; extra == "dev"
42
+ Requires-Dist: pytest-cov<7.0.0,>=4.0.0; extra == "dev"
43
+ Requires-Dist: build>=1.0.0; extra == "dev"
44
+ Requires-Dist: twine>=5.0.0; extra == "dev"
45
+ Requires-Dist: setuptools>=77; extra == "dev"
46
+ Requires-Dist: wheel; extra == "dev"
47
+ Provides-Extra: outliers
48
+ Requires-Dist: pyod>=2.0; extra == "outliers"
49
+ Provides-Extra: distances
50
+ Requires-Dist: pot>=0.9; extra == "distances"
51
+ Provides-Extra: generative
52
+ Requires-Dist: torchmetrics[image]>=1.4; extra == "generative"
53
+ Requires-Dist: torch>=2.1; extra == "generative"
54
+ Provides-Extra: cleaning
55
+ Requires-Dist: cleanlab>=2.7; extra == "cleaning"
56
+ Provides-Extra: drift
57
+ Requires-Dist: evidently>=0.4; extra == "drift"
58
+ Provides-Extra: viz
59
+ Requires-Dist: umap-learn>=0.5; extra == "viz"
60
+ Requires-Dist: matplotlib>=3.7; extra == "viz"
61
+ Provides-Extra: image
62
+ Requires-Dist: timm>=1.0; extra == "image"
63
+ Requires-Dist: torch>=2.1; extra == "image"
64
+ Requires-Dist: pillow>=10.0; extra == "image"
65
+ Provides-Extra: audio
66
+ Requires-Dist: torchaudio>=2.1; extra == "audio"
67
+ Requires-Dist: torch>=2.1; extra == "audio"
68
+ Requires-Dist: soundfile>=0.12; extra == "audio"
69
+ Provides-Extra: web
70
+ Requires-Dist: portail[mcp]>=0.1.0a2; extra == "web"
71
+ Requires-Dist: flask>=3.0; extra == "web"
72
+ Requires-Dist: streamstudio>=0.1.0a2; extra == "web"
73
+ Requires-Dist: pillow; extra == "web"
74
+ Provides-Extra: all
75
+ Requires-Dist: curaitor[audio,cleaning,distances,drift,generative,image,outliers,viz,web]; extra == "all"
76
+ Dynamic: license-file
77
+
78
+ # Curaitor
79
+
80
+ (loggair / confluid / liquifai) adapter for **dataset curation & analysis** — outlier detection, distribution distances, synthetic-vs-real comparison, label cleaning, and dimensionality reduction — exposed through five `@configurable` wrappers and one Liquify CLI.
81
+
82
+ | Verb | Adapter | Methods | Extra |
83
+ |---|---|---|---|
84
+ | `outliers` | [`scikit-learn`](https://scikit-learn.org/) | `iforest`, `lof`, `ocsvm`, `elliptic` | core |
85
+ | `outliers` | [`pyod`](https://pyod.readthedocs.io/) | `ecod`, `copod`, `hbos`, `abod`, `knn`, `pyod_iforest`, `pyod_lof`, `pyod_ocsvm`, `pyod_pca`, `mcd` | `[outliers]` |
86
+ | `distance` | [`scipy.stats`](https://docs.scipy.org/doc/scipy/reference/stats.html) | `ks`, `anderson`, `wasserstein_1d`, `energy_1d`, `cramer_von_mises` | core |
87
+ | `distance` | [`POT`](https://pythonot.github.io/) | `wasserstein`, `sinkhorn`, `mmd`, `energy`, `bures` | `[distances]` |
88
+ | `distance` | [`evidently`](https://docs.evidentlyai.com/) | `psi`, `js` | `[drift]` |
89
+ | `compare` | [`torchmetrics`](https://lightning.ai/docs/torchmetrics/) | `fid`, `kid`, `inception` | `[generative]` |
90
+ | `compare` | [`evidently`](https://docs.evidentlyai.com/) | `drift_report` | `[drift]` |
91
+ | `labels` | [`cleanlab`](https://docs.cleanlab.ai/) | `cleanlab` | `[cleaning]` |
92
+ | `project` | [`scikit-learn`](https://scikit-learn.org/) | `sklearn_pca`, `sklearn_tsne` | core |
93
+ | `project` | [`umap-learn`](https://umap-learn.readthedocs.io/) | `umap` | `[viz]` |
94
+
95
+ Plus two optional **modality adapters** that turn a `Stream` of raw records into a feature matrix the dispatchers consume directly:
96
+
97
+ | Adapter | Backbone | Module | Extra |
98
+ |---|---|---|---|
99
+ | Image features | `timm` (default `efficientvit_b0`) | `curaitor.image_adapter.extract_image_features` | `[image]` |
100
+ | Audio features | `torchaudio` pipelines (default HuBERT-base) | `curaitor.audio_adapter.extract_audio_features` | `[audio]` |
101
+
102
+ Curaitor is **not** a curation library. It's a thin glue layer (~1000 LOC) over upstream packages that already do the work, with loggair logging, Confluid YAML config, and the same liquifai CLI conventions as the rest of the workspace.
103
+
104
+ ## The dataset-analysis landscape
105
+
106
+ Curaitor ships method wrappers for the libraries highlighted **in bold** below. Everything else listed is a known, useful tool worth knowing about — pick the right one before reaching for curaitor.
107
+
108
+ ### Outlier / anomaly detection
109
+
110
+ | Library | Notes | Wrapped |
111
+ |---|---|---|
112
+ | **scikit-learn** | `IsolationForest`, `LocalOutlierFactor`, `OneClassSVM`, `EllipticEnvelope`. Lightweight defaults. | ✅ core |
113
+ | **PyOD** | 40+ algorithms (ECOD, COPOD, HBOS, ABOD, KNN, IForest, LOF, OCSVM, PCA-recon, MCD, …). Standard reference. | ✅ `[outliers]` |
114
+ | alibi-detect | Adversarial / drift / OOD; deep-learning-flavoured | — (overlaps with pyod + cleanlab) |
115
+ | pythresh | Automated thresholding for outlier scores | — (orthogonal — could layer on top) |
116
+
117
+ ### Distribution distance / divergence
118
+
119
+ | Library | Notes | Wrapped |
120
+ |---|---|---|
121
+ | **scipy.stats** | KS, Anderson–Darling, Cramér–von Mises, Wasserstein-1D, energy-1D | ✅ core |
122
+ | **POT (Python Optimal Transport)** | Multi-dim Wasserstein / Sinkhorn / MMD / energy / Bures | ✅ `[distances]` |
123
+ | **evidently** | Column-wise PSI, JS, drift reports with HTML rendering | ✅ `[drift]` |
124
+ | geomloss | GPU-friendly OT (Sinkhorn divergence). Heavier dep | — |
125
+
126
+ ### Synthetic-vs-real evaluation (image / audio)
127
+
128
+ | Library | Notes | Wrapped |
129
+ |---|---|---|
130
+ | **torchmetrics[image]** | FID, KID, IS, LPIPS — feature-matrix mode lets us stay modality-agnostic | ✅ `[generative]` |
131
+ | sdmetrics / SDV | Tabular-synthetic-data metrics | — (different problem) |
132
+
133
+ ### Dataset cleaning / label issues
134
+
135
+ | Library | Notes | Wrapped |
136
+ |---|---|---|
137
+ | **cleanlab** | Confident-learning label issues, near-duplicate flagging | ✅ `[cleaning]` |
138
+ | imagededup | pHash / dHash / CNN duplicate detection (image-only) | — (cleanlab covers most cases) |
139
+
140
+ ### Dimensionality reduction
141
+
142
+ | Library | Notes | Wrapped |
143
+ |---|---|---|
144
+ | **scikit-learn** | PCA, t-SNE | ✅ core |
145
+ | **umap-learn** | UMAP — non-linear default | ✅ `[viz]` |
146
+ | openTSNE | Faster t-SNE | — |
147
+ | pacmap, trimap | Newer alternatives | — |
148
+
149
+ Anything not yet wrapped that you need — file an issue or drop in a `<name>_backend.py` (the registry pattern in `curaitor.api` is intentionally one-file-to-add).
150
+
151
+ ## Installation
152
+
153
+ ```bash
154
+ pip install curaitor
155
+ ```
156
+
157
+ Backends are optional extras — install only what you need:
158
+
159
+ ```bash
160
+ pip install "curaitor[outliers]" # pyod
161
+ pip install "curaitor[distances]" # POT
162
+ pip install "curaitor[generative]" # torchmetrics + torch
163
+ pip install "curaitor[cleaning]" # cleanlab
164
+ pip install "curaitor[drift]" # evidently
165
+ pip install "curaitor[viz]" # umap-learn + matplotlib
166
+ pip install "curaitor[image]" # timm + torch + pillow
167
+ pip install "curaitor[audio]" # torchaudio + torch + soundfile
168
+ pip install "curaitor[web]" # the analysis app (portail, Flask, streamstudio)
169
+ pip install "curaitor[all]" # everything
170
+ ```
171
+
172
+ ### Development
173
+
174
+ ```bash
175
+ git clone https://github.com/Gearlux/curaitor.git
176
+ cd curaitor
177
+ pip install -e ".[dev,outliers,distances,cleaning,viz]" # core + most extras + dev tools
178
+ ```
179
+
180
+ ## Architecture
181
+
182
+ ```
183
+ YAML (Confluid) dispatch upstream library
184
+ ┌─────────────────┐ ┌────────────────────┐ ┌─────────────────────────┐
185
+ │ detector: │ │ OutlierDetector │ │ pyod.models.* │
186
+ │ method: ... │───▶│ find_outliers() │───▶│ sklearn.ensemble.* │
187
+ │ comparator: │───▶│ compare_datasets()│───▶│ torchmetrics.image.* │
188
+ │ checker: │───▶│ check_labels() │───▶│ cleanlab.rank.* │
189
+ │ projector: │───▶│ project() │───▶│ umap.UMAP / sklearn │
190
+ │ input(s)/output │ │ per-verb registry │ │ ot.emd2 / scipy.stats │
191
+ └─────────────────┘ └────────────────────┘ └─────────────────────────┘
192
+ ▲ │
193
+ liquifai CLI loggair logger
194
+ ```
195
+
196
+ Each backend lives in a single `<name>_backend.py` exposing only the verbs it serves:
197
+
198
+ ```python
199
+ OUTLIER_METHODS: tuple[str, ...] = () # zero or more
200
+ DISTANCE_METHODS: tuple[str, ...] = ()
201
+ COMPARE_METHODS: tuple[str, ...] = ()
202
+ LABEL_METHODS: tuple[str, ...] = ()
203
+ PROJECT_METHODS: tuple[str, ...] = ()
204
+
205
+ def is_available() -> bool: ...
206
+ def find_outliers(features, *, method, contamination, **kw) -> OutlierResult: ...
207
+ def compute_distance(a, b, *, method, **kw) -> float: ...
208
+ def compare_datasets(a, b, *, method, **kw) -> ComparisonReport: ...
209
+ def check_labels(features, labels, *, method, **kw) -> LabelIssueResult: ...
210
+ def project(features, *, method, n_components, **kw) -> ProjectionResult: ...
211
+ ```
212
+
213
+ The dispatcher in `curaitor.api` builds five `method → backend` registries (one per verb) at import time and forwards calls. Upstream libraries are imported lazily, so the package works with any subset of the optional extras installed.
214
+
215
+ ## Quick start
216
+
217
+ ### From Python — outlier detection
218
+
219
+ ```python
220
+ import numpy as np
221
+ from curaitor import find_outliers, list_methods
222
+
223
+ print(list_methods(only_available=True, verb="outliers")) # which detectors are installed?
224
+
225
+ rng = np.random.default_rng(0)
226
+ features = np.vstack([rng.normal(0, 1, (1000, 64)), rng.normal(8, 1, (50, 64))])
227
+
228
+ result = find_outliers(features, method="iforest", contamination=0.05)
229
+ print(result.flags.sum(), "records flagged")
230
+ ```
231
+
232
+ ### From Python — synthetic-vs-real
233
+
234
+ ```python
235
+ from curaitor import compare_datasets
236
+
237
+ # pre-extract features upstream — sonair / timm / your own encoder
238
+ real_feats = ... # (N_real, 2048) float32
239
+ synth_feats = ... # (N_syn, 2048) float32
240
+
241
+ report = compare_datasets(real_feats, synth_feats, method="fid", feature=2048)
242
+ print(report.distance, report.per_metric) # FID
243
+ ```
244
+
245
+ ### From Python — image features then outliers
246
+
247
+ ```python
248
+ from curaitor.image_adapter import extract_image_features
249
+ from curaitor import find_outliers
250
+
251
+ # `stream` is any iterable of recordstream typed-bag Records (the adapter reads each
252
+ # record's primary input item; bare arrays / positional tuples also work).
253
+ features = extract_image_features(stream, model_name="efficientvit_b0", batch_size=32)
254
+ result = find_outliers(features, method="iforest", contamination=0.02)
255
+ ```
256
+
257
+ ### From a Confluid YAML
258
+
259
+ ```yaml
260
+ # examples/find_outliers.yaml
261
+ detector: !class:curaitor.OutlierDetector
262
+ method: iforest
263
+ contamination: 0.1
264
+
265
+ input: examples/data/features.npy
266
+ output: examples/data/outliers.json
267
+ ```
268
+
269
+ ```bash
270
+ curaitor find-outliers examples/find_outliers.yaml
271
+ ```
272
+
273
+ ### In a recordstream pipeline
274
+
275
+ curaitor's methods are graph ops too (`curaitor.ops`: `ExtractImageEmbedding`, `ExtractAudioEmbedding`,
276
+ `FlagOutliers`, `ProjectEmbeddings`, `FindSimilarRecords`, `DropFlagged`, `FlagLabelIssues`,
277
+ `EstimateClassProbabilities`, `CompareDatasets`), listed in streamstudio's palette:
278
+
279
+ ```bash
280
+ recordstream run graphs/image_outliers.yaml root=/path/to/pictures
281
+ ```
282
+
283
+ Every picture's record leaves with `embedding`, `outlier_score`, `outlier` and `projection`. See
284
+ [docs/ops.md](https://github.com/Gearlux/curaitor/blob/main/docs/ops.md).
285
+
286
+ ### In the browser — the analysis app
287
+
288
+ ```bash
289
+ pip install "curaitor[web,image]"
290
+ curaitor # pick "images", type the folder of your pictures, ▶ run
291
+ ```
292
+
293
+ A served workspace on [portail](https://github.com/Gearlux/portail): the records list with portail's filter
294
+ language (`outlier_score > 0.6`, `outlier`, `label = cat`), each record's pictures (a default, and the ones shown,
295
+ chosen on the page) and entries, a projection scatter
296
+ coloured by any column, the analysis run as a job with progress and a stop, its results cached in the workspace's
297
+ folder, the source and analysis graphs drawn in the mounted graph editor, a comparison of two folders, and
298
+ `curaitor-mcp` — the page's routes as MCP tools. Types: `image-outliers`, `label-issues`, `compare`. See
299
+ [docs/app.md](https://github.com/Gearlux/curaitor/blob/main/docs/app.md).
300
+
301
+ ## CLI reference
302
+
303
+ | Command | Purpose |
304
+ |---|---|
305
+ | `curaitor list-methods` | Print every registered method (across all verbs) and whether its backend is installed. |
306
+ | `curaitor find-outliers <yaml>` | Apply the configured `detector:` to `input:` (a feature matrix) and write a JSON outlier report to `output:`. |
307
+ | `curaitor compare <yaml>` | Apply the configured `comparator:` to `input_a:` and `input_b:` and write a JSON comparison report to `output:`. |
308
+ | `curaitor check-labels <yaml>` | Apply the configured `checker:` to `input:` (predicted-probability matrix) + `labels:` and write a JSON label-issue report to `output:`. |
309
+ | `curaitor project <yaml>` | Apply the configured `projector:` to `input:` and write a JSON projection (`coords`, `n_components`, `extra`) to `output:`. |
310
+ | `curaitor workspace <type>` | Serve a NEW analysis workspace of a type (`image-outliers`, `label-issues`, `compare`) — `[web]`. |
311
+ | `curaitor open <workspace.yaml>` | Serve a saved workspace (the default command: `curaitor <workspace.yaml>`) — `[web]`. |
312
+ | `curaitor stop\|restart\|list` | Stop, restart or list the running app servers, by the workspace they serve — `[web]`. |
313
+ | `curaitor-mcp` | The served page's routes as MCP tools (`page_state`, `list_records`, `run_analysis`, …) — `[web]`. |
314
+
315
+ The CLI inherits Confluid's dotted-key overrides:
316
+
317
+ ```bash
318
+ curaitor find-outliers cfg.yaml detector.contamination=0.02
319
+ ```
320
+
321
+ ## The FiftyOne App as a workspace service
322
+
323
+ curaitor brings a service class for a workspace's service manager: `curaitor.fiftyone_service.FiftyOne` starts the
324
+ [FiftyOne](https://docs.voxel51.com/) App, to browse a dataset, its labels and the outliers found. The manager finds
325
+ the class through its entry point once curaitor is installed, and gives the service its `start`, `info` and `stop`.
326
+ A start serves on port 5151 unless another port is asked for; `info` answers the address, the database folder and
327
+ the datasets.
328
+
329
+ FiftyOne itself is not one of curaitor's dependencies; install it with `uv pip install fiftyone` (the start says so
330
+ when it is missing). Its database lives in the service's data folder, and the start writes `FIFTYONE_URL` and
331
+ `FIFTYONE_DATABASE_DIR` into the workspace `.env`.
332
+
333
+ ## What's in the package
334
+
335
+ | Module | Purpose |
336
+ |---|---|
337
+ | `curaitor.api.find_outliers` / `OutlierDetector` | Per-record anomaly scoring. |
338
+ | `curaitor.api.compute_distance` / `DistanceMetric` | One-number distribution distance. |
339
+ | `curaitor.api.compare_datasets` / `DatasetComparator` | Multi-metric dataset comparison (FID/KID/drift). |
340
+ | `curaitor.api.check_labels` / `LabelChecker` | Per-record label-issue scoring. |
341
+ | `curaitor.api.project` / `Projector` | N-D → low-D embedding for inspection. |
342
+ | `curaitor.api.list_methods` | Inspect the registries + availability. |
343
+ | `curaitor.scipy_backend` | KS / Anderson / Wasserstein-1D / energy-1D / Cramér–von Mises. |
344
+ | `curaitor.sklearn_backend` | Iforest / LOF / OCSVM / EllipticEnvelope, PCA / t-SNE. |
345
+ | `curaitor.networkx_backend` | The kept records of a set of near-copies: dominating / maximal independent set. |
346
+ | `curaitor.pyod_backend` | ECOD / COPOD / HBOS / ABOD / KNN / IForest / LOF / OCSVM / PCA-recon / MCD. |
347
+ | `curaitor.pot_backend` | Wasserstein / Sinkhorn / MMD / energy / Bures (multi-dim). |
348
+ | `curaitor.cleanlab_backend` | Confident-learning label issues. |
349
+ | `curaitor.umap_backend` | UMAP projection. |
350
+ | `curaitor.evidently_backend` | PSI / JS / drift reports. |
351
+ | `curaitor.torchmetrics_backend` | FID / KID / Inception Score. |
352
+ | `curaitor.image_adapter` | timm-based image-feature extraction (extra `[image]`). |
353
+ | `curaitor.audio_adapter` | torchaudio-based audio-feature extraction (extra `[audio]`). |
354
+ | `curaitor.ops` | The graph ops: embed, flag outliers, project, flag label issues, compare ([docs/ops.md](https://github.com/Gearlux/curaitor/blob/main/docs/ops.md)). |
355
+ | `curaitor.plots` | matplotlib helpers (extra `[viz]`). |
356
+ | `curaitor.app` | The analysis app: the workspace, the analysis jobs and their cache, the page, `curaitor-mcp` (extra `[web]`, [docs/app.md](https://github.com/Gearlux/curaitor/blob/main/docs/app.md)). |
357
+ | `curaitor.cli` | `list-methods`, `find-outliers`, `compare`, `check-labels`, `project`, and the app's `open`, `workspace`, `stop`, `restart`, `list`. |
358
+ | `curaitor.fiftyone_service` | The FiftyOne App as a workspace service. |
359
+
360
+ ## Why a thin adapter?
361
+
362
+ The dataset-curation landscape is well-served by mature upstream packages — pyod for anomaly detection, cleanlab for label issues, POT for OT distances, torchmetrics for generative-model metrics. There's no value in re-implementing them.
363
+
364
+ What curaitor adds:
365
+
366
+ - One Python entry point per concern (`find_outliers`, `compute_distance`, `compare_datasets`, `check_labels`, `project`) instead of N library APIs.
367
+ - One Confluid YAML knob per concern (`!class:curaitor.OutlierDetector`, etc.) for use inside RecordStream pipelines, matrainer training loops, or any other config.
368
+ - loggair integration for unified logging across the workspace.
369
+ - A `curaitor` liquifai CLI, with the same conventions as the rest of the workspace.
370
+ - Lazy imports so the package itself works with any subset of `[outliers]` / `[distances]` / `[generative]` / `[cleaning]` / `[drift]` / `[viz]` / `[image]` / `[audio]` installed.
371
+ - Consistent return types (dataclasses) that round-trip through JSON for use with RecordStream sinks.
372
+
373
+ If you only need one backend, use it directly. If you want to write code that swaps detectors / metrics via config, curaitor is the glue.
374
+
375
+ ## Dependencies
376
+
377
+ | Package | Purpose | Required? |
378
+ |---|---|---|
379
+ | `confluid` | YAML config + `@configurable` | yes |
380
+ | `liquifai` | CLI framework | yes |
381
+ | `loggair` | Structured logging | yes |
382
+ | `recordstream` | Record / Stream types, the graph ops' base | yes (`curaitor.ops` imports it; the adapters read records as plain dicts and import nothing from it) |
383
+ | `numpy`, `scipy`, `scikit-learn` | Core array + classical methods | yes |
384
+ | `networkx` | Graph algorithms for the groups of near-copies | yes |
385
+ | `pyod` | Outlier algorithm catalog | optional (`[outliers]`) |
386
+ | `pot` | Optimal-transport distances | optional (`[distances]`) |
387
+ | `torchmetrics[image]` + `torch` | FID / KID / IS | optional (`[generative]`) |
388
+ | `cleanlab` | Label-issue detection | optional (`[cleaning]`) |
389
+ | `evidently` | Drift reports | optional (`[drift]`) |
390
+ | `umap-learn` + `matplotlib` | UMAP + plot helpers | optional (`[viz]`) |
391
+ | `timm` + `torch` + `pillow` | Image-feature adapter | optional (`[image]`) |
392
+ | `torchaudio` + `torch` + `soundfile` | Audio-feature adapter | optional (`[audio]`) |
393
+ | `portail[mcp]` + `flask` + `streamstudio` + `pillow` | The analysis app: serving, its page, the graph editor, thumbnails, the MCP tools | optional (`[web]`) |
394
+
395
+ ## License
396
+
397
+ [PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0) (the `LICENSE` file): free for personal, academic and other noncommercial use. Commercial use needs a separate licence from the author.