deep-tempest/end-to-end/README.md

50 lines
2.1 KiB
Markdown
Raw Normal View History

2024-06-26 16:37:25 -07:00
# End-to-End Method
2023-03-18 16:11:22 -07:00
<img src="end-to-end.png"/>
2024-06-26 16:37:25 -07:00
## Usage Guide
2024-06-26 16:40:38 -07:00
In general, the options to use (reference/degraded image folders, network models, output directory, etc.) are located in [end-to-end/options](../end-to-end/options).
2023-03-18 16:11:22 -07:00
2024-06-30 10:16:39 -07:00
You can [download at this link](https://www.fing.edu.uy/owncloud/index.php/s/IaZugHCrw5K1AcB) **pre-trained model** with the real image captures detailed at previews the [Data section](../README.md).
2024-06-26 16:37:25 -07:00
### Inference and Evaluation
2023-03-18 16:11:22 -07:00
2024-06-26 16:40:38 -07:00
To run inference, you need to edit the file [end-to-end/options/train_drunet.json](../end-to-end/options/test_drunet.json) and, once the changes are made, execute:
2023-03-18 16:11:22 -07:00
2023-10-24 13:24:18 -07:00
```shell
python main_test_drunet.py
2023-03-18 16:11:22 -07:00
```
2024-06-26 16:37:25 -07:00
This command will output a new directory with the inferences from the input directory.
2023-03-18 16:11:22 -07:00
2024-06-26 16:37:25 -07:00
To evaluate a directory with images (both reference and model's inference), you need to edit the file [end-to-end/options/evaluation.json](../end-to-end/options/evaluation.json) and, once the changes are made, execute:
2023-10-24 13:24:18 -07:00
```shell
python tempest_evaluation.py
2023-03-18 16:11:22 -07:00
```
2024-06-26 16:37:25 -07:00
### Training
2023-03-18 16:11:22 -07:00
2024-06-26 16:37:25 -07:00
**Note: Before executing the following command, you must select which type of data to use for training**
2023-03-18 16:11:22 -07:00
2024-06-26 16:37:25 -07:00
#### Training with Real Data
2024-06-26 16:42:52 -07:00
To train with real data, the file [train_drunet.json](../end-to-end/options/train_drunet.json) must have the value __"drunet_finetune"__ in the *dataset_type* field (datasets-->train).
2024-06-26 16:37:25 -07:00
#### Training with Synthetic Data
2024-06-26 16:42:52 -07:00
To train with synthetic data, the file [train_drunet.json](../end-to-end/options/train_drunet.json) must have the value __"drunet"__ in the *dataset_type* field (datasets-->train).
2024-06-26 16:37:25 -07:00
Once the data type was selected, use the following command to train the network:
2023-03-18 16:11:22 -07:00
2023-10-24 13:24:18 -07:00
```shell
python main_train_drunet.py
2023-03-18 16:11:22 -07:00
```
2024-06-26 16:37:25 -07:00
### Generating Synthetic Captures
2023-03-18 16:11:22 -07:00
2024-06-26 16:42:52 -07:00
For synthetic captured images generation, first configure the options on [tempest_simulation.json](../end-to-end/options/tempest_simulation.json) file. Be sure to include the path to the folder containing the images to run the simulation of direct capturing image from the EME of a monitor. Then run the following command:
2023-03-18 16:11:22 -07:00
2024-06-26 16:37:25 -07:00
```shell
python folder_simulation.py
```
2024-06-26 16:40:38 -07:00
Which outputs the synthetic captured in the specified folder.