{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Label statistics\n", "This very simple notebook iterates through labels from Labels.py and counts anomalous, normal and not annotated images." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from py.Labels import LABELS" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Beaver_01: 0 anomalous, 74 normal, 0 not annotated, 695 max\n", "Marten_01: 732 anomalous, 2373 normal, 0 not annotated, 3105 max\n", "Fox_03: 246 anomalous, 3702 normal, 1547 not annotated, 5495 max\n", "GFox_03: 246 anomalous, 3702 normal, 1547 not annotated, 5495 max\n" ] } ], "source": [ "for session_name, labels in LABELS.items():\n", " anomalous = len(labels[\"anomalous\"]) if \"anomalous\" in labels else 0\n", " normal = len(labels[\"normal\"]) if \"normal\" in labels else 0\n", " not_annotated = len(labels[\"not_annotated\"]) if \"not_annotated\" in labels else 0\n", " max_nr = labels[\"max\"] if \"max\" in labels else 0\n", " print(f\"{session_name}: {anomalous} anomalous, {normal} normal, {not_annotated} not annotated, {max_nr} max\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.4 ('pytorch-gpu')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.4" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "17cd5c528a3345b75540c61f907eece919c031d57a2ca1e5653325af249173c9" } } }, "nbformat": 4, "nbformat_minor": 2 }