Commit e4e5784e authored by Maria Kleppestø Mcculloch's avatar Maria Kleppestø Mcculloch
Browse files

Update README.md

parent 8b58ff92
......@@ -9,7 +9,16 @@ The library installation can be found here: https://github.com/deepinsight/insig
## Running the opertaions
In theory all 3 operations can be run in the same instance, or in three sepearate runs. It can be beneficial to perform the operationsin two runs; first compute the baselines, and then compute and plot the metrics. For details on how to perform these three operations, read the following sections:
In theory all 3 operations can be run in the same instance, or in three sepearate runs. It can be beneficial to perform the operationsin two runs; first compute the baselines, and then compute and plot the metrics. The ``QualityEvaluator`` object is the heart of all computations. The first argument when initiating this class is the instance name. In main.py this is "ArcFaceCasiaV2", although it can be anything. Just note that all filenames that are written will be tied to the instance name, so for instance a QualityEvaluator object used to compute metrics needs to have the same instance name as the QualityEvaluator objec used to plot them. One can use the same object if these operation is done in the same run.
If you need to use a different name of the metric file than the instance name, on can specify a different filename when plotting;
``QualEval.PlotMetric("DET", "focus",subnr=params[0], sampnr=params[1], metric_name="path/to/metric/focus_values")``
Using the instance name is however best.
For details on how to perform these three operations, read the following sections:
### 0. Setting project path
......@@ -18,7 +27,7 @@ In theory all 3 operations can be run in the same instance, or in three sepearat
`` projectpath = "my/project/path/" ``
### 1. Computing the baseline.
One can use the code present in main.py to compute the baseline. In order to compute, one have to first init a QualityEvaluator object. Then, one needs to init the ArcFace method, and read in the dataset. One can the run the ccomputeBaselines() methos, which makes sure the Baselines are read in in the object. If one wants to save the baselines to file, one needs to call the saveBasine() mehtod. To do this main, do the following:
One can use the code present in main.py to compute the baseline. In order to compute, one have to first init a ``QualityEvaluator`` object. Then, one needs to init the ArcFace method, and read in the dataset. One can then run the ``computeBaselines()`` method, which will compute the baselines. If one wants to save the baselines to file, one needs to call the ``saveBasline()`` mehtod. To do this main, do the following:
#### i. Uncomment the following lines in main.py:
......@@ -40,7 +49,7 @@ One can use the code present in main.py to compute the baseline. In order to com
### 2. Compute quality metrics
This can be run as long as there are some baselines (.npy file) in ``data/`` . One does not need to have run computeBaselines() in the same run. In order to compute baselines, one needs to init a QualityEvaluator object, and run Detection_Arcface_init in order to init ArcFace. Then, one needs to call CompureMetric("name", subjectnr, samplenr). If the metric is suported, it will be computed. Then, one needs to call the SaveMetric() if one wants the metric to be read to file. This cane be done using main by doing the following:
This can be run as long as there are some baselines (.npy file) in data/ . One does not need to have run ``computeBaselines()`` in the same run. In order to compute metrics, one needs to init a ``QualityEvaluator`` object, and run ``Detection_Arcface_init`` in order to init ArcFace. Then, one needs to call ``ComputeMetric("name", subjectnr, samplenr)``. If the metric is suported, it will be computed. Then, one needs to call the ``SaveMetric()`` if one wants the metric to be read to file. This cane be done using main by doing the following:
#### i. Uncomment the following lines in main.py:
......@@ -70,7 +79,7 @@ This can be run as long as there are some baselines (.npy file) in ``data/`` . O
### 3. Plot quality metrics
This can be run as long as there are some baselines (.npy file in data/), and some quality scores for the specified metric (.npy file in data/ or .csv file in data/brisque/ ). In order to compute baselines, one needs to init a QualityEvaluator object. Then, one needs to call PlotMetric("Method", "Metric", subnr=[subnr], samnr=[sampnr]). If the metric is suported, it will be plotted. In order to do this in main, do the following:
This can be run as long as there are some baselines (.npy file in data/), and some quality scores for the specified metric (.npy file in data/ or .csv file in data/brisque/ ). In order to plot metrics, one needs to init a ``QualityEvaluator`` object. Then, one needs to call ``PlotMetric("Method", "Metric", subnr=[subnr], samnr=[sampnr])``. If the metric is suported, it will be plotted. In order to do this in main, do the following:
#### i. Uncomment the following lines in main.py:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment