Project developed in order to use LSTM (RNN) models for noise detection into synthesis images.
git clone --recursive https://github.com/prise-3d/LSTM-noise-detection.git
pip install -r requirements.txt
First you need to generate data using thresholds file (file obtained from SIN3D app):
python processing/prepare_data_file.py --dataset /path/to/folder --thresholds file.csv --method svd --params "0,200" --imnorm 0 --output output
--output
: save automatically output intodata/generated
.--params
: associated params to selected method.--imnorm
: specified if image is normalized or not before computing method.
In order to well compare models, you need to set the training and testing zones used for your dataset:
python processing/generate_selected_zones_file.py --dataset /path/to/folder --n_zones 12 --output file --thresholds file.csv
--output
: save automatically output intodata/learned_zones
Each image is cut out into 16 zones, then you need to use the n_zones
parameter to set you number of zones selected for training part.
The generated output file contains information for each scene about indices used for training and testing sets.
Then, you can generate your dataset:
python processing/prepare_dataset_zones.py --data data/generated/output --selected_zones data/learned_zones/file --sequence 5 --output data/datasets/name
--data
: specify the output data folder path generated when precomputing features (saved intodata/generated
).--selected_zones
: the previous output file generated in order to set (if specifiedn_zones
is not used).--sequence
: sliding window size to use as sequence input.--n_zones
: number of zones to take if ramdomly zones choice.--output
: save automatically output intodata/datasets
.
You can now use your dataset to train your model:
python train_lstm_weighted.py --train data/datasets/dataset/dataset.train --test data/datasets/dataset/dataset.train --output modelv1 --seq_norm 1
--data
: specify the dataset name (without .train and .test generated extension) obtained from previous script.--output
: save automatically output intodata/saved_models
.--seq_norm
: set normalization of data by feature for sequence
python display/display_thresholds_scene_file.py --model data/saved_models/modelv1.joblib --method svd --params "0,200" --sequence 5 --imnorm 1 --scene /path/to/scene --selected_zones data/learned_zones/file --thresholds filename.csv --save_thresholds simulation.csv --label_thresholds "Simulate modelv1"
--folder
: scene folder to simulate on.--save_thresholds
: save estimated thresholds into file.--label_thresholds
: label to use for this model into the saved file.