If you don't have already miniconda installed on your system, please refere to the [officical miniconda documentation](https://docs.anaconda.com/miniconda/install/) and then :
If you do not have already miniconda installed on your system, please refer to the [officical miniconda documentation](https://docs.anaconda.com/miniconda/install/). Then :
Create a miniconda environment and source it:
1- Create a miniconda environment and source it:
```bash
```bash
conda create -n mupix_env python=3.11
conda create -n mupix_env python=3.11
```
```
```bash
```bash
source ~/.bashrc
source ~/.bashrc
```
```
Finally activate the environment:
2- Activate the environment:
```bash
```bash
conda activate mupix_env
conda activate mupix_env
```
```
Clone this repository to download µPIX sources :
3 - Clone this repository to download µPIX sources :
```bash
```bash
git clone https://gitlab.lis-lab.fr/sicomp/mupix
git clone https://gitlab.lis-lab.fr/sicomp/mupix
```
```
and then proceed to the installation of required Python packages:
The model is now stored inside ```./metrology_model``` folder.
The model is now stored in the ```./metrology_model``` folder.
### 2 - Download and unzip the ```metrology``` dataset
### 2 - Download and unzip the ```metrology``` dataset
...
@@ -139,10 +140,10 @@ The ```new_experiment.py``` script allows you to set up a new experiment by spec
...
@@ -139,10 +140,10 @@ The ```new_experiment.py``` script allows you to set up a new experiment by spec
| `--test_data_path`*(optional)* | Path to the test dataset (if available). |
| `--test_data_path`*(optional)* | Path to the test dataset (if available). |
In our case, as we want just to use the pre-trained µPIX ```metrology``` model in inference (no training), we don't need to provide the ```clean_data_path``` and ```noisy_data_path``` parameters so we left it empty.
In this case, since we are using the pre-trained µPIX ```metrology``` model in inference (no training), we do not need to provide the ```clean_data_path``` and ```noisy_data_path``` parameters so we left it empty.
Nevertheless, we have to indicate the path that contains the test data image we want to denoise using µPIX using the ```test_data_path``` parameter, and the ```experiment_name``` we want to create as well as the location where the experiment will be stored using the ```experiment_path``` parameter.
Nevertheless, we have to indicate the path that contains the test data image we want to denoise using µPIX using the ```test_data_path``` parameter, and the ```experiment_name``` we want to create as well as the location where the experiment will be stored using the ```experiment_path``` parameter.
Type the following to create experiment:
Type the following command to create a µPIX experiment:
| `--experiment_path` | Path to the previously created experiment. |
| `--experiment_path` | Path to the previously created experiment. |
| `--retrain`*(optional)* | Use this flag to continue training an existing µPIX model located inside the experiment path. |
| `--retrain`*(optional)* | Use this flag to continue training an existing µPIX model located in the experiment path. |
For our example, here is the command you need to type to start the training of a µPIX model for the ```metrology``` dataset:
For our example, here is the command you need to type to start the training of a µPIX model for the ```metrology``` dataset:
...
@@ -346,11 +347,11 @@ Step>3, Generator loss : 1.941e+05
...
@@ -346,11 +347,11 @@ Step>3, Generator loss : 1.941e+05
...
...
...
...
```
```
By default, the model is trained for 100 epochs (see ```hyperparameters.json```) but contains an ```EarlyStopping``` mechanisms (See the paper methods section pour details) governed by the ```patience``` parameters (see ```hyperparameters.json```).
By default, the model is trained for 100 epochs (see ```hyperparameters.json```) but it includes an ```EarlyStopping``` mechanism (See the paper methods section pour details) governed by the ```patience``` parameters (see ```hyperparameters.json```).
You can stop the training anytime. The best checkpoints of your model is available inside ```experiments/metrology_experiment/results/networks/```
You can stop the training at anytime. The best checkpoints of your model is available in the ```experiments/metrology_experiment/results/networks/``` directory.
If the training stops because it reached the maximum number of epochs defined inside the ```hyperparameters.json``` configuration file, and you want to continue to train your model for more epochs, you can use the ```--retrain``` parameters to resume the training where it stops:
If the training stops because it has reached the maximum number of epochs defined into the ```hyperparameters.json``` configuration file, and you want to continue training your model for more epochs, you can use the ```--retrain``` parameters to resume the training where it stops:
The `mupixinfer.py` script allows you to use a pre-trained µPIX model to denoise a dataset located in the `test` directory inside the experiment path.
The `mupixinfer.py` script allows you to use a pre-trained µPIX model to denoise a dataset located within the `test` directory inside the experiment path.
#### Usage
#### Usage
...
@@ -372,7 +373,7 @@ For our example, here is the command you need to type to start the inference usi
...
@@ -372,7 +373,7 @@ For our example, here is the command you need to type to start the inference usi