The detectors are in detectors/detectors/; the manual set and the benchmark in models/rules/ (moved from aimsight-detectors)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cae07a2787
commit
9d75a71522
5 files changed
+13
-13
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ The tool of the manual diagnostic: three pages, **Data**, **Stations** and **Con
|
||||
|
||||
- **The plots**: one at the start (displacements, camera, image quality, system metrics), "Add a plot" to see several, aligned in time, the cross to remove one; a click on a curve sets the images to the image nearest to that moment. The zones of the labels are barely visible there (opacity 0.05, 0.07 in dark mode).
|
||||
- **The labels**, under the plots, and their bar, according to the chosen source:
|
||||
- **Detectors** (default): the detectors' events (`detectors/scripts/categories.py`, `window`: the range with its 3 days of history), read-only. The bar carries only their family, the tooltip their targets; on click: their dates, their sensors (targets and references), the message and the action (`labeling/scripts/client.py`: the first sentence of the text of the event; the "For the client" columns of `labeling/families.md`, per family, refined per variety);
|
||||
- **Detectors** (default): the detectors' events (`detectors/detectors/categories.py`, `window`: the range with its 3 days of history), read-only. The bar carries only their family, the tooltip their targets; on click: their dates, their sensors (targets and references), the message and the action (`labeling/scripts/client.py`: the first sentence of the text of the event; the "For the client" columns of `labeling/families.md`, per family, refined per variety);
|
||||
- **LLM**: `labeling/auto/<STATION>.jsonl`, read-only;
|
||||
- **Analysis**: the same labels, to edit or delete; writes in `labeling/auto/<STATION>.jsonl`, each label checked by the rules of labeling (`labeling/scripts/validate.py`, `check`: one of the seven families, no numeric value…) and given its id (`ids.py`, `assign`);
|
||||
- **Support**: the same labels, read-only, to ask the support a question on a range.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""The data of the Data page: a station's images, its curves, its labels.
|
||||
|
||||
Data are read as the agents read them, tools/scripts/data.py (the tools repository, through the tools/ link); the detectors'
|
||||
events are those of detectors/scripts/categories.py (window); the rules of the labels and what the client is told, those of
|
||||
events are those of detectors/detectors/categories.py (window); the rules of the labels and what the client is told, those of
|
||||
labeling/scripts (validate, ids, client). Read-only on data/, filled only by pump.sh; writes only in
|
||||
labeling/auto/. What brings data in (the pumping, the list of the tracked stations) is in ~/aimsight-data, called as it
|
||||
is (extraction/pumping.py); the weather is pumped with the data, data/<STATION>/weather/ (data.load_weather).
|
||||
@@ -25,7 +25,7 @@ from pathlib import Path
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
# ~/aimsight-data, the repository of data/: the method that brings data in (the pumping, the weather with it), called as it is
|
||||
DATA_REPOSITORY = Path(os.environ.get("AIMSIGHT_DATA", ROOT / "data")).resolve().parent
|
||||
sys.path[:0] = [str(ROOT / "tools" / "scripts"), str(ROOT / "detectors" / "scripts"), str(ROOT / "labeling" / "scripts"),
|
||||
sys.path[:0] = [str(ROOT / "tools" / "scripts"), str(ROOT / "detectors" / "detectors"), str(ROOT / "labeling" / "scripts"),
|
||||
str(DATA_REPOSITORY / "extraction")]
|
||||
import categories # noqa: E402
|
||||
import client # noqa: E402 (labeling: what the client is told of an event)
|
||||
@@ -266,9 +266,9 @@ def pump(body):
|
||||
|
||||
# --- the Data page, "Detectors" labels: the events of the journal, read-only
|
||||
|
||||
# The sets of detectors: detectors/scripts/ (classic, imported here), detectors/manual/ (the same layout, hand-made: run in
|
||||
# The sets of detectors: detectors/detectors/ (classic, imported here), models/rules/manual/ (the same layout, hand-made: run in
|
||||
# a process of its own, its modules bear the same names as the classic ones)
|
||||
MANUAL = ROOT / "detectors" / "manual"
|
||||
MANUAL = ROOT / "models" / "rules" / "manual"
|
||||
CHILD = ("import pickle, sys; out, sys.stdout = sys.stdout.buffer, sys.stderr; sys.path.insert(0, sys.argv[1]); import categories; "
|
||||
"pickle.dump(categories.window(*pickle.load(sys.stdin.buffer)), out)")
|
||||
|
||||
@@ -278,7 +278,7 @@ def window(set_, every, a, b, sensitivity=0):
|
||||
if set_ != "manual":
|
||||
return categories.window(every, a, b)
|
||||
if not (MANUAL / "categories.py").is_file():
|
||||
raise Refusal("no manual detectors: detectors/manual/ has no categories.py")
|
||||
raise Refusal("no manual detectors: models/rules/manual/ has no categories.py")
|
||||
run = subprocess.run([sys.executable, "-c", CHILD, str(MANUAL)], input=pickle.dumps((every, a, b, sensitivity or None)), capture_output=True, cwd=ROOT)
|
||||
sys.stderr.write(run.stderr.decode(errors="replace"))
|
||||
if run.returncode:
|
||||
@@ -296,7 +296,7 @@ def detectors(station, start, end, targets="", set_="classic", sensitivity=0):
|
||||
def journal(station, start, end, targets="", set_="classic", sensitivity=0):
|
||||
"""-> the detectors' events over the range, in the label format (start, end, family, description); plus kind,
|
||||
sensors, ignore (greyed area of the journal). targets: the sensors kept, comma-separated (empty: all); the others are
|
||||
removed before the detectors, as if they did not exist. set_: classic (detectors/scripts/) or manual (detectors/manual/);
|
||||
removed before the detectors, as if they did not exist. set_: classic (detectors/detectors/) or manual (models/rules/manual/);
|
||||
sensitivity: of the manual set, 1 (tolerant) to 10 (severe), 0: the default of the code."""
|
||||
d = folder(station)
|
||||
every = data.load(d)
|
||||
|
||||
@@ -17,7 +17,7 @@ const FAMILIES = { "Anomaly": "#e03131", "Visibility": "#8ec5e8", "Obstruction":
|
||||
"Target issue": "#e6d46a", "No data": "#c4c4be", "None": "#a8d5a2" };
|
||||
const FAMILY_NAME = f => (f === "None" ? "None (curves intact)" : f);
|
||||
// A label of auto/ has one of the seven families (labeling/scripts/validate.py); None is the expert's, in manual/;
|
||||
// Anomaly, the detectors' alone (detectors/manual/events.py: something happened, without saying what)
|
||||
// Anomaly, the detectors' alone (models/rules/manual/events.py: something happened, without saying what)
|
||||
const FAMILY_CHOICES = [{ value: "", label: "(choose a family)" },
|
||||
...Object.keys(FAMILIES).filter(f => f !== "None" && f !== "Anomaly").map(f => ({ value: f, label: f }))];
|
||||
// LLM and Analysis: the same labels, labeling/auto/; LLM reads them, Analysis edits, deletes them, and has the analyst make
|
||||
@@ -51,7 +51,7 @@ export default function Data({ selection, choose, analysis, setAnalysis, support
|
||||
const [source, setSource] = useState("detectors"), [families, setFamilies] = useState(DETECTED), [targets, setTargets] = useState("");
|
||||
const [focus, setFocus] = useState(false); // with an event open, the plots show only its sensors
|
||||
const [hidden, setHidden] = useState([]); // the targets removed from the plots (the detectors still read them)
|
||||
const [set, setSet] = useState("classic"); // the detectors: classic (detectors/scripts/) or manual (detectors/manual/)
|
||||
const [set, setSet] = useState("classic"); // the detectors: classic (detectors/detectors/) or manual (models/rules/manual/)
|
||||
const [sensitivity, setSensitivity] = useState(5); // of the manual set: 1 (tolerant) to 10 (severe); 5, its limits as written
|
||||
const [cut, setCut] = useState(false); // the points under a label of the checked families removed, the curves joined
|
||||
const { station, start, end } = selection;
|
||||
@@ -133,7 +133,7 @@ function Settings({ d, families, setFamilies, targets, setTargets, detect, focus
|
||||
<div>
|
||||
<Text size="sm" fw={500}>Detectors</Text>
|
||||
<SegmentedControl size="xs" mt={4} value={set} onChange={setSet}
|
||||
data={[{ value: "classic", label: "Classic" }, { value: "manual", label: "Manual (detectors/manual/)" }]} />
|
||||
data={[{ value: "classic", label: "Classic" }, { value: "manual", label: "Manual (models/rules/manual/)" }]} />
|
||||
</div>
|
||||
{set === "manual" && <div>
|
||||
<Text size="sm" fw={500}>Sensitivity: {sensitivity}</Text>
|
||||
@@ -621,7 +621,7 @@ function Analysis({ kind = "analyses", name, dark, done, close }) {
|
||||
{o.state === "interrupted" && <Text size="sm" c="orange">Stopped with the server; rerun it with the button.</Text>}
|
||||
<Thread lines={o.lines} />
|
||||
{o.summary && <Page title="Summary" src={`/api/analyses/${name}/summary.html?dark=${dark}&v=${o.summary}`} />}
|
||||
{o.summary && <Text size="xs" c="dimmed" ff="monospace">python3 detectors/bench/score.py data/{d.station} --labels labeling/auto/{d.station}.jsonl --from {d.start.slice(0, 10)} --to {end}</Text>}
|
||||
{o.summary && <Text size="xs" c="dimmed" ff="monospace">python3 models/rules/bench/score.py data/{d.station} --labels labeling/auto/{d.station}.jsonl --from {d.start.slice(0, 10)} --to {end}</Text>}
|
||||
</Stack>
|
||||
)}
|
||||
<Text size="xs" c="dimmed">labeling/auto/{kind}/{name}/</Text>
|
||||
|
||||
Reference in new issue
Block a user