# nengdong96/etndnet architecture

> Architecture diagram of the GitHub repository nengdong96/etndnet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nengdong96/etndnet
- Repository: https://github.com/nengdong96/etndnet

## Overview

##### Project type and purpose
- ETNDNet is a Python-based deep learning training and evaluation framework (no web UI or microservices).
- It implements a full model training pipeline: data loading & preprocessing, model definition, training & testing loops, evaluation metrics, and visualization.

##### File structure
- Top-level scripts:
- main.py – entry point for training/testing
- run.sh – shell wrapper to invoke main.py with args
- core/ – orchestrates training/testing logic
- base.py – base classes for trainers/testers
- train.py/test.py – train and test workflows
- data_loader/ – data ingestion & preprocessing
- loader.py/dataset.py – dataset definitions & IO
- preprocessing.py/data_process.py – transforms & augmentation
- sampler.py – custom sampling strategies
- network/ – neural network components
- model.py – top-level model class
- res50ibnabnneck.py – specific ResNet-based architecture
- feature_map_processing.py/gem_pool.py – feature pooling operations
- tools/ – supporting utilities
- loss.py – loss function definitions
- evaluation/ – classification & re-identification metrics
- metric.py/meter.py – running metrics & statistics
- logger.py/utils.py – logging & helper functions

##### README for additional insights
- README only states “# ETNDNet,” so all architecture details must be inferred from folder names and common DL practices.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Scripts & Visualization
    subgraph "Scripts & Visualization"
        RunSH["run.sh"]:::scripts
        MainPY["main.py"]:::scripts
        Visualize["visualize.py"]:::scripts
    end

    %% Data Pipeline
    RawData[("Raw Images (Disk)")]:::data
    subgraph "Data Pipeline"
        Loader["loader.py"]:::data
        Dataset["dataset.py"]:::data
        Preprocessing["preprocessing.py"]:::data
        DataProcess["data_process.py"]:::data
        Sampler["sampler.py"]:::data
    end

    %% Core Training/Test Engine
    subgraph "Core Training/Test"
        Base["base.py"]:::core
        Train["train.py"]:::core
        Test["test.py"]:::core
    end

    %% Model Architecture
    subgraph "Model Architecture"
        Model["model.py"]:::model
        ResNet["res50ibnabnneck.py"]:::model
        FMapProc["feature_map_processing.py"]:::model
        GeMPool["gem_pool.py"]:::model
    end

    %% Utilities & Evaluation
    subgraph "Utilities & Evaluation"
        Logger["logger.py"]:::util
        Utils["utils.py"]:::util
        Loss["loss.py"]:::util
        Meter["meter.py"]:::util
        Metric["metric.py"]:::util
        subgraph "Evaluation"
            Classification["classification.py"]:::util
            ReID["reid.py"]:::util
        end
    end

    %% Data Flow
    RawData -->|"images"| Loader
    Loader -->|"load()"| Dataset
    Loader -->|"transform()"| Preprocessing
    Preprocessing -->|"process()"| DataProcess
    DataProcess -->|"sample()"| Sampler
    Sampler -->|"batch"| Train

    %% Script orchestration
    RunSH -->|"invokes"| MainPY
    MainPY -->|"start()"| Train
    MainPY -->|"start()"| Test

    %% Core to Model
    Train -->|"forward()/backward()"| Model
    Test -->|"forward()"| Model

    %% Model internals
    Model --> ResNet
    Model --> FMapProc
    Model --> GeMPool

    %% Loss and Logging
    Model -->|"features"| Loss
    Train -->|"log()"| Logger
    Train -->|"update()"| Meter

    %% Evaluation
    Train -->|"epoch_end"| Classification
    Train -->|"epoch_end"| ReID
    Test -->|"metrics"| Classification
    Test -->|"metrics"| ReID

    %% Visualization
    Classification -->|"results"| Visualize
    ReID -->|"results"| Visualize

    %% Click Events
    click Loader "https://github.com/nengdong96/etndnet/blob/main/data_loader/loader.py"
    click Dataset "https://github.com/nengdong96/etndnet/blob/main/data_loader/dataset.py"
    click Preprocessing "https://github.com/nengdong96/etndnet/blob/main/data_loader/preprocessing.py"
    click DataProcess "https://github.com/nengdong96/etndnet/blob/main/data_loader/data_process.py"
    click Sampler "https://github.com/nengdong96/etndnet/blob/main/data_loader/sampler.py"
    click Base "https://github.com/nengdong96/etndnet/blob/main/core/base.py"
    click Train "https://github.com/nengdong96/etndnet/blob/main/core/train.py"
    click Test "https://github.com/nengdong96/etndnet/blob/main/core/test.py"
    click Model "https://github.com/nengdong96/etndnet/blob/main/network/model.py"
    click ResNet "https://github.com/nengdong96/etndnet/blob/main/network/res50ibnabnneck.py"
    click FMapProc "https://github.com/nengdong96/etndnet/blob/main/network/feature_map_processing.py"
    click GeMPool "https://github.com/nengdong96/etndnet/blob/main/network/gem_pool.py"
    click Logger "https://github.com/nengdong96/etndnet/blob/main/tools/logger.py"
    click Utils "https://github.com/nengdong96/etndnet/blob/main/tools/utils.py"
    click Loss "https://github.com/nengdong96/etndnet/blob/main/tools/loss.py"
    click Meter "https://github.com/nengdong96/etndnet/blob/main/tools/meter.py"
    click Metric "https://github.com/nengdong96/etndnet/blob/main/tools/metric.py"
    click Classification "https://github.com/nengdong96/etndnet/blob/main/tools/evaluation/classification.py"
    click ReID "https://github.com/nengdong96/etndnet/blob/main/tools/evaluation/reid.py"
    click MainPY "https://github.com/nengdong96/etndnet/blob/main/main.py"
    click RunSH "https://github.com/nengdong96/etndnet/blob/main/run.sh"
    click Visualize "https://github.com/nengdong96/etndnet/blob/main/visualize.py"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef core fill:#90EE90,stroke:#000,stroke-width:1px
    classDef model fill:#FFA500,stroke:#000,stroke-width:1px
    classDef util fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef scripts fill:#D8BFD8,stroke:#000,stroke-width:1px
```
