chuiyunjun / aps490

1 stars 3 forks source link

Predictive Building System Maintenance -- Anomaly Detection

(For simplified demo on Google Colab, save "APS490" folder to your Google Drive or view it here: https://drive.google.com/file/d/1FwafCGFpnnft0bUER9L9gcMgOXJAw_sW/view?usp=sharing).

1. Recommanded environment setting

1.1 install miniconda3

a. Install Miniconda:

(Linux OS; installation in another os could be found in the link above)

   curl 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh' > Miniconda.sh
   bash Miniconda.sh
   rm Miniconda.sh

b. Close and re-open your terminal session.

c. Change directories (cd) to where you cloned this repository.

d. Initialize conda

$ conda init

1.2 create an environment inside the conda

$ conda env create -f environment.yml

1.3 activate the environment

$ conda activate aps490

2. Training

Example:

$ python -m prediction.main train --output_root=./output/

3. Validate

You may use the following command to train the model.

$ python -m prediction.main validate --output_root=<output directory root> --checkpoint_path=<checkpoint path>

Keyword arguments:

Example:

$ python -m prediction.main validate --output_root=./output/ --checkpoint_path=./output/model.pth

4. UI main page

Visualize the prediction and anomaly analysis

$ streamlit run stream_app.py